#avr | Logs for 2015-05-22

Back
[03:04:02] <dgtlmoon> would a crystal be more accurate than a resonator? and what's the best for very low power consumption but highest accuracy? (device is used outside.. so temperature is a consideration too)
[03:07:09] <Valen> xtals are better than a resonator
[03:07:17] <Valen> however first you must work out what good enough is
[03:07:42] <Valen> otherwise you wind up with a GPS governed ovenised rubidium standard
[03:14:02] <dgtlmoon> Valen, haha yeah :)
[03:14:38] <dgtlmoon> Valen, got some weird serial issues going on.. checked it with the scope and the device that's sending is 100%, but the avr receiving sometimes gets different values
[03:15:06] <dgtlmoon> Valen, the AVR is atmega328p with SMD resonator, not sure if its accurate enough really
[03:15:25] <dgtlmoon> i might breadboard up the same setup but with external xtal
[03:15:33] <dgtlmoon> see if i can replicate the problem or not
[04:07:54] <osteri> dgtlmoon: if you have to think if resonator is accurate enough, then probably not
[04:08:21] <dgtlmoon> osteri, i just looked at the board again, im wrong, it has a SMD crystal
[04:08:33] <dgtlmoon> so hmmm dont know why my UART timings are weird
[04:08:44] <dgtlmoon> i will get some screenshots on the scope
[04:09:57] <osteri> btw, datasheet should tell you error % with different baud speeds (if you didn't knew)
[04:10:08] <osteri> know*
[04:12:23] <dgtlmoon> 38400@8mhz is 0.2% i think
[04:12:46] <dgtlmoon> but every byte seems out by 1 bit or something, ie 0x0E arrives as 0x0F
[04:13:36] <dgtlmoon> maybe the device sending UART to the AVR is out
[04:15:10] <osteri> logic analyzer would tell
[04:15:54] <dgtlmoon> only DS1052E here
[04:16:13] <dgtlmoon> i can measure pretty well with it tho
[04:18:27] <osteri> do you have parity on? this could explain '1'-bit error
[04:31:22] <Valen> send a few different bit patterns, see if you have a stuck bit in your rx or something
[04:31:32] <Valen> just to be a weird pain in the ass
[04:32:37] <Valen> osteri: what baudrate are you using?
[04:50:21] <osteri> i'm not using anything
[05:04:06] <dgtlmoon> osteri, hmm http://picpaste.com/pics/wave-AUdb0Xpn.1432287712.jpg
[05:05:12] <dgtlmoon> osteri, that's not a really helpful waveform i know :D it should be 6 bytes there AA 0E 00 00 xx 00 (xx is sequence)
[05:05:42] <dgtlmoon> damn, didnt think the rigol saved such low resolution images
[05:07:56] <dgtlmoon> the device that's sending that, its datasheet says "• Full-Duplex 8 bit data transmission and data format: 8 bits, No Parity, 1 Stop bit."
[05:08:18] <dgtlmoon> Valen, yeah.. tried that
[05:08:36] <dgtlmoon> Valen, the AVR seems to be not interpreting the RX correctly for some reason
[05:08:37] <Valen> osteri: my bad
[05:09:21] <Valen> dgtlmoon: what baudrate?
[05:09:24] <dgtlmoon> Valen, 38400
[05:09:36] <dgtlmoon> have tried @8mhz and @16mhz. similar wierdness
[05:10:04] <Valen> hardware or software uart?
[05:11:32] <dgtlmoon> hardware
[05:12:09] <Valen> what's the sending device using?
[05:12:14] <dgtlmoon> Valen, hardware
[05:12:18] <Valen> (resonator or xtal)
[05:12:23] <dgtlmoon> ah, xtal as far as i can see
[05:12:34] <dgtlmoon> metal tin with a brass/gold band around it
[05:12:34] <Valen> so xtals on both sides?
[05:12:36] <dgtlmoon> yes
[05:13:14] <dgtlmoon> if i plug the device into a USB/UART receiver it works fine - same waveform too
[05:13:30] <Valen> use the same usb thing to talk to your avr perhaps?
[05:13:45] <dgtlmoon> im using it to echo the output into my PC
[05:13:53] <dgtlmoon> UART/USB<->AVR<->TheDevice
[05:14:18] <Valen> go usb >< avr
[05:14:39] <dgtlmoon> ah, on the hardware port, yeah got it
[05:14:46] <dgtlmoon> the UART/USB is on the software IO
[05:14:51] <Valen> just loopback through the avr, the more things you can remove from the situation the more things you can rule out
[05:14:55] <Valen> well that's interesting
[05:15:20] <dgtlmoon> yeah
[05:15:27] <dgtlmoon> but i dont see.. hmmm
[05:15:41] <dgtlmoon> i get 0 errors between UART/USB<->AVR
[05:16:05] <dgtlmoon> and the device works USB/UART<->TheDevice
[05:16:18] <dgtlmoon> but something between the AVR and TheDevice is not timing right
[05:16:34] <Valen> is that usb uart > software uart on the avr?
[05:17:12] <dgtlmoon> yes, i have to admit it's a arduino project *cough*
[05:17:24] <Valen> i meant in your test
[05:18:06] <dgtlmoon> yes, AVR(hardware UART)<->TheDevice, im storing the received bytes in an array then printing out into the software IO/USB debug
[05:18:33] <Valen> I meant the usb device to the software uart in your avr
[05:18:38] <Valen> have you loopback tested that
[05:19:03] <dgtlmoon> that doesnt work at all
[05:19:07] <dgtlmoon> i dont get any response
[05:19:12] <dgtlmoon> i will try again
[05:19:33] <dgtlmoon> if it doesnt work in hardware UART, i wouldnt trust the software IO
[05:19:43] <dgtlmoon> hardware uart the only way to go really
[05:20:14] <dgtlmoon> why would it work in software uart and not hardware?
[05:20:47] <Valen> when the data is going into your AVR and coming back out again you have no way of knowing where the corruption is
[05:21:01] <Valen> you need to test both sides of the AVR to try and ID the issue
[05:21:16] <dgtlmoon> ah i see your point
[05:21:28] <dgtlmoon> but ive never seen any errors on the software side with a couple of months of debugging
[05:21:41] <dgtlmoon> and i store the bytes in an array then print them out after they have all been received
[05:21:57] <dgtlmoon> if i plug another serial device i have (GPRS) into the hardware port it works perfect
[05:22:30] <dgtlmoon> http://picpaste.com/pics/wave-AUdb0Xpn.1432287712.jpg reconstructing the bytes from that waveform would tell me if it's sending correctly
[05:22:53] <Valen> that looks like 2 bytes to me ;->
[05:22:58] <Valen> but I am quite drunk lol
[05:23:00] <Valen> so don't trust me
[05:24:34] <dgtlmoon> :D
[05:24:37] <dgtlmoon> yeah.. weird
[05:24:48] <dgtlmoon> Valen, what does the first 2 bytes say? :D
[05:25:57] <Valen> stuffed if I know lol
[05:26:32] <Valen> actually its probably 3 bytes, it looks like there are 3 hold times in there
[05:28:53] <dgtlmoon> yeah
[05:28:57] <hypermagic> hi
[05:29:21] <dgtlmoon> weird, it's sending 6 bytes for sure - yet after that waveform is nothing on the oscilloscope (just the line noise)
[05:30:20] <Valen> I'm just going by eye, do the maths and work out what a bit time is
[05:32:23] <hypermagic> what are you creating ?
[05:33:33] <hypermagic> <dgtlmoon> would a crystal be more accurate than a resonator? and what's the best for very low power consumption but highest accuracy? (device is used outside.. so temperature is a consideration too) - yes a crystal is accurate onto the 20ppm level
[05:34:28] <dgtlmoon> hypermagic, just trying to get an external serial camera to talk to the AVR reliably
[05:34:35] <dgtlmoon> "uCamII"
[05:35:37] <dgtlmoon> so where the hell is the rest of the bytes in the waveform :o
[05:38:16] <hypermagic> serial comm must be synced, it does not tolerate different rates for send recv
[05:38:54] <hypermagic> usb will work crappy at most with resonator for example
[05:41:13] <dgtlmoon> hypermagic, how do you sync?
[05:41:26] <dgtlmoon> hypermagic, maybe run a wire from the device clock to the AVR?
[05:41:36] <dgtlmoon> ... ahh just noticed something really weird on the waveform, check this out
[05:42:39] <hypermagic> dgtlmoon, if the freq is close enough to not miss a bit then the stopbit syncs
[05:42:52] <hypermagic> the idle time between 2 bytes
[05:43:04] <dgtlmoon> 2 secs, uploading, this is weird
[05:44:31] <hypermagic> so the startbit and stopbit has fixed amount of time between them
[05:44:44] <dgtlmoon> ah ok, yeah then it will figure out how to line it up
[05:44:51] <hypermagic> no
[05:44:55] <hypermagic> it is just possible ;)
[05:45:12] <hypermagic> cheap crap will not "figure out" things
[05:45:32] <hypermagic> so you have 115200 baud for example
[05:45:58] <dgtlmoon> hypermagic, http://tinypic.com/view.php?pic=160r14l&s=8#.VV8Ds9_vZmg
[05:46:54] <hypermagic> sgwhat new information you expect me to notice on that scope ?
[05:46:58] <hypermagic> dgtlmoon,
[05:47:04] <dgtlmoon> ahh hang on
[05:47:12] <dgtlmoon> weird signal after the IO signal
[05:47:20] <dgtlmoon> after the RS232
[05:48:12] <hypermagic> you mean the noise?
[05:48:15] <dgtlmoon> yeah
[05:48:43] <dgtlmoon> that noise looks like a RS232 packet that is not properly formed
[05:48:56] <hypermagic> this is why they invented differentical signaling, and balanced / twisted pairs
[05:49:28] <hypermagic> that noise level will overgrow even a 5V signal level for larger distances
[05:49:33] <dgtlmoon> 10CM?
[05:49:53] <dgtlmoon> no i mean you see the big 5V pulse, and then there is a small 0.5v pulse after that
[05:50:01] <dgtlmoon> 280mV
[05:50:19] <hypermagic> that is an LVDS level signal
[05:50:44] * dgtlmoon scratches head
[05:50:46] <dgtlmoon> huh? :D
[05:50:47] <hypermagic> though that is differential, so you can not simply inject noise in that
[05:51:16] <dgtlmoon> so it's data or noise?
[05:51:17] <hypermagic> dgtlmoon, serial port works with ttl logic levels.
[05:51:26] <dgtlmoon> yes, got it
[05:51:41] <hypermagic> 0.5V will not be noticed
[05:52:34] <hypermagic> also you might have that on your power supply voltage
[05:52:57] <hypermagic> if you don't have large/good enough smoothing capacitor and lowpass filter
[05:56:49] <dgtlmoon> but it shouldnt affect the signal in this case
[05:57:05] <dgtlmoon> ok, so that's the signal to the AVR, i'll replace the AVR with the USB/UART adaptor and see
[05:57:14] <hypermagic> if you pull up the signal line to your vcc then it will inject noise fro mvcc no?
[06:02:25] <dgtlmoon> hypermagic, yeah maybe.. i guess so
[06:02:27] <dgtlmoon> (a bit lost)
[06:34:41] <Lambda-Aurigae> dgtlmoon, start out at lower speeds,,,9600 or so and test it....I like sending repeating U characters..gives a nice 01010101 constant so I can see if bits get screwed up.
[06:34:54] <dgtlmoon> same at 9600 :(
[06:36:03] <Lambda-Aurigae> have you tried shifting your usart speed by just a little?
[06:36:25] <dgtlmoon> how do you mean?
[06:36:31] <dgtlmoon> like by 100 BPS etc?
[06:36:37] <Lambda-Aurigae> your UBRR.
[06:36:58] <Lambda-Aurigae> when you set your speed, you set UBRR according to the clock speed to get a specific baud rate..
[06:37:24] <Lambda-Aurigae> at 8MHz for 9600, the UBRR would be set to 0x0033
[06:37:35] <Lambda-Aurigae> try shifting it up to 0x0032 or 0x0034
[06:38:16] <Lambda-Aurigae> 8MHz is not a real good speed for rs232 comms though..0.2% or better error..
[06:38:29] <Lambda-Aurigae> unless you go down to 1200 or up to 250000
[06:39:35] <Lambda-Aurigae> http://wormfood.net/avrbaudcalc.php
[06:40:16] <dgtlmoon> i can swap to 16mhz no probs
[06:41:26] <Lambda-Aurigae> 16 will still give you a 0.2% error but gives you more play around room for adjustment.
[06:41:54] <Lambda-Aurigae> 0.2% should be acceptable though.
[06:42:16] <dgtlmoon> but its always an error tho
[06:42:37] <Lambda-Aurigae> so either an error in code or a hardware issue.
[06:43:03] <Lambda-Aurigae> possibly just adjusting the UBRR by 1 could do it...
[06:43:22] <dgtlmoon> yeah 1 is quite enough perhaps
[06:43:23] <dgtlmoon> hmm
[06:43:35] <Lambda-Aurigae> if your chip supports X2U, turn that on and use the X2U settings...then adjusting UBRR by 1 only shifts half as much.
[06:44:30] <Lambda-Aurigae> I've done a simple autobaud system on AVR in the past...
[06:44:49] <Lambda-Aurigae> have a program on the PC echoing back to the AVR whatever comes through...
[06:45:04] <dgtlmoon> yeah i do
[06:45:15] <dgtlmoon> and its always out/off a little bit
[06:45:18] <Lambda-Aurigae> and have the AVR sending U constantly...every 8 characters it ups the UBRR by 1.
[06:45:43] <Lambda-Aurigae> when AVR gets 8 U characters back in a row it knows it has the speed right and locks in.
[06:46:34] <Lambda-Aurigae> not super efficient...could focus more directly around known values of UBRR for various speeds but the code is fairly simple.
[06:47:53] <Lambda-Aurigae> if you had a nice 14.7456 crystal you would be dead on for all normal rs232 speeds.
[06:48:10] <twnqx> i use a 16mhz and am dead on for normal 2mbit/s
[06:48:23] <twnqx> :X
[06:48:29] <Lambda-Aurigae> twnqx, hehe...yeah..I've done that between chips before.
[06:49:32] <twnqx> my distance is ca. 6mm
[06:50:11] <Lambda-Aurigae> I've gone about 6 inches between breadboards with it at mbit speeds.
[06:50:22] <twnqx> only problem is that i need hardware flow control as the ft230x apparently can't buffer from serial while transmittign on usb.
[06:50:37] <Lambda-Aurigae> using 20MHz crystals you can get a bit more speed even.
[06:51:06] <Lambda-Aurigae> I need to see what kinds of speeds I can get on my pic32 chips one of these days.
[07:01:56] <hypermagic> hahah, these and perpetual development skills on linux http://en.wikipedia.org/wiki/Parkinson%27s_law http://en.wikipedia.org/wiki/Wirth%27s_law
[07:03:16] <hypermagic> i think you can get serial crystal from motherboards
[07:04:02] <hypermagic> 14.318-MHz Crystal ?
[07:04:53] <hypermagic> 1.8432 MHz "crystal frequency" may be obtained from a 18.432 MHz
[07:14:15] <osteri> <util/setbaud.h> is quite handy if you're not aware of it
[07:18:45] <dgtlmoon> Lambda-Aurigae, http://forum.arduino.cc/index.php?topic=25062.0 scroll down to the last answer
[07:18:47] <dgtlmoon> Lambda-Aurigae, :(
[07:19:46] <hypermagic> dgtlmoon, i think you can rip out one of the above crystals from an old pc board
[07:20:25] <dgtlmoon> hypermagic, yeah, tho it's a smd crystal by the look of it
[07:21:01] <dgtlmoon> hypermagic, https://cdn.sparkfun.com//assets/parts/2/0/7/3/08824-03-L.jpg
[07:21:31] <dgtlmoon> https://cdn.sparkfun.com//assets/parts/6/5/3/9/11113-01.jpg rather
[07:21:54] <dgtlmoon> aaah "ATmega328 running at 16MHz with external resonator (0.5% tolerance)"
[07:22:03] <dgtlmoon> resonator != crystal?
[07:22:25] <dunz0r> dgtlmoon: Yep.
[07:22:34] <dunz0r> A resonator is a lot cheaper, but not as exact
[07:22:50] <dunz0r> And generally don't require external capacitors as a crystal does
[07:22:55] <dgtlmoon> yeah, cheaper to fab
[07:23:08] <dgtlmoon> dunz0r, so next step might be to whip up something on my breadboard
[07:23:23] <dunz0r> https://www.sparkfun.com/products/9420 <- ceramic resonator
[07:24:25] <dgtlmoon> 3 pins? they can replace the existing resonator?
[07:24:57] <dunz0r> dgtlmoon: One ground and two for XTAL1 and XTAL2
[07:25:21] <dgtlmoon> aah got it, yes, nice
[07:25:33] <dgtlmoon> thanks
[07:25:47] <dunz0r> Same functionality as a crystal, but not as accurate, but a lot cheaper
[07:25:52] <hypermagic> dyno, a resonator is not a crystal.
[07:26:06] <hypermagic> dgtlmoon
[07:26:29] <dunz0r> hypermagic: Performs the same job but not as accurate though
[07:26:57] <dgtlmoon> https://www.sparkfun.com/products/536 <-- so this type is much better right?
[07:27:54] <dgtlmoon> https://www.sparkfun.com/products/94 <-- this is the kind of crystal on the device TX'ing to the AVR
[07:28:50] <hypermagic> dunz0r, an rc oscillator performs the same task too
[07:29:33] <dgtlmoon> https://cdn.sparkfun.com//assets/parts/6/5/3/9/11113-01.jpg <-- so that does not have a regular crystal? even tho it looks like a SMD crystal?
[07:29:58] <dgtlmoon> it has two caps and a crystal
[07:31:05] <hypermagic> dgtlmoon, bo it is not good, you need same crystals for send and recv to have exactly the same frequency
[07:31:26] <hypermagic> this is why they created the 18.432MHz crystal
[07:31:43] <dgtlmoon> ahuh, because 18.432 divides into the baudrate cleanly?
[07:31:48] <hypermagic> yes
[07:32:21] <hypermagic> divide by 10 and you get the standaard pc's pit timer rate, that was/is used to divide serial baudrate speeds
[07:33:02] <dgtlmoon> my device connected to the AVR has a "HJEC 6.000M" and a "27.000826" crystal
[07:33:32] <hypermagic> and what the baud rate should be ?
[07:33:47] <dgtlmoon> it will autodetect apartently
[07:33:51] <hypermagic> haha
[07:34:03] <dgtlmoon> :)
[07:34:09] <dgtlmoon> http://www.4dsystems.com.au/productpages/uCAM-II/downloads/uCAM-II_datasheet_R_1_4.pdf
[07:34:14] <hypermagic> well it is possible if it has internal pll that will lock onto your transfer speed
[07:34:33] <dgtlmoon> The uCAM-II has a dedicated hardware UART that
[07:34:33] <dgtlmoon> can communicate with a host via this serial port.
[07:34:33] <dgtlmoon> This is the main interface used by the host to
[07:34:33] <dgtlmoon> communicate with the module to send commands
[07:34:33] <dgtlmoon> and receive back data. The primary features are:
[07:34:34] <dgtlmoon> • Full-Duplex 8 bit data transmission and
[07:34:36] <dgtlmoon> reception through the TX and RX pins.
[07:34:38] <dgtlmoon> • Data format: 8 bits, No Parity, 1 Stop bit.
[07:34:40] <dgtlmoon> • Auto detect specific Baud rates from 9600
[07:34:42] <dgtlmoon> baud up to 921600 baud.
[07:34:44] <dgtlmoon> • Selectable Baud rates up to 3686400 bps.
[07:34:46] <dgtlmoon> crap! sorry for the flood
[07:34:52] <hypermagic> why no parity ? that is lame
[07:35:10] <dgtlmoon> yeah, odd
[07:35:34] <hypermagic> i also noticed that pcs usually dont send parity to keyboard over ps2 .. it would be too reliable
[07:35:42] <dgtlmoon> but it works flawlessly with a cheap UART/USB connector
[07:35:48] <hypermagic> there is oo much sabotage happening
[07:35:52] <dgtlmoon> (which has a 12Mhz crystal)
[07:36:15] <hypermagic> i am putting hamming code in my mcu :/
[07:36:21] <dgtlmoon> :)
[07:36:39] <hypermagic> SECDED at least
[07:36:48] <hypermagic> anything less is plain dumb
[07:36:52] <dgtlmoon> so hmm what todo
[07:37:14] <dgtlmoon> build a new circuit with a proper 16Mhz external? but the pro mini has a 16mhz external xtal and 2 caps
[07:38:13] <hypermagic> well if it is autobaud then the requirements are only that it be able to lock on your signal, but you still should consider doing std baudrate to be most compatible i think
[07:38:23] <hypermagic> btw i dislike this clocked nightmare
[07:39:10] <dgtlmoon> yeah doesnt bode well
[07:39:13] <hypermagic> usb is a clocked crap and sata is a clocked crap and pci-e is a clocked crap too that requires +-50-200 ppm precise clock - insane
[07:39:33] <dgtlmoon> but it works via the crappy adaptor.. weird
[07:39:40] <hypermagic> interface that with your mcu ;)
[07:40:21] <hypermagic> dgtlmoon, well you did not use even an xtal, how you expect your frequency to be stable ?
[07:40:48] <hypermagic> you are off with 1% and it might not work at all
[07:41:03] <dgtlmoon> hypermagic, https://cdn.sparkfun.com//assets/parts/6/5/3/9/11113-01.jpg
[07:41:24] <dgtlmoon> hypermagic, that looks like 16Mhz external xtal with 2 caps
[07:41:39] <dgtlmoon> yes i understand :) but that looks like external xtal to me
[07:41:59] <hypermagic> yes it looks like one
[07:42:05] <hypermagic> but it can be a pll :)
[07:42:07] <dgtlmoon> so..
[07:42:20] <hypermagic> i saw pll chips you can program the frequency
[07:42:44] <dgtlmoon> yeah but what now?
[07:43:46] <dgtlmoon> "Cystal, 16MHz +/"20ppm HC"49/US Low Profile" says the component list
[07:43:57] <dgtlmoon> ABL"16.000MHZ"B2
[07:45:55] <dgtlmoon> http://www.arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdf I don't see the tell-tale caps in that schematic!!!
[07:45:57] <hypermagic> you have all the time playing no ? ;>
[07:46:03] <dgtlmoon> uhh someone pulling my leg
[07:46:56] <hypermagic> you mean the 2 caps from craystal to gnd ?
[07:47:06] <hypermagic> the resonators can have thtat built in
[07:47:09] <dgtlmoon> ah wait, yes they are there
[07:47:20] <hypermagic> they are 27pf - 5pf btw
[07:47:28] <dgtlmoon> resonators are metal tins with 16mhz stamp on it?
[07:48:37] <hypermagic> http://en.wikipedia.org/wiki/Crystal_oscillator
[07:48:44] <hypermagic> does this answer your q ?
[07:54:05] <dgtlmoon> yes.. i know roughly how that one works
[07:54:14] <dgtlmoon> ahuh "Quartz crystal resonator"
[07:54:36] <dgtlmoon> yeah so the arduino has a "Quartz crystal resonator" and my serial device has a real oscillator
[07:55:01] <hypermagic> so, how many transistors you prefer for your personal computing ? http://en.wikipedia.org/wiki/Transistor_count
[07:55:27] <dgtlmoon> heh
[07:55:52] <dgtlmoon> http://en.wikipedia.org/wiki/File:DARPA_SyNAPSE_16_Chip_Board.jpg
[08:13:20] <dgtlmoon> going back to testing with the UART/USB<->device
[08:13:47] <skroon> hi
[08:13:59] <skroon> which programmer do I need in order to program the SAMD21 ?
[08:14:11] <dgtlmoon> hypermagic, ive got some STM32s too :)
[08:14:19] <dgtlmoon> could try it with those
[08:14:30] <hypermagic> http://ssj3gohan.tweakblogs.net/blog/8217/fluffy2-59-watt-high-end-desktop-computer.html i like this but no ecc ram :(
[08:14:54] <hypermagic> dgtlmoon, it does no matter, atmega is fine i use that too
[08:24:02] <dgtlmoon> hypermagic, yeah. hmm...
[08:24:22] <dgtlmoon> teted again, works 100% at 57600 on a uart/usb connector that has a 12mhz resonator
[08:26:39] <dgtlmoon> hypermagic, ah wait.. maybe i'm in 8N1 and it's 8N0 by the datasheet...
[08:30:05] <dgtlmoon> hypermagic, ahhh... ahh.. so i get a much better waveform TX from the device when connected to the UART/USB adaptor than to the avr
[08:31:38] <dgtlmoon> its really clean and tight pulses
[08:31:41] <dgtlmoon> weird
[08:31:50] <dgtlmoon> impedance mismatch(??)
[08:32:23] <dgtlmoon> not enough current?
[08:35:23] <hypermagic> great tech guys http://www.extremetech.com/extreme/124677-how-to-cool-a-pc-with-toilet-water
[08:36:13] <hypermagic> dgtlmoon, try a 4k7 pullup resistor, you use open drain ?
[08:37:49] <dgtlmoon> hypermagic, TX/RX wired directly to RX/TX on the arduino
[08:37:56] <dgtlmoon> hypermagic, yes.. i think you might be right
[08:40:21] <dgtlmoon> so 4k7 from VCC to TX right?
[08:40:28] <dgtlmoon> TX on the device (rx on avr)
[08:47:50] <dgtlmoon> http://pastebin.com/V058aJKW works perfectly, i get the right bytes back aa:0e:0d:1e:00
[08:49:31] <dgtlmoon> http://forum.allaboutcircuits.com/threads/in-uart-tx-rx-who-supplies-the-weak-pull-up-in-the-idle-state.85452/
[09:00:44] <dgtlmoon> hypermagic, broken waveform from TX on device connected to atmega328p http://tinypic.com/view.php?pic=160r14l&s=8#.VV8Ds9_vZmg CORRECT waveform on TX pin of device when connected to USB/UART http://tinypic.com/view.php?pic=5lcmcl&s=8#.VV8xE9_vZmg <-- yeah, big difference
[09:08:58] <hypermagic> dyyou bitbang it ? your delay is bad then
[09:09:15] <hypermagic> you send at too high freq
[09:12:03] <dgtlmoon> hypermagic, no - this is _receiving_
[09:12:20] <dgtlmoon> the waveform is changing when receiving, depending on if it's AVR or USB/UART connector
[09:13:13] <dgtlmoon> i have no control over the device that's sending
[09:21:09] <hypermagic> i have no idea what are you doing, you should know that
[09:21:48] <dgtlmoon> :D
[09:21:51] <dgtlmoon> i will make a pretty pic
[09:22:21] <hypermagic> are you building a PIC for a computer you make ?
[09:22:34] <hypermagic> 8086 ?
[09:36:43] <dgtlmoon> :D
[09:36:47] <dgtlmoon> blah, i think its time for beer
[09:37:13] <dgtlmoon> i just triggered/saved on connecting to UART/USB and to Arduino and it's both exactly the same, except Arduino is not interpreting the results
[09:37:17] <dgtlmoon> so i was right initially
[09:37:35] <dgtlmoon> time to build a proper AVR with a real xtal i guess
[09:48:41] <skroon> anyone developing for atmel ARM on osx?
[09:55:11] <hypermagic> dgtlmoon, i recommend space wire instead of rs232
[09:56:02] <hypermagic> ieee 1394a std, it is a self clocking data transmission protocol
[09:57:08] <dgtlmoon> nah, its not that
[09:57:30] <dgtlmoon> its not the connection - the bits are arriving to the RX port of the arduino exactly the same as the UART/USB
[09:59:23] <dgtlmoon> aaah time to get drunk
[10:09:15] <pepijndevos> How do I put literal bytes and label addresses in ROM in gnu avr assembly?
[10:41:58] <pepijndevos> The documentation is so confusing... mainly because most things refer to Atmel assembly and not GCC.
[12:03:02] <pepijndevos> How do I even debug... I'm writing assembly, and it's not working. That is really as much as I know. Well, I know where it stops working, but not why and how.
[12:03:42] <pepijndevos> I'm trying to put a label address in a register and jump to it.
[12:18:10] <pepijndevos> Ok so I learned that call/ret uses the stack and that I was doing weird things.
[12:18:57] <pepijndevos> So now I need to build my own parameter stack.
[13:23:05] <twnqx> or you just compile a mini C program and look at the 10 init instructions the compiler uses as reference
[13:43:14] <Lambda-Aurigae> dgtlmoon, you never said you were running ardweeny krap.
[13:46:48] <hypermagic> hey guys
[13:47:03] <hypermagic> so would you use redundant bus line for mission critical application?
[13:47:25] <hypermagic> vehicle steering, and conrtol servoing systems ?
[13:49:57] <dgtlmoon> Lambda-Aurigae, yeah sorry man
[13:50:19] <Lambda-Aurigae> dgtlmoon, that would have totally changed the conversation.
[13:50:27] <dgtlmoon> Lambda-Aurigae, i started out with avr atmega8 a lot of years ago... kinda just getting back into it
[13:50:34] <dgtlmoon> Lambda-Aurigae, ive got an old STK500 kit
[13:50:35] <dgtlmoon> aha
[13:51:11] <Lambda-Aurigae> hypermagic, all depends on the system, but, in life critical stuff, yeah, triple redundancies all the way.
[13:51:24] <Lambda-Aurigae> luckily, I don't do any life critical stuff.
[13:52:27] <dgtlmoon> but yeah.. cant figure it out tho
[13:52:38] <Lambda-Aurigae> are you using arduino software?
[13:53:01] <Lambda-Aurigae> it should work fine if you drop all the ardweeny crap software and write the code straight.
[13:53:18] <hypermagic> Lambda-Aurigae, i'd think it would not be nice to lose vehicle steering ability while rolling down the road from uphill
[13:54:42] <Lambda-Aurigae> by going 3 point redundancy in comms and such you can do some sanity checking...such as, if 2 tell you to turn left and 1 says turn right then generally, drop the odd man out and follow the crowd.
[13:55:12] <hypermagic> http://www.mycpa.com/wp-content/uploads/2013/01/Road1.jpg :)
[13:55:48] <hypermagic> Lambda-Aurigae, that would be impossible, since i will use hamming code and verify every command
[13:55:52] <Lambda-Aurigae> well, for starters, I would never drive that.
[13:56:26] <hypermagic> possible error modes: link short, link fail, bad contact, interference
[13:57:00] <hypermagic> and maybe underwater - but still, consistency checking should handle that
[13:58:21] <hypermagic> Lambda-Aurigae, i'd think that the minimum number of buses in a vehicle should be 2, 1 for mission critical redundancy, and 1 in general
[13:58:55] <Lambda-Aurigae> and I don't think things should be on shared busses if they are that critical.
[13:58:57] <hypermagic> the vital parts need a dedicated additional bus that is sure
[13:59:23] <twnqx> if you are happy with that, cars rarely have redundancy
[13:59:26] <hypermagic> so your window wiper, or whatever will not cause you to lose control of your wheels
[13:59:47] <twnqx> the only think i have seen is two potentiometers on the throttle position
[13:59:50] <twnqx> thing*
[14:00:11] <Lambda-Aurigae> I trust hardware linkages more than software linkages as far as that goes.
[14:00:13] <twnqx> as in, pedal
[14:00:22] <hypermagic> i dont
[14:00:43] <hypermagic> and i would never trust a "potentiometer"
[14:00:50] <hypermagic> i seen so many fails
[14:01:02] <twnqx> apparently audi doesn't either :P
[14:01:08] <twnqx> that's why there are two
[14:01:22] <hypermagic> oh, i just toss it, and use a hall potmeter...
[14:01:27] <hypermagic> or a capacitive
[14:01:35] <hypermagic> or an inductive
[14:01:37] <Lambda-Aurigae> hypermagic, hardware linkages does not mean potentiometer...I was talking about more the steering system in my truck.
[14:01:58] <hypermagic> Lambda-Aurigae, oh nah, every "modern" car has at least a steering aid
[14:02:14] <hypermagic> it has a servo motor that helps you turn the wheel
[14:02:18] <Lambda-Aurigae> yeah...steering boost..but if that fails I can still turn it.
[14:02:33] <twnqx> actually servo motors are a pretty new thing
[14:02:35] <hypermagic> oh, what if it fails so it would steer you off the road?
[14:02:42] <Lambda-Aurigae> that's one of the things I try when I get a new car.
[14:02:54] <twnqx> earlier cars had hydraulic amplification
[14:02:58] <Lambda-Aurigae> kill the engine and see if I can steer and stop.
[14:03:01] <hypermagic> i doubt you would be able to hold against that servo
[14:03:16] <twnqx> and i think servos are still pretty rare
[14:03:37] <Lambda-Aurigae> pretty sure my truck has hydraulic power steering boost...
[14:03:55] <hypermagic> that will work in case radiation lol
[14:04:08] <Lambda-Aurigae> yeah but the engine control unit won't.
[14:04:13] <twnqx> i would say 99% of new cars still have that
[14:04:14] <hypermagic> no it will die
[14:04:20] <Lambda-Aurigae> so, I can still steer but not go faster.
[14:04:24] <twnqx> what's worrying me more is ESP
[14:04:26] <hypermagic> :)
[14:04:28] <hypermagic> engine will halt
[14:04:35] <twnqx> it can stop you from breaking!
[14:04:52] <twnqx> or just break a single wheel full throttle, sending you spinning
[14:04:58] <hypermagic> yeah it sux that every electronics can be nuked
[14:05:07] <Lambda-Aurigae> twnqx, mine seems to shut down completely if the engine dies even with the key on.
[14:05:09] <hypermagic> even an emp could kill most systems
[14:05:31] <twnqx> i kinda enjoyed the design on my engine controller
[14:05:34] <twnqx> but the others...
[14:05:53] <twnqx> and obviously no EM sealing
[14:06:02] <Lambda-Aurigae> working on getting myself an older 1970s pickup truck to rebuild...something without any electronics beyond the blinkers.
[14:06:11] <hypermagic> :)
[14:06:17] <hypermagic> apocalypse hopper ?
[14:06:23] <Lambda-Aurigae> yup.
[14:06:29] <twnqx> heh
[14:06:54] <hypermagic> watch out for crazy sheep like pepople roaming on the road with weapons then :)
[14:06:54] <Lambda-Aurigae> something with a big V8 that will run on anything from corn whiskey to corn oil.
[14:07:49] <Lambda-Aurigae> guy down the road has one that he literally runs on a combination of grain alcohol and soybean oil...he grows and makes his own fuel for it.
[14:08:28] <twnqx> i can recommend you german leopard ii tanks, they do that as well
[14:08:35] <Lambda-Aurigae> hehe.
[14:08:36] <hypermagic> https://www.pinterest.com/pin/322429654545820783/
[14:08:37] <twnqx> though they consume ~40l/100km
[14:08:38] <hypermagic> hahaha
[14:08:48] <hypermagic> this is the devastator from dune2 ?
[14:08:55] <Lambda-Aurigae> there was an engine designed for the HMMWV that could do it..even had an addon to hook it up to propane tanks.
[14:10:04] <Lambda-Aurigae> http://webby.com/humor/i/ghetto--blaster-L.jpg
[14:10:15] <Lambda-Aurigae> THAT's post apocalyptic!
[14:10:35] <twnqx> that must understeer like crazy
[14:10:46] <hypermagic> Lambda-Aurigae, good evening officer, why did you stop me? ;>>
[14:11:00] <Lambda-Aurigae> excessive noise
[14:11:14] <Lambda-Aurigae> you need to put a muffler on that cannon before you blow another motorcycle gang off the road.
[14:11:25] <hypermagic> your license plate is dirty.
[14:11:56] <hypermagic> also, license and registration please
[14:15:26] <hypermagic> http://forums.vwvortex.com/showthread.php?4244873-OshKosh-SandCat-Approved-TCL-ZAV-%28Zombie-Apocalypse-Vehicle%29-or-no-bagel
[14:15:35] <hypermagic> :) police already starting to use these
[14:16:03] <Lambda-Aurigae> doesn't oshkosh make kid's clothes?
[14:20:03] <dgtlmoon> Lambda-Aurigae, yeah ardweeny software :(
[14:20:29] <dgtlmoon> Lambda-Aurigae, but the point is, ide like to find out why, maybe the UBRR timings are out.. unsure
[14:21:03] <Lambda-Aurigae> that would require digging into the ardweeny code which I won't do...did that once and it made me homocidal.
[14:23:09] <dgtlmoon> yeah, theres some nasty stuff in there
[14:25:34] <Lambda-Aurigae> http://pastebin.com/dSRSxgax
[14:25:39] <Lambda-Aurigae> just look at that.
[14:27:46] <dgtlmoon> Lambda-Aurigae, oh man, thats inefficient
[14:27:51] <Lambda-Aurigae> no
[14:27:57] <Lambda-Aurigae> that's fucking idiotically pathetic
[14:28:24] <dgtlmoon> thats... crazy
[14:28:29] <dgtlmoon> does it really do that? :o
[14:28:36] <Lambda-Aurigae> one can only imagine what they did to the serial comms code.
[14:29:41] <Lambda-Aurigae> now, that is kind of old...been around for 2 years..they might have cleaned it up since then.
[14:29:42] <dgtlmoon> yeah.. tho, its only this particular device it acts weird with
[14:29:43] <Lambda-Aurigae> but I doubt it.
[14:29:47] <dgtlmoon> yeah maybe a little
[14:30:14] <dgtlmoon> my gprs module works 100%... IO to my laptop via USB/uart works 100%
[14:30:30] <dgtlmoon> only RX (TX)from this camera module acts weird
[14:35:23] <dgtlmoon> soo.. argh
[14:50:30] <dgtlmoon> tested with a modem.. its fine
[15:15:33] <osteri> the original idea of arduino was being educational not efficient
[15:15:43] <osteri> i think arduino has its place
[15:17:36] <osteri> i was one of those - mocking arduino, but the idea in arduino is not the code, i think it's the ease of use
[15:18:25] <osteri> for beginners you know...
[15:44:56] <pepijndevos> My first AVR assembly program compiles and runs, but does not have the expected outcome. How can I debug this? https://gist.github.com/anonymous/b9352acb966dfde08140
[15:45:32] <pepijndevos> So far I've been turning on the LED in case it reaches the end.
[15:46:05] <pepijndevos> But now I added a test to see if it actually added the numbers, and it did not, it seems... :(
[15:48:35] <pepijndevos> I think my stack is broken.
[15:51:24] <Lambda-Aurigae> pepijndevos, do you initialize the stack properly?
[15:51:55] <pepijndevos> Lambda-Aurigae, line 16-17 is my attempt to do so
[15:52:07] <pepijndevos> sorry, 18-19
[15:52:18] <Lambda-Aurigae> pepijndevos, if you are running windows you can always install atmel studio and run it through the simulator in that.
[15:52:32] <pepijndevos> I don't. I'm on Mac
[15:54:10] <Lambda-Aurigae> http://www.avr-tutorials.com/general/avr-microcontroller-stack-operation-and-stack-pointer
[15:55:19] <Lambda-Aurigae> oh...wait...looks like you are using your own stack implementation, not the hardware stack.
[15:56:32] <pepijndevos> right, I found the hardware stack is used for subroutines, so that messed it up
[15:56:53] <Lambda-Aurigae> you just have to remember to pop off anything you push on while in a subroutine.
[15:57:35] <Lambda-Aurigae> you might try simulavr and avr-gdb combination for debugging.
[15:57:43] <Lambda-Aurigae> or, just do it manually with pencil and paper.
[15:58:54] <pepijndevos> Yea, kind of laborious. I think I know the problem.... it's the push macro.
[15:59:38] <pepijndevos> I'm not sure how you are supposed to do a multi-line macro... if at all
[15:59:50] <Lambda-Aurigae> dunno..I avoid macros myself.
[16:00:12] <Lambda-Aurigae> but, I started assembly programming before they existed in my assembler program.
[16:02:16] <pepijndevos> haha, ok, so it's working just fine without the macros.
[18:34:04] <hypermagic> thisiswhyyouarebroke all the things you ever wanted to buy pastebin.com/cyny7uRQ
[18:47:38] <hypermagic> dammit dat cool snow camo suit http://imgur.com/gallery/9b0t5