#avr | Logs for 2012-08-22

Back
[00:44:47] <ecraven> morning :)
[00:45:22] <ecraven> on an atmega8, is there a libc function to get the current time since system startup in milliseconds or something like that? i want to measure intervals, but would like to avoid using timers :)
[00:45:30] <ecraven> the timing doesn't have to be exact
[00:52:13] <Casper> ecraven: there is no such thing on AVR
[00:52:19] <Casper> arduino emulate that with timer
[00:56:53] <ecraven> hm.. ok, then i'll have to use that :) thank you!
[03:41:57] <Mr_Sheesh> Question - Anyone used ATTiny15's and ATTiny85's? If I code for the '15 and later neet to upgrade to the '85s, are there issues? Wondering
[03:44:53] <Xark> I have never used 15s, but from looking at the datasheet they seem very similar feature-wise to the 25/45/85, so I suspect you would have few problems (but YMMV - the devil can be in the details).
[03:46:27] <Mr_Sheesh> TY - just wondering / checking to see if anyone knew - I used AT90 series parts a lot a while back, RL interfered with my coding for a while
[03:47:51] <Xark> NP. I don't really notice any difference offhand (other than memory sizes). :) The chip numbers sure make them *seem* related (but it is a different manual than 24/45/85 so something must be different).
[03:50:20] <Mr_Sheesh> Yeah. Some things I do, the '15 might work, but if I get it working except that I want a little more room, may just move to the '85s. I guess I'll just have to read 350 pages or so of datasheets LOL
[03:50:54] <Mr_Sheesh> The AT90S2313 to AT90S8515 path is EASY, basically "reasign pin numbers you use to match the new uC"
[03:54:05] <Xark> The pinout is the same between 15/25/45/85 AFAICT. One difference I do spot is apparently 15 doesn't allow for external crystal (it is an option on the others, if you want to give up two precious pins).
[03:55:09] <Xark> It does look like the chips other than 15 do offer some features (now that I have the pages open side by side). However, they seem to be a superset.
[03:57:07] <Mr_Sheesh> I'll have to either read thoroughly or test it & see if it works :P TY
[04:09:28] <CapnKernel> http://avi.hobby-site.org:8888/PowerUnitsSurvey/
[04:18:56] <megal0maniac> My mega1284 arrived today :)
[04:19:07] <megal0maniac> Now to figure out what to use it for...
[04:19:09] <Xark> powah! :)
[04:20:43] <Xark> I like my 1284, but wish it overclocked to 28Mhz reliably like its little brother the 644 (then I could swap it in the Uzebox for more SRAM). :)
[04:22:44] <CapnKernel> !seen RikusW
[04:22:44] <tobbor> RikusW was last seen in #avr on Aug 21 12:21 2012
[04:22:56] <CapnKernel> !seen CapnKernel
[04:22:57] <tobbor> capnkernel is here
[04:23:01] <CapnKernel> !time
[04:23:02] <tobbor> My watch says its 02:12 Wed Aug 22 2012
[04:28:44] <megal0maniac> Where does tobbor live?
[04:29:58] <megal0maniac> Why doesn't the 1284 overclock while the 644 does?...
[04:30:29] <CapnKernel> I don't know, but he's managed by rue
[04:31:05] <megal0maniac> There are numerous rues :)
[04:31:12] <megal0maniac> All the same though, I assume
[04:32:01] <Tom_itx> EST
[04:32:25] <Tom_itx> GMT-4?
[04:32:27] <Xark> megal0maniac: I am not sure, but I am not the only one to be disappointed by this. The theory is that the >64K required a whole new chip layout/design (since PC etc. have more bits).
[04:33:05] <Tom_itx> no PST
[04:37:26] <megal0maniac> Hmmm... Doesn't bug me yet, 20mhz is fine for now. But I can always get the 644 later. Checked out Uzebox, but the AD725 is double the price of the 644 :/
[04:39:58] <Xark> Yeah. Tricky to solder too. However, Uzebox is fairly impressive for what it is (very nice picture on my bigscreen LCD and some good games - even if pixels are about the size of Legos). :)
[04:48:04] <megal0maniac> Xark: Wouldn't you be able to get a standard VGA output without using the AD725?
[05:27:11] <Xark> I don't think you need AD825 for VGA, but the pixel rate is much higher (which means much lower resolution).
[05:27:18] <Xark> 725*
[05:28:12] <megal0maniac> I guess you can't really just send arbritrary RGB signals to a VGA monitor
[05:28:20] <megal0maniac> Need sync of some sort, no?
[05:29:24] <CapnKernel> megal0maniac: You'd be surprised: http://www.linusakesson.net/scene/craft/
[05:29:50] <megal0maniac> I've seen that :) Really impressive. Wonder what you can do with the 1284...
[05:30:00] <OndraSterver> there was dude who with single tiny15 send vga stuff
[05:30:00] <Xark> http://tinyvga.com/avr-vga
[05:32:43] <megal0maniac> OndraSterver: I think it was a score board thing
[05:33:10] <megal0maniac> http://microvga.com/
[05:34:37] <OndraSterver> http://www.linusakesson.net/scene/bitbanger/index.php
[06:21:20] <Trieste> Hm, I recall something about "waiting for the ADC to settle" - what's that? I didn't find anything about having to wait before taking a measurement in the datasheet for my ATTiny
[06:23:15] <OndraSterver> first sample should be discarded I think
[06:25:45] <Trieste> yeah, but I mean waiting between measurements - haven't heard anything about that? I think I saw it in an arduino example
[06:27:41] <megal0maniac> Usually there's a very short delay between samples.
[06:28:08] <megal0maniac> Just to be safe more than anything else, I think. In the interest of accuracy :)
[06:30:07] <Trieste> I see, thanks, I'll add that then :)
[06:32:37] <megal0maniac> I remember the example you're talking about, though. The delay was something negligible like 10uS
[06:32:45] <megal0maniac> iirc
[06:33:42] <MotionObserver> hi guys :D
[06:34:28] <Trieste> Yeah, but I've never heard of it, and I seem to get (not being able to simply print values sucks :<) pretty wildly flailing results, so I figured I'd ask about it :)
[06:34:30] <CapnKernel> Trieste: There can be two reasons for that.
[06:34:47] <CapnKernel> First is that the ADC is not a flash converter, it takes a few cycles to convert
[06:35:13] <CapnKernel> The other reason is that if you change the ADC mux from one pin to another, you should wait a little bit
[06:35:47] <megal0maniac> Oh yes. There's only one ADC, but all the "analogue" pins are multiplexed to it
[06:37:12] <Trieste> So it doesn't apply if I'm taking measurements from just one pin, right?
[06:38:44] <megal0maniac> Well back to the first point, it does take a few cycles to convert
[06:43:00] <Trieste> Well, I check for that by looping until the ADSC bit is false - which just reminds me, how big are the precision improvements if I enter sleep mode until the conversion is finished?
[06:44:36] <CapnKernel> From memory, about 1.5 bits
[07:11:49] <Trieste> hrm, and one last check. is extracting the 10-bit ADC result from the two 8-bit registers correct like this? "result = ADCL|(ADCH<<8)"
[07:12:42] <CapnKernel> Trieste: From memory there's a mode that selects how you get the 10 bits out.
[07:13:21] <Trieste> Because I seem to get stupid values, the value is apparently >512 only at a point which should be a little higher than the reference voltage
[07:14:14] <Trieste> CapnKernel: well, there's ADLAR which right or left aligns the value, but I was wondering whether it's right in principle - ADCH holds two most significant bits, so I shift it all the way to the left and then OR it with the less significant bits in ADCL
[07:14:38] <CapnKernel> Trieste: Rings a bell. Why not try it and see?
[07:14:50] <specing> Trieste: u16 bla = ADC;, there, done
[07:14:50] <CapnKernel> Stick a pot on it and output the numbers.
[07:15:33] <Trieste> specing: agh. thanks, I must have missed that
[07:15:53] <specing> you can also ADLAR=1 and forget about the lower 2 bits
[07:16:17] <Trieste> specing: that's what I did before, yes, but I'd like to use the full 10 bits
[07:17:17] <Trieste> CapnKernel: I just have a simple parallel port programmer, no connection to the computer to use the USI (though I guess I could use an arduino I have lying around), so no outputting :<
[07:19:12] <specing> wow, using a parallel port is that difficult?
[07:19:29] <specing> there are multiple connection options
[07:19:44] <specing> serial, parallel, i2c (over VGA), ...
[07:20:03] <Trieste> oh, I didn't know that
[07:21:09] <Trieste> Sorry, just started with AVRs, I'll have a look at communicating with USI over parallel port
[07:22:02] <Tom_itx> reading adc should not exceed the reference voltage
[07:22:03] * specing pulls a 100 years old tree out of the ground
[07:22:14] * specing slams Trieste into the ground with it
[07:22:53] <Trieste> :(
[07:23:03] <specing> WHERE THE FUCK DID YOU GET THE IDEA OF USING THE UNIVERSAL SERIAL INTERFACE TO CONNECT TO THE PARALLEL PORT??!?!?!
[07:23:14] <specing> *SERIAL* TO *PARALLEL*??!
[07:23:21] * specing slams Trieste into the ground again
[07:23:36] <karlp> specing: you can read in on whatever pins of the parallel port you want
[07:23:45] <karlp> no-one says you hve to use them all in parallel :)
[07:24:11] <specing> yeah but then you can't just cat /dev/parport
[07:26:17] <Trieste> specing: so what do you suggest?
[07:27:44] <CapnKernel> specing: Easy on old chap!
[07:27:56] <Trieste> the only connection I have between the computer and the mcu is the parallel cable I use for programming it, didn't think of anything else
[07:28:04] <CapnKernel> I'm sure Trieste came here thinking #avr was for help with AVR, not WWE.
[07:28:39] <CapnKernel> Trieste: Do you have the pins to implement some other kind of connection?
[07:30:33] <CapnKernel> One trick is to use the arduino - input serial pin goes to the output pin of your AVR, and the output serial pin goes to the onboard FTDI, as normal. In other words, you're using the Arduino as an expensive one-way TTL serial -> USB connector
[07:32:12] <specing> Can't the FTDI be bypassed?
[07:32:26] <Trieste> CapnKernel: I thought the USI on the ATTiny and UART on the Arduino mcus aren't compatible
[07:32:47] * specing slams Trieste again
[07:33:46] <megal0maniac> specing: It can, because the UART pins are broken out as D0 and D1
[07:36:16] <CapnKernel> Trieste: I don't know much about the AVRs, but I believe USI is the engine for doing SPI and I2C, which is separate from the UART
[07:36:51] <megal0maniac> CapnKernel +1
[07:37:25] <specing> USI is pretty basic and is meant to ease the implementation of whatver serial protocol you want
[07:37:53] <Trieste> oh, I see
[07:38:25] <specing> So instead of having an interrupt routine that shifts bits out and shifts bits in (complicated), you get 3 usi interrupts and it does it for ya
[07:38:40] <CapnKernel> Glorified shift register
[07:39:11] <CapnKernel> If your ATtiny doesn't have a UART (check the datasheet) then if you want to get some data out of chip, you'll need to take another route
[07:39:59] <megal0maniac> Trieste: Which ATtiny?
[07:40:32] <Trieste> CapnKernel: that's why I thought I can't use it, there's no UART
[07:40:35] <Trieste> megal0maniac: ATTiny45
[07:40:46] <CapnKernel> Trieste: Call me crazy, but your other option is to use about six cheap and commonly available components, and give your board USB
[07:40:55] <CapnKernel> I've done software USB on an ATtiny85
[07:41:50] <CapnKernel> Here is a practical demo: http://www.frank-zhao.com/cache/usbbusinesscard.php
[07:42:03] <CapnKernel> That also works just fine with an ATtiny45.
[07:42:03] <megal0maniac> USB doesn't support CDC serial (very well, because it violates the USB standard) but there is a bootloader for USB
[07:42:18] <CapnKernel> You don't need to make it serial, or anything really.
[07:42:22] <CapnKernel> Just a raw hid device
[07:42:34] <CapnKernel> Trieste is just looking to get some numbers back.
[07:43:04] <CapnKernel> megal0maniac: Re "USB doesn't support CDC serial", do you mean "V-USB"?
[07:43:16] <CapnKernel> (Trieste: V-USB is the software USB for AVRs)
[07:44:07] <CapnKernel> If I were Trieste, I'd add USB, and get the chip to send back samples. Then sniff the USB bus using wireshark.
[07:44:46] <CapnKernel> Trieste: I have some blog articles about getting V-USB working on an AVR, if you're interested. (And it's also ok if you're not)
[07:45:47] <CapnKernel> If you want to go that route, here's three hardware ideas: http://vusb.wikidot.com/hardware
[07:48:57] * specing plugs CapnKernel into the matrix
[07:49:04] <Trieste> CapnKernel: Whoa, thanks, I'll take a look at that
[07:56:34] <plutox> I am also using vusb in a project. Do you know if it is possible to use the same vusb code for the bootloader and main app (descriptors are identical)?
[07:57:05] <CapnKernel> plutox: Not out of the box, but there's no reason why you couldn't.
[07:57:06] <plutox> by the same code I mean: the same code in flash (to save soem space)
[07:57:29] <plutox> the reason is that I run out of flash on my mega8
[07:57:37] <CapnKernel> Yes, the V-USB routines in the bootloader flash could be called by the routines in the app flash
[07:57:42] <Blecha> I finally got a nice light KS0108 library running
[07:57:50] <CapnKernel> Yay
[07:57:57] <Blecha> So happy I dont have to use that arduino crap
[07:58:04] <plutox> I guess I could find the addresses of the bootloader routines and put them in the linker script of my main project?
[07:58:08] <specing> KS0108?
[07:58:13] <Blecha> GLCD
[07:58:20] <specing> ok
[07:58:49] <CapnKernel> plutox: You'd have to do some linker trickery so that when you were linking your app, calls to the V-USB routines would have the right address
[07:58:56] <plutox> btw, is anybody interested in a vusb pic32 programmer?
[07:59:06] <Blecha> It was so bloated before it took about 30 seconds to transfer with jsut basic time keeping going on
[08:00:08] <specing> plutox: I'd be interested in a pic1{6,8}f programmer...
[08:00:11] <plutox> CapnKernel: I think I could take them from the linker .map (output) from the bootloader and modify the linker script for my main.app (declaring the functions as extern in the code)
[08:00:36] <CapnKernel> Yes you may well be able to.
[08:00:48] <plutox> specing: i also wrote a pic18 programmer but the code is on a different pc
[08:00:50] <specing> plutox: readelf -s firmware.elf | grep FUNC dumps those addresses
[08:00:57] <CapnKernel> Yay
[08:00:58] <plutox> yes
[08:01:47] <specing> Also -Wl,--defsym -Wl,func=0xXXX
[08:02:14] <plutox> specing: a while back I posted a usbasp firmware mod for pic18, take a look at the dangerousprototypes forums
[08:02:55] <plutox> specing: thats nice, so I dont need to modify the linker script
[08:03:21] <plutox> specing: here it is: http://dangerousprototypes.com/2012/03/19/you-can-now-use-usbasp-with-picprog-to-program-your-pic18-and-pic24-microcontrollers/
[08:04:42] <plutox> specing: just modify the ICSP pin settings and flash it to you vusb board. then you need to checkout piratepicprog, patch it and build it
[08:06:33] <plutox> no pic16 support though but you could write it yourself ;). I looked into it and it isnt that hard.
[08:06:40] <specing> Does the programming work fine though?
[08:06:59] <specing> The programmer I have is hellish, verification errors everywhere.
[08:23:36] <plutox> specing: yes, it works. (I had no verification errors)
[08:25:39] <plutox> actually I wrote another version with my own pc side app which works very well. That one will also has pic24 support and pic16 (if I can free up enough space)
[08:29:10] <plutox> its also quite fast (for a vusb device) I would say, it read the 32k flash of a pic18f25j50 in about 5secs
[08:35:55] <plutox> btw, how can you get verification errors? the programming is self timed. problems with the reliability of the usb connection? I am using simple (add all together) checksums but I think I havent implemented a resend on error in the host app since I never had erroneous usb transfers.
[08:40:15] <plutox> okay, maybe a to fast icsp clock and or disrespecting the timings given in the programming spec
[09:49:00] <molavy> hi
[09:49:01] <tobbor> hi molavy.
[09:49:18] <molavy> where can i ask about arm MCU
[09:49:21] <molavy> ?
[09:50:02] <molavy> i checked #nxp ,#arm ,#atmel,but there is no one there
[09:50:23] <molavy> i checked #cortex so, with no success
[09:50:32] <megal0maniac> "Don't ask to ask"
[09:50:55] <molavy> ok,i want connect at91sam7x256 to jlink or using samba
[09:51:46] <molavy> how can i up and running samba connection to at91sam7x256
[09:52:32] <molavy> i have 100 pin dip and change MCU to dip and install it on bread board
[09:52:50] <karlp> molavy: there is also ##arm,
[09:53:06] <karlp> freenode gets cranky when people other than the rights holder uses the single # name
[09:53:38] <molavy> karlp,thanks
[09:53:43] <plutox> molavy: whats is the exact problem?
[09:54:24] <plutox> software wise or do you want to know where to connect your probes?
[09:54:57] <molavy> i don't know how to power on at91sam7x256 and how to connect 4 usb cable to MCU pins
[09:55:16] <molavy> i read samba document on atmel site
[09:55:41] <molavy> but i can't understand what that means
[09:56:35] <plutox> ohh, I guess you should first connect all the supply pins
[09:59:00] <molavy> there is some type of VDD like VDDIN ,VDDOUT and VDDIO on datasheet pins table
[09:59:08] <plutox> not sure about your specific device but I think I once used an at91sam7s64 and it has two supply voltages (io and core) but comes with an onboard regulator. for samba you can connect to the debug uart and download the samba software from atmel iirc.
[10:01:11] <plutox> molavy: you feed 3v3 to vddio and the onboard regulator (vddin?) and get 1v8(?) on vddout and hook that up to vdd (I am only guessing here, check the datasheet!!!)
[10:01:41] <molavy> yes there is a VDDCORE too
[10:02:27] <molavy> and VDDPLL and VDDFLASH,
[10:03:15] <molavy> but there is no exact "VDD"
[10:04:05] <plutox> I would recommend to read the datasheet or look up some schematic to find out what voltages you need to feed to those different supply pins
[10:04:54] <molavy> i found VDDcore need 1.8, feed from vddout
[10:05:06] <plutox> sounds good
[10:07:39] <plutox> btw, you should probably also throw in some appropriate caps (also for the regulator) ;)
[10:11:11] <plutox> molavy: I fear you cannot dcc pictures to me, I am using the webchat
[10:12:15] <plutox> btw, here is a schematic: http://www.rlocman.ru/i/Image/2010/01/18/3.gif
[10:13:07] <plutox> on the lower left of the sam7x256 symbol are all the supply pins!
[10:13:36] <molavy> Oh,what is this man, really complex
[10:14:35] <plutox> concentrate on the lower left, that probably all you need for now
[10:15:43] <karlp> atsam chips need to manually pass vddout back into vddcore?
[10:16:06] <karlp> how odd
[10:17:40] <plutox> indeed. btw, some of the newer luminaris cortex also have an onboard ethernet phy
[10:19:00] <plutox> ohh, they are called luminary
[10:21:13] <MotionObserver> hey guys, are you ready for the question?
[10:21:57] <specing> Like totaly tell us about the project!
[10:22:52] <specing> < molavy> i have 100 pin dip and change MCU to dip and install it on bread board
[10:22:58] <specing> You must be trolling us
[10:23:05] <specing> 100 pin DIP? ARM?
[10:23:19] <specing> you changed the MCU to DIP?
[10:23:26] <specing> How so? Did you flip a switch?
[10:27:30] <molavy> something like this
[10:27:31] <molavy> http://eshop.eca.ir/product_info.php?cPath=113&products_id=617
[10:27:40] <molavy> but with 100 pins
[10:28:01] <molavy> http://eshop.eca.ir/popup_image.php?pID=617
[10:40:14] <plutox> indeed, somebody was once selling nice adapters on ebay for 100pin pic32 that could be mounted "vertically" on a breadboard
[10:42:38] <plutox> molavy: why did you choose the sam7x256? Its a bit dated I think (ARM7). What do you want to do?
[10:43:39] <molavy> nothing at all for a newbie
[10:44:14] <molavy> but at last i want connect a arm MCU to toshiba TCM8240MD Image Sensor
[10:46:20] <molavy> i just reading books for months about digital electronic.
[10:46:50] <plutox> and you insist to connect the power pins yourself?
[10:46:55] * specing thinks molavy is trolling us
[10:49:40] <molavy> specing,why you think i trolling you? i think here is academic.
[10:49:45] <plutox> specing: have you tried that modified usbasp for pic18?
[10:51:36] <plutox> molavy: I guess you just chose a very overpowered/bulky device for your beginners project (I hope you dont mind if I call it this way) which makes it look a bit strange
[10:59:22] <specing> plutox: nope, playing with xen
[11:04:13] <plutox> there is one thing I dont like about the picX (X<=18): there is no good free compiler (sdcc for pic18 sucks)
[11:05:55] <Tom_itx> what about ccs?
[11:06:12] <Tom_itx> not free but it works
[11:11:46] <specing> plutox: They should have fixed it in the 3 years I was away from it
[11:13:02] <Trieste> How exactly do I use the ADC sleep mode? I just replaced setting ADSC to 1 with "set_sleep_mode(SLEEP_MODE_ADC); sleep_mode();", but it doesn't seem to wake up from the sleep
[11:13:36] <Trieste> I also found some variations (not using sleep_mode() but sleep_enable, sleep_cpu, and sleep_disable) and also adding "EMPTY_INTERRUPT (ADC_vect);" - still doesn't wake up
[11:14:45] <CapnKernel> Trieste: There's an AVR FAQ, if you haven't read it, it can help you answer some of your questions: http://www.nongnu.org/avr-libc/
[11:15:25] <CapnKernel> In particular, try this: http://www.nongnu.org/avr-libc/user-manual/group__avr__sleep.html
[11:17:49] <Trieste> I already found that page, but thanks for linking it anyway - I didn't notice that I need to enable interrupts before sleeping, agh.
[11:18:09] <molavy> plutox, i connected a 3.3 V to pin number 8 and check pin 7 with digital multimeter . it's show about 2.8V
[11:20:26] <molavy> that means my MCU is corrupted?
[11:21:56] <Trieste> hm, still doesn't wake up, even after calling sei()
[11:29:00] <OndraSterver> molavy, well, have you tied ALL the power pins to their respective sources?
[11:29:10] <OndraSterver> decoupled every vcc/gnd pair
[11:34:58] <vsync_> decoupling is for pussies
[11:36:21] <OndraSterver> ... keep telling that to yourself
[11:36:26] <OndraSterver> till you run into some weird issues :D
[11:37:23] * Tom_itx sprinkles noisy dust all over vsync_
[11:44:15] <OndraSterver> I decouple every vcc pin
[11:44:19] <OndraSterver> with 100nF
[11:44:28] <OndraSterver> and 10uF per two or three Vcc/GND pairs
[11:44:41] <Tom_itx> some designs even suggest 2 or 3 or more per pin
[11:44:44] <Tom_itx> varying values
[11:44:47] <OndraSterver> yep
[11:44:51] <OndraSterver> 1uF is quite often used as well
[11:44:54] <OndraSterver> and 10nF too
[12:02:37] <karlp> any manuufacturer worth listening to provides a hardware design guidelines app note
[12:04:59] <Tom_itx> some listen with deaf ears
[12:07:20] <karlp> I think some actively cover their ears too :)
[12:10:22] <OSterver> I tend to tell myself "meh, that doesn't apply to me!"
[12:10:23] <OSterver> lol
[12:17:13] <Tom_itx> http://www2.electronicproducts.com/Wi_Fi_gateway_module_is_low_cost-article-BPJH06_Saelig_WizFi630_Oct2012-html.aspx
[12:26:30] <Steffanx> 35$ ? not too bad
[12:27:26] <karlp> $35 will get you a carombola,
[12:27:37] <karlp> or tplink micro hotspot
[12:33:42] <OSterver> 22 will get you wifi ap
[12:33:52] <OSterver> USB powered if you want
[12:34:01] <OSterver> + add ethernet to your micro
[12:34:01] <OSterver> DONE
[12:34:11] <OSterver> or hack internal serial
[13:14:43] <kbs> I apologize for what must be an faq, but I'm a bit overwhelmed by all the info. I'd like to run an emulator, and (hopefully) a gcc toolchain on my mac os x, so I can play with both assembler/C-based coding on various atmel devices. Could a kindly soul point me to the right place to find info on this?
[14:10:43] <Posterdati> hi
[14:10:55] <RikusW> hi
[14:11:17] <Posterdati> I've got a nasty problem with avr-gcc (4.7) and atmega2560, sin, cos, atan2 and printf trashes my chip :)
[14:11:48] <RikusW> stack overflow ?
[14:12:10] <Posterdati> ok
[14:13:04] <Posterdati> but why?
[14:14:27] <specing> because printf is huuuugggeeee
[14:23:40] <Posterdati> specing: yes, but now I removed all the printf and leaved sin and cos, but problem remains
[14:24:47] <OndraSterver> wow, still haven't solved that? :o
[14:25:24] <Posterdati> no
[14:33:52] <specing> You are doing something wrong, Posterdati :P
[14:34:20] <Posterdati> sure
[14:34:22] <Posterdati> what?
[14:34:34] <Posterdati> maybe a linker/compiler switch
[14:46:29] <Posterdati> specing: I could compile my project on a 32bit machine...
[15:06:26] <Posterdati> no way
[15:06:41] <OndraSterver> it works on 32bit avrgcc? :D
[15:06:59] <Posterdati> no
[15:07:09] <OndraSterver> oh
[15:07:42] <Posterdati> this is my Makefile
[15:08:57] <Posterdati> http://pastebin.com/usah9Rqk
[15:10:01] <Posterdati> I'm using the default linker script
[15:10:11] <Posterdati> is the heap automatic?
[15:11:33] <OndraSterver> yes
[15:12:25] <Posterdati> did you see my Makefile?
[15:13:17] <OndraSterver> I don't use makefiles manually myself, I have atmel studio
[15:15:21] <smeding> weirdo
[15:16:33] <Posterdati> what?
[15:16:59] <smeding> using an IDe
[15:17:00] <smeding> IDE
[15:17:06] <smeding> why would you do that
[15:17:10] <Posterdati> yes why?
[15:18:48] <tmpvar> I would use it for debugging
[15:18:58] <tmpvar> right now.. i just guess :(
[15:34:47] <MotionObserver> hey chaps i need to learn about ascii/hex/bits/bytes for a little data exchange project I'm working on , can anyone point me in the right direction resources-wise?
[15:38:30] <OndraSterver> MotionObserver, what about that?
[15:38:36] <OndraSterver> byte = 8bits
[15:38:46] <OndraSterver> ascii = characters table
[15:38:56] <OndraSterver> hex = view of numbers
[15:39:01] <OndraSterver> where the base is 16
[15:39:03] <MotionObserver> i gathered all that up so far, is there much more to it?
[15:39:07] <OndraSterver> no
[15:39:19] <MotionObserver> doesn't hex mean 6 though ? ^ ^
[15:40:35] <RikusW> hexadecimal --- 16
[15:40:48] <RikusW> 0-9 a-f
[15:41:27] <damon> which is still a wrong latinization (iirc)
[15:42:18] <damon> there is "much more to it", but thats the basics
[15:43:00] <damon> e.g. on some machines a byte is not 8 bit, just to be picky
[15:43:08] <OndraSterver> byte is always 8 bits
[15:43:11] <OndraSterver> "word" is not always 2 bytes
[15:43:12] <damon> nope
[15:43:22] <damon> you mean an octet
[15:43:41] <OndraSterver> octet = base8 view of a number
[15:43:49] <damon> there was a time, when byte wasnt that clearly defined as today
[15:43:55] <OndraSterver> well
[15:43:58] <OndraSterver> is that older than 1990s?
[15:43:59] <MotionObserver> so byte = 8 bits.. how many characters based on the ascii system can 1 byte store?
[15:44:01] <OndraSterver> newer*
[15:44:08] <damon> OndraSterver: yes
[15:44:11] <OndraSterver> huhm
[15:44:21] <OndraSterver> what company was the ... broken one?
[15:44:32] <damon> huh?
[15:44:42] <RikusW> MotionObserver: 8 bits 0 to 255
[15:44:47] <OndraSterver> MotionObserver, regular official ascii is 128 characters, but there is another space for 128. Then it depends on what character set you use
[15:45:04] <OndraSterver> eg west european, central european, US
[15:45:13] <OndraSterver> damon, which company told that byte != 8bits
[15:45:37] <damon> i only kno this factoid from story times :D
[15:46:35] <damon> OndraSterver: e.g. there are machines with 4 bit ops
[15:46:49] <OndraSterver> that doesn't mean that byte = 4bits
[15:46:57] <damon> so, i think you can call that 4 bit = 1 byte
[15:47:04] <damon> as in one bite :D
[15:48:10] <OndraSterver> 4bits = nibble
[15:48:11] <RikusW> 4 bits = 1 nibble
[15:48:24] <RikusW> heh
[15:48:36] <OndraSterver> hmm it seems that you were right, there were such times when 1 byte != 8bits
[15:48:59] <OndraSterver> no sources quoted though
[15:50:04] <MotionObserver> you lost me ever so slightly there .. 8bits = 1byte can contain 0-255 ascii characters?? -.- that sounds very wrong :D
[15:50:19] <damon> no its right
[15:50:24] <Landon> MotionObserver: can contain 1 and 1/7 ascii characters
[15:50:34] <megal0maniac> It can contain any one of 256 ascii characters
[15:51:00] <megal0maniac> Because 1 byte provides 256 combinations of 1 and 0
[15:51:03] <damon> if you know how to change the font it can contain any character
[15:51:21] <MotionObserver> ok thanks for the clarification :)
[15:51:39] <MotionObserver> in simple land, 1 byte = 1/2 characters
[15:51:50] <MotionObserver> * 1 or 2
[15:51:58] <damon> huh
[15:52:06] <damon> ahh
[15:52:07] <megal0maniac> Generally speaking, 1 byte = 1 ascii char
[15:52:15] <damon> hehe
[15:52:28] <megal0maniac> damon: What do you mean by font?
[15:52:35] <damon> neber mind
[15:52:42] <damon> never*
[15:53:03] <MotionObserver> damon i guess mean font files can contain any kind of symbol right ?
[15:53:04] <RikusW> MotionObserver: you can count from 0 to 255 using 8 bits
[15:53:26] <damon> MotionObserver: what about binary?
[15:53:28] <MotionObserver> are there any sites with basic examples/ exercises? I am a slow learner
[15:53:37] <megal0maniac> A bit is a binary digit
[15:53:50] <megal0maniac> A single bit can either be 0 or 1
[15:53:50] <damon> know what 11111111 is in decimal?
[15:53:51] <RikusW> nickserv is back :)
[15:53:55] <megal0maniac> On or off
[15:54:12] * megal0maniac waves at nickserv
[15:54:15] <RikusW> damon 0xFF or 255
[15:54:30] <damon> shush
[15:54:41] <MotionObserver> 11111111 = onononononononon? haha :P
[15:55:11] <OndraSterver> don't say 1 = on
[15:55:20] <OndraSterver> it doesn't always apply :P
[15:55:40] <RikusW> MotionObserver: you count as follows 0 1 10 11 100 101 110 111
[15:56:22] <megal0maniac> OndraSterver: Well, 1 is "more on than off" usually :)
[15:56:37] <megal0maniac> I'm keeping things simple
[15:56:46] <OndraSterver> for control signals active = low quite often
[15:56:51] <OndraSterver> k :)
[15:56:57] <MotionObserver> hehe :P gotcha
[15:58:11] <MotionObserver> 0 1 10 11 100 101 110 111 1000 1001 1011 1111? just guessing there, is that it ? :P what the max amount of characters for each binary number?
[15:58:27] <OndraSterver> 1000 1001 1010 1011 1100 1101 1110 1111
[15:58:34] <smeding> sounds like you're missing the basic point of binary to me
[15:58:42] <megal0maniac> OndraSterver: Like CS in SPI, or AVR reset. But is fair to say "1 = power on, 0 = power off"?
[15:59:03] <MotionObserver> could be smeding
[15:59:04] <OndraSterver> yes, RESETs and CSs are one example of active low
[15:59:07] <smeding> MotionObserver: binary is a way to write numbers. in base 10, which is what you use all the time, you count from 0, 1, 2, 3 then 9, 10
[15:59:11] <OndraSterver> two examples*
[15:59:29] <smeding> MotionObserver: you have the digits 0-9 and when you run out you start over, and add one to the digit to the left of that
[15:59:38] <smeding> MotionObserver: do you get that? it's just regular counting
[15:59:41] <Landon> 1 and 0, high and low, to and fro
[15:59:45] <Landon> that's what makes the world go round
[15:59:52] <MotionObserver> yup i got that , ill look up a table just to check
[15:59:57] <smeding> a table?
[15:59:58] * Landon will be here all week, butchering sword in the stone
[16:00:14] <smeding> MotionObserver: i'm talking about like, basic counting in base 10, that you use every day
[16:01:03] <MotionObserver> binary counting table just to solidify the standard
[16:01:05] <smeding> MotionObserver: you count from 0 to 9 and then you run out of digits, so you change the 9 back into a 0 and make the (implicit) 0 to the left into a 1 so you get 10, then it begins again: 11, 12, etc. until you get to 19 and you change it back to a 0 and add 1 to the next digit
[16:01:25] <smeding> MotionObserver: i'm not talking about binary at this point. i'm trying to show that binary is just a number system
[16:01:35] <smeding> a way to write numbers that works in pretty much the same way as regular numbers
[16:02:10] <smeding> it's easiest if you understand how regular, decimal counting works first, because then it's easy to see how binary is pretty much the same
[16:02:14] <smeding> and hex, and octal, etc.
[16:02:16] <MotionObserver> ooh k , so we have a general logic idea, then a practical binary for programming etc. ?
[16:02:44] <MotionObserver> wow i didn't realize how really at square one i am with these concepts
[16:02:48] <megal0maniac> Binary: 0-1, Decimal(normal counting): 0-9, Hexidecimal: 0-16
[16:02:52] <smeding> the basic idea is that you have a number of symbols to count with, and you use one or more symbosl to represent numbers
[16:03:09] <smeding> megal0maniac: come on i'm trying to work through a program here, don't bring those other things into it yet ;-)
[16:03:17] <smeding> this stuff is hard when you've never thought about it
[16:03:32] <smeding> MotionObserver: so do you understand what i'm trying to say about the idea for just regular counting in decimal?
[16:03:34] <MotionObserver> a muscle I've never used, that's sure
[16:03:37] <megal0maniac> smeding: I sorry. :)
[16:03:56] <MotionObserver> sure, comparable with arabic numbers and roman numerals? just a basic system?
[16:04:19] <smeding> i'm talking about arabic numerals
[16:04:31] <smeding> roman numerals are not the same. roman numerals work differently
[16:04:40] <MotionObserver> fuuu ok
[16:04:58] <megal0maniac> Luckily, all the number systems we're talking about here work in more or less the same way
[16:05:12] <smeding> the same way as arabic numerals, yes
[16:05:15] <megal0maniac> Roman numerals are just... odd.
[16:05:27] <smeding> MotionObserver: the thing that matters is the specific system used for arabic numerals
[16:05:48] <smeding> MotionObserver: you have 10 symbols, 0 through 9. and if you run out of symbols, you have a specific process for being able to count further
[16:06:16] <smeding> namely: you add a symbol to the left of your original symbol, and start over again with the other one
[16:06:32] <smeding> so once you hit 99, you start over to 00 and add a 1 to the left to get 100
[16:06:40] <RikusW> megal0maniac: hex is 0 to 15... ;)
[16:06:42] <MotionObserver> yep I'm with you on that
[16:06:55] <smeding> once you hit 199, you start over and add 1 to the leftmost one to get 200
[16:06:57] <megal0maniac> Oh. Whoops :P
[16:07:20] <smeding> megal0maniac: now, the idea is: what if you don't have 10 symbols but some other number
[16:07:24] <smeding> MotionObserver: ^
[16:07:34] <RikusW> MotionObserver: in hex you count 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11.....
[16:07:56] <RikusW> MotionObserver: each hex digit maps to for bits making conversion super easy
[16:08:01] <RikusW> *fou
[16:08:08] <RikusW> *four
[16:08:10] <smeding> MotionObserver: if you have hexadecimal, you use 16 symbols: 0 through 9 then A through F, and when you hit F and you start over at 0 and add a 1 to get 10
[16:08:26] <MotionObserver> ok !
[16:08:28] <smeding> MotionObserver: so 10 in hexadecimal is 16 in decimal (because F is 15)
[16:08:39] * Tom_itx uses Octal
[16:08:54] <RikusW> Tom_itx: what for ?
[16:09:00] <Tom_itx> kidding
[16:09:02] * megal0maniac doesn't get why one would need to
[16:09:09] <smeding> MotionObserver: you can do the same for binary, where you have two symbols, 0 and 1. you start at 0, then 1, then you run out so you go to 10, then 11, then you run out so you go to 100
[16:09:11] <megal0maniac> That makes more sense :P
[16:09:23] <RikusW> octal maps nicely to x86 instruction codes
[16:09:29] <MotionObserver> ok perfect smelling thanks it just clicked :
[16:09:30] <MotionObserver> :)
[16:09:33] <smeding> MotionObserver: so these are all ways to think about the same number
[16:09:34] <RikusW> some of it and the mod/rm byte
[16:09:35] <Tom_itx> it had a time and place in history
[16:10:06] <RikusW> MotionObserver: octal count from 0 to 7 and maps to 3 bits
[16:10:53] <RikusW> anyone ever used "quad" ? 0-3 :-P ?
[16:11:03] <Tom_itx> for LCD's :D
[16:11:16] <megal0maniac> Tom_itx: I'm sure it did :) I just don't like it because visibly it is the same as decimal. Unless you spot a 8 or 9 somewhere
[16:11:18] <Tom_itx> it's called 'nibble' mode
[16:11:21] <RikusW> LCDs is 4 bits hex ;)
[16:11:28] <megal0maniac> And yeah, I use nibble mode too
[16:11:40] <MotionObserver> smeding: I'm just going over it in my head trying to get used to it
[16:11:57] <RikusW> "quad" would be 32103212330123 etc....
[16:12:15] <RikusW> 2 bits per quad digit
[16:12:18] <megal0maniac> MotionObserver: Write it down. Decimal numbers, and their binary and hex counterparts
[16:12:34] <MotionObserver> ok ill do that now
[16:12:39] <MotionObserver> how far do i need to go ? ^ ^
[16:13:09] <megal0maniac> I was going to say write down random numbers, but you'll see the pattern in a sequence
[16:13:32] * megal0maniac shrugs
[16:13:37] <megal0maniac> 30?
[16:13:44] <RikusW> 0-15 should be enough
[16:13:50] <megal0maniac> Until you feel like it makes sense, I suppose :)
[16:14:11] <RikusW> or 31...
[16:14:24] <smeding> i'd say do 0-32 or so
[16:14:46] <smeding> get the procedure down, see how hex and binary map to one another
[16:14:46] <megal0maniac> SPOT QUIZ! MotionObserver: Why did RikusW suggest 31 instead of 30?
[16:15:10] <RikusW> 0x1F ;)
[16:15:17] <megal0maniac> Is this too higher grade? :P
[16:15:21] <MotionObserver> teh fuck? :D
[16:15:35] <smeding> MotionObserver: another way to think about it is that each digit stands for a number that you multiply with
[16:16:09] <smeding> MotionObserver: in decimal (arabic numerals, or base 10) you get 1021 = 1*1000 + 0*100 + 2 * 10 + 1 * 1
[16:16:11] <megal0maniac> I have my own question before I leave. I know that 0x precedes a hexidecimal number. But why?
[16:16:16] <smeding> MotionObserver: these are all powers of 10
[16:16:55] <RikusW> megal0maniac: its the C way of writing it
[16:17:01] <RikusW> pascal uses $FF
[16:17:12] <RikusW> and some asm FFh
[16:17:23] <smeding> MotionObserver: you can do the same for binary: each position stands for a power of 2, so 1101 = 1*8 + 1*4 + 0*2 + 1*1
[16:17:40] <smeding> MotionObserver: that's another way to convert between numbers. make sense?
[16:17:59] <megal0maniac> Ah, okay. Thanks :)
[16:18:30] <MotionObserver> smeding: yeh thanks this is gold, I'm just quickly copying it down so i can read and reread it at work tomorrow :P
[16:19:07] <megal0maniac> RikusW: My parcel arrived in Bloem today. Hoping for a Saturday morning arrival
[16:19:19] <smeding> Bloem?
[16:19:22] <smeding> sounds Dutch
[16:19:26] <smeding> maybe Swedish
[16:19:28] <megal0maniac> Afrikaans
[16:19:31] <smeding> ah
[16:19:38] <smeding> well that's pretty much Dutch, too :p
[16:19:51] <megal0maniac> Short for Bloemfontein :)
[16:20:06] <RikusW> megal0maniac: nice
[16:20:24] <smeding> so what's in this parcel, drugs?
[16:21:02] <RikusW> smeding: this is http://sites.google.com/site/megau2s/home
[16:21:08] <megal0maniac> MotionObserver: You can learn a lot from this channel. Just NEVER try to use parallel communication over a serial interface XD
[16:21:15] * megal0maniac pokes smeding
[16:21:23] <MotionObserver> haha yeh good one :D :/
[16:21:45] <smeding> megal0maniac: what?
[16:21:50] <megal0maniac> Oh wait
[16:21:54] <megal0maniac> I think it was specing
[16:22:00] * megal0maniac always gets confused
[16:22:03] <MotionObserver> RANDOM QUESTION : can natural light be defined as a laser?
[16:22:09] <smeding> what does that mean
[16:22:19] <smeding> that question makes no sense to me
[16:23:04] <megal0maniac> Yes it was
[16:23:33] <MotionObserver> by natural i meant to say visible light
[16:23:50] <Landon> lasers are visible
[16:23:51] <smeding> still not sure what you're trying to ask
[16:23:55] <smeding> Landon: they can be, anyway
[16:24:05] <Landon> lasers in the visible light spectrum are visible* :p
[16:24:09] <smeding> you have IR and UV lasers :p
[16:24:11] <Landon> (and with sufficient power, etc)
[16:24:21] <RikusW> not all lasers are visible, eg IR UV
[16:24:35] <smeding> MotionObserver: you can have visible light lasers, if that's what you mean. it's not a matter of definitions
[16:25:22] <RikusW> IR laser can be used to annoy people.... they won't know what burnt them :-D
[16:25:30] <Landon> :\
[16:25:41] <smeding> or blinded them
[16:25:42] <smeding> :p
[16:25:46] <Landon> not sure I'd want to play around with an ir laser that can burn _skin_
[16:25:54] <MotionObserver> ah theres a lot of crossover, laser can sometimes mean isolated frequency emitted eg. IR, UV etc. and i was thinking that as visible light is an isolated range that it could also be defined as such
[16:26:06] <smeding> what?
[16:26:09] <Landon> huh?
[16:26:15] <smeding> i'm pretty sure lasers are just one frequency
[16:26:17] <smeding> because of their mechanism
[16:26:22] <Posterdati> :(
[16:26:29] <smeding> IR is not a frequency, UV is not a frequency, visible light is not a frequency
[16:26:35] <smeding> they are *ranges*
[16:26:42] <MotionObserver> but theres too much crossover in the use of the term laser for my reasoning or initial questions to have a meaningful answer
[16:27:18] <smeding> there isn't
[16:27:26] <Landon> crossover? laser is a pretty specific term
[16:27:27] <smeding> a laser is a device that uses a specific mechanism to produce light
[16:27:34] <smeding> namely: stimulated emission
[16:28:02] <MotionObserver> some 'lasers' can emit multiple ranges though, and are only called laser based on their method of producing light ; stimulated emission
[16:28:32] <MotionObserver> so there are lasers and lazors
[16:28:35] <MotionObserver> :P
[16:28:49] <Landon> where are you getting this information from?
[16:28:56] <RikusW> laser emit only one frequency all in phase too
[16:29:03] <MotionObserver> wikipedia 3rd paragraph
[16:29:07] <MotionObserver> http://en.wikipedia.org/wiki/Laser
[16:29:28] <smeding> the different frequencies for a single-frequency laser are close enough together for it not to matter unless you are doing real optics work
[16:29:44] <smeding> i.e. as an engineer, it's purely semantic nonsense
[16:29:55] <smeding> well, except if you're doing very iffy things
[16:30:19] <Landon> ", there are even lasers that emit a broad spectrum of light, or emit different wavelengths of light simultaneously. " that's kind of interesting
[16:30:30] <smeding> well, i imagine that works
[16:30:40] <smeding> just pump different atoms at the same time, right?
[16:30:56] <OndraSterver> requires more power
[16:30:59] <Landon> but practically, unless you're doing important laser stuff, 99% of the talk will be about a single wavelength laser
[16:31:05] <megal0maniac> Purpose-built stuff. All depends on the application.
[16:31:16] <megal0maniac> I'm off. Goodnight all
[16:31:22] <OndraSterver> gn
[16:31:26] <smeding> MotionObserver: and it's not about your questions having a meaningful answer, it's about your questions making no sense
[16:32:04] <smeding> 'can natural light be defined as a laser' does not make sense on several levels, same for 'can visible light be defined as a laser'
[16:32:56] <smeding> i'm not sure if you meant to ask 'are there lasers that produce visible light' because the answer to that is yes
[16:33:06] <smeding> plenty of them do
[16:33:29] <MotionObserver> i feel like that was a legitimate question, though misinformed now i suppose
[16:33:47] <smeding> it's not a legitimate question because it doesn't *mean* anything. try rewording it
[16:34:59] <MotionObserver> i was wondering if an isolated, defined range such as visible light = laser . Or if a laser it was more complicated than that
[16:35:06] <MotionObserver> does that work ? ^ ^
[16:36:00] <megal0maniac> So what you're really after, is "what classifies something as a laser?:
[16:36:05] <megal0maniac> "
[16:36:05] <RikusW> how about masers....
[16:36:14] <RikusW> microwave...
[16:36:46] <megal0maniac> Coolest thing we ever had to buy. A "magnatron"
[16:36:47] <MotionObserver> or perhaps, is a laser an intentional stimulated emission, or can definable ranges within the EM spectrum be defined also as lasers
[16:37:18] <megal0maniac> After our microwave caught on fire
[16:37:28] <megal0maniac> Only a little bit though
[16:38:08] <RikusW> MotionObserver: laser is light rays in phase in the same direction
[16:39:43] <smeding> megal0maniac: that's just the bit of a microwave that generates the microwaves
[16:39:45] <molavy> i connected all VDD and VSS on at91sam7X256
[16:39:50] <smeding> hell, microwaves are called magnetrons in dutch
[16:40:09] <molavy> and i want program it using samba
[16:40:13] <megal0maniac> I know, but it's still the coolest named thing we've ever had to buy :)
[16:40:14] <molavy> what is next
[16:41:07] <MotionObserver> I'm just going to write out some binary and hex,
[16:41:29] <MotionObserver> thanks all for helping me out of my skewed perspective on binary, hex and lasers :)
[16:42:59] <smeding> feel free to drop any other questions you need a perspective readjustment on
[16:44:24] <MotionObserver> cheers!
[16:44:30] <megal0maniac> Cheers
[17:52:58] <Posterdati> how can I handle math error in float calculations?
[17:53:12] <Posterdati> I think that my code hangs due to float errors
[18:07:00] <w|zzy> dont rely on floats?
[18:07:33] <karlp> asdf
[18:07:42] <karlp> asdfd
[18:07:58] <karlp> sorry about that
[18:17:58] <Posterdati> ?
[19:09:48] <jadew> any idea why the standard baud rates are.. standard?
[19:11:29] <jadew> usually you don't run your uC from one of those weird clocks that are needed for standard baud rates
[19:11:35] <LoRez> historical reasons
[19:11:53] <LoRez> the lower ones you did.
[19:13:31] <jadew> I can't believe the speeds I'm getting with the proper baud rates for the clocks I'm using
[19:14:22] <jadew> as opposed to the but hurt I used to have when I was trying to use the standard ones with USB to UART adapters
[19:21:21] <Tom_itx> it's how Mr. Baud wanted it
[19:42:26] <OndraSterver> originally there were such speeds
[19:42:39] <OndraSterver> and then they just multiplied
[19:48:07] <jadew> I can't believe that my USART is so fast I don't even have to check if I can send stuff, while in a tight loop
[19:48:13] <jadew> makes me feel happy for some reason
[19:49:14] <Erlkoenig> perhaps your controller core is just slow :P
[19:49:57] <jadew> well, it's not very fast, only 12mhz