#avr | Logs for 2014-09-21

Back
[00:55:23] <clixx-io> I got a h-bridge working on my Attiny85
[00:55:31] <clixx-io> They are quite fun really
[00:55:48] <clixx-io> Here's the code : https://github.com/clixx-io/clixx.io/blob/master/examples_iotframework/serial-hbridge/serial-hbridge.cpp
[00:56:14] <clixx-io> It's controlled through the serial port. Oh yeah, no serial port, softuart
[01:01:13] <clixx-io> next I have to get some PWM happening so that I can control the motor speed.
[07:08:17] <abcminiuser> Good news Tom_itx
[07:08:26] <abcminiuser> You might have new programmer firmware soon :P
[07:08:44] <Lambda_Auriga_> new stuff new stuff?
[07:08:48] <Lambda_Auriga_> morning abcminiuser
[07:09:17] <abcminiuser> Talking to AVRDUDE guys about the clone programmer breakage in 6.10, looks like we won't need the two firmware modes if we fix it properly
[07:09:46] <Lambda_Auriga_> I've been watching the avrdude mailing list on that.
[07:09:57] <Lambda_Auriga_> just had one come through this morning/last night in fact.
[07:11:14] <abcminiuser> Looks like Joerg is on board with getting it fixed
[07:11:17] <abcminiuser> Which is super neato
[07:12:32] <Lambda_Auriga_> yeah.
[07:12:45] <Lambda_Auriga_> just reading the latest to come through,,5 minutes ago.
[07:14:03] <Lambda_Auriga_> I need to dig through LUFA and the pic32 usb stacks and see how similar they are.
[07:14:26] <abcminiuser> PIC one is probably better
[07:14:35] <abcminiuser> Given they probably had planning and an actual development tea,m
[07:14:51] <Lambda_Auriga_> pic one is a real mess.
[07:15:05] <Lambda_Auriga_> I was thinking of something like porting LUFA to pic.
[07:16:01] <Lambda_Auriga_> but I need to spend more time with code and less reading web comics..
[07:17:44] <abcminiuser> Coding all day at my job this year has tempered my side project enthusiasm, I must admit
[07:17:53] <Lambda_Auriga_> hehe.
[07:17:55] <abcminiuser> Now I get home and just want to watch TV, not keep coding
[07:17:57] <Lambda_Auriga_> I can see that.
[07:18:09] <Lambda_Auriga_> I troubleshoot and fix things all day long.
[07:18:15] <Lambda_Auriga_> when I get home I just want to vegetate.
[07:18:16] <abcminiuser> I spend half my day tearing my hair out, need to save some
[07:18:29] <abcminiuser> Also god damn there are some terrible MCUs out there
[07:18:37] <Lambda_Auriga_> msp430?
[07:19:11] <Lambda_Auriga_> and I'm still on the fence over renesis chips.
[07:19:26] <abcminiuser> Nein unnamed ARM vendor
[07:19:47] <abcminiuser> Bad datasheets, different names for the part on the datasheet, physical device, order code and website
[07:19:54] <abcminiuser> And the actual chips are full of suprises
[07:20:00] <Lambda_Auriga_> HAHA
[07:20:21] <abcminiuser> "By the way this standard flash page has no protection, and setting this bit in it will lock your device forever"
[07:20:23] <Lambda_Auriga_> I wish I could go to that level of work but no degree here so nobody will hire me for such work.
[07:20:35] <abcminiuser> "Better hope your flash driver doesn't have bugs on your $300 kit"
[07:21:35] <abcminiuser> "Oh and we've split the internal RAM into two banks at a non-obvious spot, so enjoy the hardfaults if you happen to read an unaligned word at the boundary address due to linker layout"
[07:21:51] <Lambda_Auriga_> but,,it's cheap!
[07:21:54] <abcminiuser> That last one cost me a LOT of hair friday, since adding debug code would move the problematic array past the boundary
[07:22:38] <Lambda_Auriga_> well there ya go...debug code fixes all the booboos.
[07:23:53] <abcminiuser> "Just glue a scope probe to every kit before we ship it, problem solved"
[07:26:33] <Lambda_Auriga_> I just got a pile of HP printer formatter boards with some strange ARM processor on them.
[07:26:59] <Lambda_Auriga_> chip number shows up hundreds of hits but can't find a datasheet.
[07:27:34] <Lambda_Auriga_> board has a jtag as well as dual serial ports in 0.1 inch header points..just gotta solder pins on.
[07:28:06] <Lambda_Auriga_> then I gotta find/make/acquire a jtag device thingie.
[07:28:32] <DKordic> What is LUFA?
[07:29:01] <abcminiuser> DKordic, a sea plant commonly dried and used as a body scrub
[07:29:07] <abcminiuser> Alternatively, www.lufa-lib.org
[07:29:22] <DKordic> Thanks :) .
[07:29:27] <Lambda_Auriga_> DKordic, usb stack software for AVRs with hardware usb.
[07:29:36] <abcminiuser> Also just want to point out, I manaed to shanghai http://dean.camera
[07:29:54] <Lambda_Auriga_> dang....
[07:29:57] <abcminiuser> Still have no idea what to use it for, but damned if I'm not chuffed I have it
[07:29:59] <Lambda_Auriga_> wonder if there is one for my last name.
[07:31:05] <Lambda_Auriga_> nope.
[07:31:29] <Lambda_Auriga_> use it for a resume page.
[07:36:14] <Lambda_Auriga_> hmm...someone ported LUFA to NXP chips.
[07:36:19] <Lambda_Auriga_> may be hope for me yet.
[07:55:33] <Bushman> ave
[07:59:21] <Bushman> Lambda_Auriga_: last night i've tested everything with the scope and i can't see any noise on the UART input but the PWM changes the timing a tiny bit when the serial line is plugged in
[08:00:21] <Bushman> there's no noise on the PWM output as only slight variations in the lenght of the pulse...
[08:00:29] <Bushman> but with clean edges
[08:00:29] <Lambda_Auriga_> I would build another microcontroller device to hook to the UART and feed it data like your DMX system does..only not through RS485...
[08:00:44] <Lambda_Auriga_> see if that causes the same thing.
[08:00:47] <Bushman> ok, but what if it works?!
[08:00:55] <Bushman> hmm...
[08:01:06] <Bushman> can i power it from the same battery? :P
[08:01:07] <Lambda_Auriga_> if it works and the DMX doesn't then you have a problem with the DMX hardware interface.
[08:01:34] <Lambda_Auriga_> sure.
[08:02:07] <Bushman> ok, i'll try use a board from some other project and use the DMX transmitter example to pair it up
[08:02:49] <Bushman> but wait...
[08:03:16] <Lambda_Auriga_> if that causes the same problem then you have discovered a hardware issue with that AVR I think....
[08:03:31] <Bushman> if i can't see any interference on the RXD input... now i'm just strying to replicate the problem without the 485 hardware, right?
[08:03:58] <Bushman> oh man... i don't want to discover hardware issues
[08:04:00] <Lambda_Auriga_> trying to eliminate the AVR as a problem...that way we isolate it to the rs485 side.
[08:04:39] <Bushman> i think i'll start with runing the same code on different avr
[08:04:51] <Bushman> i have mega328 at hand
[08:05:34] <Bushman> i'll try to squeeze both on one prototyping board :P
[08:05:40] <Lambda_Auriga_> I still think it's an rs485 isolation issue.
[08:06:10] <Bushman> i hope you're right. THAT i can solve somehow
[08:06:26] <Lambda_Auriga_> with that chip I posted yesterday.
[08:06:36] <Bushman> yea
[08:09:01] <Lambda_Auriga_> dunno if they will send to you where you live, but maxim is awesome for sending free samples.
[08:10:06] <Bushman> it can't be that expensive... also i'm sure tme.eu has something similar in stock
[08:10:49] <Bushman> so if i'll figure out the problem and it will turn out to be this thing, i'll just add few of those to our next order
[09:17:04] <Bushman> hmmm...
[09:33:58] <LeoNerd> I'd like to (sortof-accurately) measure order-of 50mA at 3.3 or 5V, to limit the current flow into a small circuit. How accutately could I do that just using the analog comparator to measure the voltage drop over, say, a 1Ohm resistor?
[09:35:17] <LeoNerd> It doesn't have to be "accurate", it just has to be able to say "hey, that's using waaay more than 50mA lets shut it down now"
[09:43:30] <Lambda_Auriga_> LeoNerd, let me find it for you.
[09:44:11] * LeoNerd is currently reading http://www.maximintegrated.com/en/app-notes/index.mvp/id/746
[09:44:20] <LeoNerd> Some Maxim high-side shunt chips
[09:45:21] <Lambda_Auriga_> sorry..gotta go or I would use google and find it for you.
[09:45:42] <LeoNerd> OK no problem; I'm sure I'll find something
[09:52:39] <Lambda_Auriga_> http://embedded-lab.com/blog/?p=1906
[09:52:42] <Lambda_Auriga_> there
[09:52:47] <Lambda_Auriga_> math and everything.
[09:54:43] <LeoNerd> Heh; yeah I'm aware of the basic idea with the shunt resistor and so on.. Just considering all the awkwardness about matching the resistors and so on.
[09:54:44] <Lambda_Auriga_> what it amounts to is you put a very small resistor in line with the device...say, 1 to 5 ohms maybe?...
[09:55:01] <LeoNerd> I wonder if I should just get one of those MAX chips that does 99% of the circuit internally, as then it'll be matched and calibrated
[09:55:15] <Lambda_Auriga_> that is probably the easiest.
[09:55:22] <LeoNerd> if I can find a good source of them ...
[09:55:30] <Lambda_Auriga_> maximintegrated.com
[09:55:51] <Lambda_Auriga_> for one or two.
[09:56:11] <Lambda_Auriga_> if you are mass producing, just about every supplier worth it's weight in packing peanuts will have them.
[09:56:36] <LeoNerd> Nah.. just a one-off thing
[09:56:48] <Lambda_Auriga_> free samples for the win!
[09:57:01] <LeoNerd> I want to put a current sense my Maverick (the Bus Pirate-inspired clone), so it can shut down the circuit under development
[09:57:39] <gjm> btw bus pirate: http://hydrabus.com/
[09:58:40] <mheld> why is my battery ADC sample all over the place?
[09:58:45] <mheld> it goes up sometimes
[09:58:47] <mheld> down others
[10:31:34] <rue_house> mheld, you didn't filter it
[10:31:51] <rue_house> what loads are on the battery?
[10:42:14] <rue_house> ok I'm gonna guess you have 300hz noise from motors,
[10:42:31] <rue_house> and that your battery takes atleast a half hour to die
[10:43:05] <rue_house> your using an 10 bit adc at 5V ref
[10:43:07] <Tom_itx> sounds like a painful death. make it quicker!
[10:43:15] <rue_house> and that 2 units of error are ok
[10:43:54] <rue_house> furthermore I'l guess that your battery has about 1V ripple now
[10:45:28] <LeoNerd> Bah. I can't find MAX4172s in DIP8 TTH form, only SOIC
[10:48:04] <rue_house> its not made in dip
[10:48:13] <rue_house> get a converter board
[10:48:33] <LeoNerd> No.. indeed. :/ Doesn't have to be that then; any of the high-side current-sense chips would do
[10:49:12] <rue_house> how much current?
[10:49:16] <LeoNerd> Or I try to hand-solder it onto a SOIC8 breakout board
[10:49:26] <LeoNerd> ~100mA total. it's for small circuit prototyping..
[10:49:54] <rue_house> oh
[10:50:17] <LeoNerd> http://www.hobbytronics.co.uk/prototyping/smd-adapter-boards/soic-dip-breakout-8-ht reckon I could hand-solder that?
[10:50:18] <rue_house> my circuits are for, like, amps
[10:50:53] <Bushman> i could solder that
[10:51:02] <Bushman> hand-solder that is
[10:51:24] <Bushman> i'm a lot better at hand-soldering than at coding.
[10:52:29] <rue_house> http://www.aliexpress.com/item/Brand-New-High-Quality-SO8-SOP8-To-DIP8-EZ-Programmer-Adapter-Socket-Converter-Module-For/1899884404.html
[10:52:33] <rue_house> I have one of those, its nice
[10:52:37] <Bushman> speaking of which... i have a brand new 328 and i guess i need to set the clock fuse, right?
[10:53:44] <Bushman> i plan on running it from external 16mhz crystal.
[10:54:13] <LeoNerd> I'd just reset all the fuses anyway
[10:54:37] <Bushman> i don't have any fancy IDE so i'll have to do it by hand with avrdude and hope for the best XD
[10:54:47] * Bushman reads avrdude manual
[10:55:18] <LeoNerd> Heh; personally I wouldn't trust anything /except/ avrdude ;)
[10:55:50] <rue_house> usbfuseint:
[10:55:51] <rue_house> avrdude -c avrisp2 -P usb -p m328p -U lfuse:w:0x62:m -U hfuse:w:0xd9:m -U efuse:w:0xfe:m
[10:55:51] <rue_house> usbfuseext:
[10:55:51] <rue_house> avrdude -c avrisp2 -P usb -p m328p -U lfuse:w:0x47:m -U hfuse:w:0xd9:m -U efuse:w:0xfe:m
[10:56:22] <rue_house> internal and external(crystal) clock source
[10:59:04] <rue_house> http://www.ebay.com/itm/2-Dual-SOIC-to-DIP-8-Convert-PCB-Adapter-SMD-OPA627-/321427865272?pt=LH_DefaultDomain_0&hash=item4ad697feb8
[10:59:07] <rue_house> 75c ea
[10:59:16] <rue_house> soic8 to dip8
[10:59:18] <LeoNerd> Yah; I can get the boards easy enough
[10:59:26] <LeoNerd> I'm just wondering how hard it is to solder hem up
[10:59:29] <rue_house> for 75c ea?
[10:59:38] <rue_house> its not hard, put the chip on first
[11:00:00] <rue_house> note that that zif socket is typcially cheaper than you can find those converter boards for
[11:00:54] <rue_house> http://www.ebay.com/itm/20-PCS-SOP8-SO8-SOIC8-SMD-to-DIP8-Adapter-PCB-Board-Convertor-Double-Sides-244A-/281372402558?pt=LH_DefaultDomain_0&hash=item41831a237e
[11:01:55] <LeoNerd> Oh.. heh. well, I want something permanent for building into a project
[11:02:49] <rue_house> k
[11:03:07] <rue_house> do you even need an external resistor when using currents like that?
[11:03:35] <LeoNerd> 1 ohm or so
[11:03:48] <rue_house> how many volts you working with
[11:03:54] <LeoNerd> 3.3 or 5
[11:04:09] <rue_house> so you realize that will drop the voltage .1v
[11:04:54] <rue_house> @100ma
[11:04:57] <LeoNerd> Hmm.. so maybe 0.1mOhm.
[11:05:01] <LeoNerd> Er.. 0.1Ohm
[11:05:19] <rue_house> .01v is more reasonable!
[11:05:23] <rue_house> :)
[11:05:25] <LeoNerd> Alternatively I just put the voltage sense for the PSU after the shunt R
[11:05:38] <rue_house> indeed
[11:06:43] <rue_house> zippo:/files/programming/c/SDL/digscope# ohm -i 0.1 -r 1
[11:06:43] <rue_house> Wattage is: 0.010000
[11:06:43] <rue_house> Current is: 0.100000
[11:06:43] <rue_house> Voltage is: 0.100000
[11:06:43] <rue_house> Resistance is : 1.000000
[11:06:49] <rue_house> wattage wont be an issue...
[11:34:38] <Bushman> hmm..
[11:35:21] <Bushman> Lambda_Auriga_: i have my 328p in terminal mode with AVRDude. can you lead me through fuse bits so i won't screw somthing up?
[11:37:18] <rue_mohr2> Bushman, do you know the fuse calculator site?
[11:37:58] <Bushman> nope
[11:37:59] <rue_mohr2> http://www.engbedded.com/fusecalc/
[11:38:01] <rue_mohr2> one of many
[11:38:46] <Bushman> yea, found it on google just now
[11:38:48] <Bushman> :P
[11:41:11] <rue_mohr2> avrdude will complain that some fuses didn't set right, its becuase they are unused and dont co-operate with the notion of being programmed
[11:41:18] <rue_mohr2> but it will work
[11:42:07] <Bushman> one thing for sure i want to keep the ISP and reset.
[11:42:50] <rue_mohr2> via isp you cannot unprogram isp
[11:43:11] <Bushman> heh, well that good
[11:46:20] <LeoNerd> Unless you knock out the RSTEN bit
[12:32:25] <LeoNerd> Huh!
[12:32:47] <LeoNerd> I've -twice- now managed to transmit a packet between my nRF chips. No more than that. But just occasionally it works
[12:33:03] <LeoNerd> So I'm suddenly confident the settings are correct.. but now I wonder why it's being so unreliable
[12:37:30] <LeoNerd> Ahah. If I reset all the power everywhere and start again, then it does a single packet
[12:40:28] <Casper> rue_mohr2: hey maybe you know! I have 2 circuits, one with 'standard' negative grounding, one with positive grounding. I want to use I2C between the 2 half. Do you have an idea how?
[12:41:10] <Tom_itx> optos?
[12:45:44] <rue_mohr2> hmm
[12:46:09] <rue_mohr2> I hate the dual direction level shifting thing
[12:47:16] <LeoNerd> This is one of the main reasons why I dislike I2C. I much prefer SPI
[12:47:43] <rue_mohr2> there is a way, I'v seen a circuit hat split the directions and used two standard optos
[12:49:18] <Casper> Tom_itx: opto are too slow unless you use specialised IC to recondition the signal
[12:49:57] <Casper> the 2 opto way work ok if clock stetching and multi-master is not used
[12:50:52] <Tom_itx> GTL2003 might work, i dunno
[12:50:55] <Tom_itx> might not
[12:51:01] <Casper> there is a glitch that happend when both side are pulled low, then one release... the side that release see a brief '1' spike, that spike is caused by the delay for the other opto to kick in
[14:01:15] <LeoNerd> So.. how do I make an output be either open-drain -or- push/pull drive, with digital control as to which..?
[14:01:25] <LeoNerd> I'm guessing some sort of transistor pair on the output
[14:36:08] <aandrew> LeoNerd: hm?
[14:37:08] <aandrew> LeoNerd: for open-drain operation you write a set_output() function which sets the pin to output and logic low when a '0' is requested, and sets the pin to an input (and perhaps enables a pullup) when a '1' is requested
[14:40:11] <LeoNerd> Yeah; that's not what I asked. :) Your method works for setting digital IO pins under program control. I want to place a configurable switchable opendrive or pushpull buffer in front of the hardware SPI port
[14:40:30] <LeoNerd> The ATmega SPI port is always in pushpull mode, you can't normally ask it to be open-drain
[14:41:42] <ivanshmakov> LeoNerd: If you need a /master/ SPI port, then you can turn it on and of as necessary.
[14:42:56] <LeoNerd> Mmm?
[14:43:35] <LeoNerd> That's again not what I want. I'm trying to perfectly recreate the Bus Pirate. The Bus Pirate is based on a PIC24... chip of some kind. That hardware has switchable opendrain vs. pushpull outputs; the Bus Pirate software decides to expose this to the user
[14:46:06] <aandrew> LeoNerd: fair enough; I couldn't deduce what you were asking
[14:46:35] <aandrew> LeoNerd: I suspect the bus pirate uses software SPI and thus has full control over what it wants to do
[14:47:31] <LeoNerd> Ooh.. that might be it
[14:47:33] <LeoNerd> Hrmmm
[14:47:49] <LeoNerd> Notsure I can do software SPI up to 4MHz on an AVR
[14:48:10] <LeoNerd> at 16MHz that's 4 cycles per clock tick.
[14:51:59] <aandrew> I think the idea of a bus pirate/logic analyzer/signal generator out of an FX2LP would be better received
[14:52:15] <aandrew> more I/O, *way* faster and still cheap
[15:08:12] <JustinN> I'm using Atmel Studio 6, migrating some code from Arduino and am surprised that I'm not getting any compiler errors with the "millis()" function calls... is this method now within the AVR library?
[15:24:38] <rue_mohr2> Casper, look up 6N137
[15:37:47] <JustinN> scratch that, seems it doesn't give me compile errors for any calls to functions that do not exist... bah
[15:38:15] <twnqx> why would it
[15:38:16] <Tom_itx> it should
[15:38:22] <twnqx> only with -Werrror
[15:38:29] <twnqx> undeclared functions do not cause errors.
[15:38:37] <twnqx> (only when linking...)
[15:40:56] <Bushman> http://i110.photobucket.com/albums/n86/MCRfreek92/i-have-no-idea-what-im-doing-dog.jpg
[15:41:17] <Bushman> http://www.engbedded.com/fusecalc/ this thing confuses me.
[15:41:29] <Bushman> i don't know what i want and what i don't want.
[15:41:53] <Bushman> there's one thing i'm sure and it's the SPI
[15:50:53] <aandrew> Bushman: what's confusing you I can help
[15:50:56] <aandrew> I use it all the time
[15:51:05] <aandrew> jadew: buna ziua
[15:53:43] <Bushman> i'm not sure what options i want and which i don't want.
[15:53:46] <jadew> aandrew, heh, buna ziua :)
[15:54:04] <jadew> aandrew, how did you know?
[15:54:14] <Bushman> i want to use 16mhz xtal @5V and be able to program with serial programmer
[15:54:34] <Bushman> and my current MCU is atmega328p
[15:55:18] <Bushman> but i'm not sure if i want full-swing or what.
[15:55:27] <Tom_itx> you want full swing
[15:55:27] <aandrew> jadew: how did I know what
[15:55:31] <Bushman> donno about the boot stuff either
[15:55:51] <aandrew> Bushman: what part
[15:56:16] <jadew> aandrew, that I'm romanian
[15:56:16] <Bushman> what do you mean what part?
[15:56:49] <aandrew> jadew: we've been through this a few times. :-)
[15:57:19] <jadew> oh :P
[15:57:22] <aandrew> ok atmega328p, so you select that obviously
[15:57:29] <Bushman> yes
[15:57:57] <aandrew> then you look at the clock you want, drag down to external full swing and which onef rom there? I always choose the longest start up time
[15:58:15] <aandrew> just because the better crystals don't care and the shittier ones need longer startup to become stable
[15:58:19] <Bushman> i'm pretty sure i want the reset pin active so i leave that unchecked and i want SPI so i leave that checked
[15:58:28] <aandrew> I don't /8 just becaue I'm badass that way
[15:58:39] <aandrew> and yes you want reset active unless you're totally out of pins
[15:58:55] <aandrew> leave the boot alone
[15:58:57] <aandrew> (at default)
[15:59:03] <aandrew> spi enabled as you said
[15:59:17] <aandrew> and brownout you can leave disabled but for production I like to make sure ther's some brownout protection
[16:00:25] <aandrew> but basically you either fool around with the "feature configuration" or "manual configuration" but not both
[16:00:29] <aandrew> it'
[16:00:35] <Bushman> i need the clock to be 16mhz so i need to uncheck the divide by 8 bit too, right?
[16:00:36] <aandrew> it's two different ways of looking at the same bits
[16:00:47] <aandrew> well the /8 is just for your application
[16:00:53] <aandrew> do you want the CPU to run at 16MHz or at 2MHz?
[16:01:03] <aandrew> read up on the docs to find out why you'd want /8 or not
[16:01:07] <Bushman> 16
[16:01:28] <Bushman> or hmm...
[16:01:39] <Bushman> when i think about it now...
[16:01:52] <Bushman> i'm using /8 prescaler in timer1
[16:02:19] <aandrew> Bushman: http://www.ladyada.net/learn/avr/fuses.html
[16:02:21] <aandrew> that is helpful
[16:02:26] <Bushman> but no... the UART is 250kbaud. i think it needs the whole 16mhz (atleast that's what was in the example)
[16:02:51] <aandrew> there is http://embedderslife.wordpress.com/2012/08/20/fuse-bits-arent-that-scary/ as well, haven't really read it just part of a google search
[16:08:31] <Daghdha_On> So i am looking at this, and it is now available. But where? http://tom-itx.ddns01.com:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[16:09:00] <Tom_itx> from me
[16:09:32] <Daghdha_On> But not trough your website?
[17:00:45] <Bushman> oh man, what have i got myself into.
[17:01:57] <Bushman> m16 and m328 UART registers obviously aren't the same.
[17:02:20] <Tom_itx> NOPE
[17:02:57] <Bushman> so i'm screwed. i'm not experienced enough to attempt to port it
[17:03:27] <Tom_itx> oh it's not that difficult
[17:03:33] <Bushman> i don't even know what the code does. how am i suppose to port it without understanding it ;/
[17:03:53] <Bushman> i've tried the stupid approach...
[17:03:55] <Tom_itx> compare the data sheets
[17:04:06] <Tom_itx> what the bits in the registers are
[17:04:44] <Bushman> Tom_itx: i've tried something close to that... i've tried loking for similar registers in both datasheets
[17:05:14] <Bushman> most differences are the m328 has UART number in register name
[17:05:35] <Bushman> example: UBRRnH vs. UBRRh
[17:05:39] <Tom_itx> does it have more than one?
[17:05:43] <Tom_itx> that would be why
[17:05:50] <Bushman> apparently it does
[17:05:55] <Tom_itx> so select the first one
[17:06:05] <Bushman> heh, i started to do that
[17:06:26] <Bushman> then i've run into stuff that does not exist in the m328 registers
[17:08:25] <Bushman> so now, i have to understand the code by comparing it with the datasheet and virtually re-write it but this time looking for equivalents in the other datasheet
[17:08:57] <Bushman> my brain hurts just from thinking about doing that.
[17:17:31] <LeoNerd> Kinda offtopic but: does anyone know, with the nRF24L01+, is DPL (dynamic packet length) purely a receiver-side feature, or does it have over-the-air effects and the transmitter has to enable it too?
[17:21:09] <LeoNerd> Ah.. by observation: TX is needed too
[17:21:41] <Bushman> i only ever user RF12 and the code was written by someone else :P
[17:21:56] <LeoNerd> 12?
[17:22:37] <Bushman> 433mhz, small and cheap
[17:22:54] <Bushman> pretty dated too so might not be popular anymore
[17:23:10] <Bushman> ok, another problem... there's no Frame Error bit
[17:23:20] <Bushman> o_O
[17:24:56] <Bushman> and i need it cause the code is using it for DMX protocol frame sync
[17:37:44] <LeoNerd> Hrmmmm... So, weirdly: I can now reliably pass a single packet from PTX to PRX (nRF24L01+ modules)... but after the RX has received the first packet, it never manages to receive another one.. I have to totally power it down and up again, reconfiguring it once more..
[17:37:45] <LeoNerd> Anyone think of anything I've forgotten to do?
[17:37:46] <LeoNerd> IT doesn't need to be re-armed again does it? Beyond just resetting the interrupt mask I mean...
[17:46:55] <Bushman> LeoNerd: shouldn't be.
[17:48:01] <LeoNerd> Hrm.. it's weird then. :(
[17:49:25] <LeoNerd> Well, still. I now have -some- examples that work. So hopefully tomorrow I'll get around to burning up a little program in an Arduino to talk to the radio chip directly, and observe it from that. Then I can see which end is upset
[17:49:44] <Bushman> as weird as the fact that my code relies on a bit in a register that does not exist in the same register of other device?
[17:51:51] <Bushman> mega16 has Frame Error bit in UCSRA but mega328 does not have such bit in UCSRnA nor any other register
[17:52:39] <Bushman> if ( UART_Status & (1<<FE)) //If we detect a frame error=> RX_line low for longer then 8 bits (Break condition)
[17:53:30] <Bushman> no FE, no break condition and the channel counter keeps counting untill it overflows and crahses whole code.
[17:53:49] <Bushman> well, it probably would do that if i was actually able to compile it
[17:57:04] <Bushman> http://en.wikipedia.org/wiki/DMX512#mediaviewer/File:Annotated_trace_of_DMX-512_signal.png
[17:58:17] <Bushman> i need to detect the break condition with atmega328p's UART. any ideas how can i do that without FrameError bit as in atmega16?
[18:00:46] <LeoNerd> Ah.. Serial breaks. I was literally just looking into those
[18:22:52] <Bushman> LeoNerd: but do you have some ideas how can i do it?
[18:24:10] <LeoNerd> Not offhand, no..
[18:24:32] <LeoNerd> Are you just trying to talk DMX, by the way?
[18:24:40] <LeoNerd> If so there's various DMX libraries already around
[18:31:39] <Bushman> yea, not talk but listen tho
[18:31:53] <Bushman> and i'm using an example from the internet
[18:32:30] <Bushman> which seems to work on m16 but i had issues i wanted to diagnose by checking other mcu
[18:32:46] <Bushman> m16 and m328p are the only ones i have at hand atm
[18:41:56] <timemage> Bushman, i guess hook RX to another pin and measure the time it stays low.
[18:42:35] <LeoNerd> Ohyes, maybe use one of the timers
[18:44:34] <Bushman> the search tool of firefox led me to confusion... it turns out there is FE bit in 328's UART0
[18:45:03] <Bushman> a friend helped me find it. donno why it could be found in one datasheet and not in the other ;/
[18:46:30] <timemage> Bushman, not that you necessarily care, but i think more work would need to be done if you wanted to actually distinguish between a framing error and break. if you're not particular concerned about framing errors in general then it wouldn't really matter.
[18:51:16] <Bushman> well, the data is updated every ~23ms so i probably don't need to care about errors
[18:51:32] <Bushman> as most of DMX devices do
[18:51:48] <Bushman> but the break condition is crucial
[18:51:57] <Bushman> anyway, the example now compiles
[18:52:03] <aandrew> most UARTs will have a bit to indicate break
[18:52:10] <aandrew> does the 328's not have that?
[18:52:48] <Bushman> got it running on the m328p now so need to haul back the DMX console and compare behavious
[18:52:51] <Bushman> *behaviour
[18:52:53] <Bushman> brb
[18:54:31] <aandrew> yeah all it says is that FE is used to detect BREAK
[18:55:06] <aandrew> note that you must read the status BEFORE you read the rx data register
[18:55:11] <aandrew> that's a common mistake
[18:56:45] <Bushman> well, the author of the example apparently took care of that
[18:57:05] <Bushman> i just copied it and it runs
[18:57:19] <Bushman> had to fix the register names for 328 tho.
[18:58:23] <Bushman> aaaand...
[18:58:27] <Bushman> it doesn't work
[18:58:28] <aandrew> my ISR usually looks like while ((s = statusreg) == data_available) { d = datareg; if (s & error mask == 0) { store data; } else { recoveries for various status conditions } };
[18:58:29] <Bushman> :D
[19:00:04] <Bushman> hmm.. :|
[19:00:19] <Bushman> i'm gonna have to compare all the damn registers now ;/
[19:02:08] <Bushman> or not
[19:02:19] <Bushman> it works!
[19:02:41] <Bushman> and no interferences!
[19:36:24] <Casper> has anyone tried to send data over the power line? as in DC, not AC...
[19:36:57] <Casper> I know it's doable, I just wonder how complex the circuit get on each device...
[19:39:14] <Bushman> depends on power requirements of the device
[19:39:31] <Bushman> on low power devices it's a lot simplier
[19:40:44] <Casper> actually, all I need is a way to have bidirectional communication in a multi-master multi-slave bus, which sit at different voltage levels
[19:40:44] <Lambda_Auriga_> Casper, AC signal over DC line is done, yes.
[19:41:01] <Casper> I planned to use I2C, but my -19V is an issue...
[19:41:15] <Casper> opto isolation require specialised IC to fix some glitch
[19:41:43] <Bushman> what do you mean by "sit at different voltage levels" ?
[19:41:53] <Bushman> relative to what?
[19:42:03] <Lambda_Auriga_> that's exactly it.
[19:42:08] <Lambda_Auriga_> relative to what....
[19:42:23] <Casper> one side is negative grounding (which may be connected to earth), the second side is positive grounding connected to earth...
[19:42:39] <Bushman> oh
[19:43:24] <Casper> I may go -12V, which is the initial plan, but may also go -19V... I have plently of laptop adapters...
[19:43:30] <Bushman> you can try to send a data with a carier frequency over the ground line
[19:43:43] <Lambda_Auriga_> if you hook 2 9V batteries together and use the connection point in the middle as one GND point then you can run a circuit at GND to +9V and another at GND to -9V(making the -9V the effective GND and the center point +9V)...and another using the +9 and -9 to give 18V
[19:44:06] <Casper> so I was wondering about sending the signal over the dc line, which then I just need to capacitor couple the different supply...
[19:44:27] <Lambda_Auriga_> cap couple an AC signal in.
[19:45:03] <Bushman> yea. just henerate a higher frequency carier and modulate it with your data
[19:45:09] <Bushman> *generate
[19:45:15] <Lambda_Auriga_> yup.
[19:45:17] <Casper> basically, I want to be able to flash the different avr, diagnose and change the settings values without having to mess with changing the wires or alike...
[19:45:46] <Casper> or.... maybe I could just make a data switcher... and use rs232...
[19:45:54] <Lambda_Auriga_> heck, dallas 1-wire system can do it.
[19:46:14] <Lambda_Auriga_> although that's more sucking power off of a data line.
[19:46:29] <Casper> 1 wire "can" do it...
[19:46:46] <Casper> it's just some extremelly low power devices
[19:46:54] <Casper> with build in capacitos
[19:47:28] <Lambda_Auriga_> http://electronics.stackexchange.com/questions/50522/how-to-couple-a-signal-on-to-a-dc-line
[19:47:49] <Lambda_Auriga_> there ya go.
[19:49:37] <Casper> yeah, that's the basic idea
[19:49:44] <Casper> but I guess it's complex...
[19:49:50] <Lambda_Auriga_> you can't really run i2c that way.
[19:50:01] <Lambda_Auriga_> you would have to do some conversion and modulation/demodulation.
[19:50:50] <Lambda_Auriga_> I suppose with the right circuit you could do i2c that way but it would be rather complex.
[19:52:01] <Casper> well, the protocol itself isn't much of an issue
[19:52:06] <Lambda_Auriga_> I've never done digital over DC power lines but have done analog audio over DC power line several times....intercom system with 2 wires.
[19:52:40] <Casper> and that require basically a radio on both end right?
[19:52:46] <Lambda_Auriga_> nope.
[19:53:02] <Lambda_Auriga_> amplifier with mic and speaker and a switch.
[19:53:27] <Casper> oh so just a big fat inductor on the psu then
[19:53:51] <Lambda_Auriga_> cap coupled to the +V line...audio fed through the cap.
[19:54:14] <Lambda_Auriga_> DC doesn't pass through the cap but the AC signal from the amp does.
[19:54:19] <Casper> yeah
[19:54:35] <Casper> will have to check out if that is a simple solution...
[19:54:52] <Casper> or maybe I shall just trash the positive grounding... and replace the wires as needed...
[19:55:22] <Casper> wanted to use positive grouding due to some wires thatr will be burried<
[19:56:14] <Casper> hmmm I just realised that I found a small issue...
[19:56:23] <Casper> with the I2C stuff
[19:56:35] <Casper> if one circuit is powered off... it bring down the whole bus
[20:00:14] <Bushman> not if you would do some sort of modultion/demodulation. lack of modulation = no device so powering it down would just make it disapear
[20:00:39] <Bushman> unless you're talking about direct I2C now
[20:00:58] <Bushman> in either case, i'm off to sleep.
[20:01:01] <Bushman> g'nite!
[20:02:05] * Bushman is gone
[20:09:06] <Casper> I'll drop the positive grounding idea. No more issue now... (except the no power)
[23:23:55] <mheld> why would my alarm be re-running the main loop?
[23:28:22] <timemage> mheld, mmm, what?
[23:36:25] <mheld> so it looks like it does it's main loop
[23:36:27] <mheld> goes to sleep
[23:36:32] <mheld> gets woken up when it's supposed to
[23:36:45] <mheld> then after it does its alarm function, re-runs the main loop
[23:43:21] <timemage> mheld, are you talking about the watchdog timer?