#avr | Logs for 2012-05-31

Back
[09:31:07] -niven.freenode.net:#avr- [freenode-info] channel trolls and no channel staff around to help? please check with freenode support: http://freenode.net/faq.shtml#gettinghelp
[14:00:11] <Fleck> any ideas why using uart - pin interrupts get skipped? chip atmega 328p? i mean i send data from pc and meanwhile INT0 gets triggered at around 100Hz and some triggers never happen
[14:00:26] <Fleck> if i stop sending data - works great!
[14:00:56] <Fleck> using 16MHz crystal
[14:02:10] <LoRez> they shouldn't I wouldn't think.
[14:02:32] <Corwin_> i suppose you are using TX interrupt to handle UART
[14:02:33] <RikusW> do you have a capacitor connected to Vcc - Gnd ?
[14:02:49] <Corwin> 16mhz xtal... Arduino ?
[14:03:26] <Fleck> yes, i have arduino bootloader... but not original arduino board
[14:03:26] <Fleck> sec
[14:05:54] <Fleck> cant fine circuit :D
[14:06:00] <Fleck> *find
[14:06:20] <RikusW> Steffanx: http://www.wikispeed.com/ :-P
[14:11:09] <amee2k> Fleck: do you use any other interrupts besides the INT0 ?
[14:11:42] <amee2k> if your other ISRs take too long to execute, you might be losing interrupts
[14:11:42] <Fleck> no
[14:11:48] <amee2k> hmm okay
[14:12:00] <Fleck> just uart/usart
[14:12:09] <Fleck> i think uses interrupts... too?
[14:12:20] <Fleck> but the same code works just fine on mega 2560
[14:12:21] <amee2k> it can or cannot
[14:12:31] <amee2k> you can use it both ways
[14:12:50] <Fleck> i just used Serial.begin();
[14:13:08] <amee2k> any third party libraries that may use interrupts or disable interrupt processing?
[14:13:26] <Fleck> nope
[14:13:31] <Fleck> no includes at all
[14:13:35] <Fleck> sec
[14:13:38] <amee2k> o.O
[14:13:45] <Corwin> Fleck, HardwareSerial library from arduino uses interrupts for transmitting data
[14:13:45] <Fleck> http://fleck.rullz.lv/acdimmer/ac_dimmer_220V_arduino_code.ino
[14:14:07] <Fleck> simple as this
[14:15:55] <Corwin> ... and receiving too
[14:16:48] <Fleck> Corwin ok, ill check it out! thx! :)
[14:16:50] <Corwin> i suggest moving the code reading from serial to loop()
[14:17:01] <Fleck> didn't make a difference
[14:17:15] <Fleck> tried that... :)
[14:17:36] <Corwin> hmm.. thinking about it... makes sense :)
[14:18:02] <Corwin> havent used arduino libs for over a year now :)
[14:20:27] <Corwin> what is source for that INT0 interrupt?
[14:20:39] <Fleck> http://fleck.rullz.lv/acdimmer/ac_dimmer_220V_circuit.png
[14:34:27] <solexious> where's the best place to ask avr gcc questions?
[14:34:40] <Corwin> here?
[14:34:45] <xorm> this isn't a bad place for that
[14:34:48] <solexious> rightp
[14:34:52] <solexious> righto*
[14:34:56] <amee2k> lol
[14:35:12] <amee2k> (re:dimmer schematic) someone can't draw :P
[14:35:27] <Corwin> amee2k :D
[14:35:36] <Fleck> amee2k ?
[14:36:16] <solexious> so, trying to debug this code for an attiny13, trying to make it so if you push a button for less than 100ms it sets PB0 high (connected to an led) or if you push it longer it goes low. http://pastebin.com/sK6QJbJ9
[14:36:29] <amee2k> i'm so used to the "power flow goes vertical, signal flow goes horizontal" convention that it took me about two minutes to figure out what the bridge rectifier is for :P
[14:36:52] <amee2k> that thing looks like a ham schematic
[14:37:18] <Fleck> whats ham schematic? ;D
[14:37:28] <Corwin> schematics for ham sandwich? :)
[14:37:31] <amee2k> a schematic drawn by an amateur radio operator?
[14:37:44] <Landon> amee2k: just pretend it works like a roundabout ;)
[14:37:58] <amee2k> somehow ham schematics have a way of completely ignoring any and all conventions i've ever heard of :P
[14:38:01] <amee2k> Landon: LOL
[14:38:14] <amee2k> well, stereotypical ham schematics anyway. and there are a lot of them
[14:38:33] <Fleck> dunno, easly readable by me
[14:38:41] <Fleck> maybe you have some reading skill problems :D ?
[14:38:45] <amee2k> at least they didn't draw the mains input with positive ground
[14:38:47] * amee2k runs and hides behind the sofa
[14:38:58] <Steffanx> I see you!
[14:39:05] <amee2k> i don't :P
[14:39:11] <Steffanx> Wireless keyboard?
[14:39:19] <amee2k> laptop
[14:39:21] <Steffanx> :P
[14:39:33] <amee2k> a laptop is a wireless keyboard with wifi cable
[14:39:53] <Fleck> anyway, problem is with atmega 328p, not chematics ;D
[14:40:43] <Corwin> actually the problem is arduino library :P
[14:41:09] <Landon> amee2k: I should dig up my freshman year power supply schematic
[14:41:11] <Landon> it might give you nightmares
[14:41:25] <Landon> (heck, it might give _me_ nightmaires, I haven't seen it in 5 years)
[14:41:43] <RikusW> solexious: you might have a problem with the switch bouncing...
[14:42:11] <solexious> RikusW: ah, right
[14:43:12] <RikusW> and you didn't set the initial state for B0, though its usually 0 on reset
[14:46:47] <RikusW> solexious: you could add code that checks for B0 to be low for say 10ms to debounce it
[14:47:26] <RikusW> or simply add a delay(10); it might work too ?...
[14:48:09] <RikusW> anyone here knows what the usual switch bounce frequency is ? I suspect rather high...
[14:50:15] <Landon> I'll see if I can find the article I was reading a while back
[14:50:25] <Landon> I'm pretty sure it had some graphs of different switches
[14:51:06] <amee2k> Landon: hehe :)
[14:52:17] <Fleck> Corwin u think so?
[14:52:56] <Landon> no luck in 5 minutes, so I'll just drop this off http://www.engscope.com/wp-content/uploads/2009/02/debounce.png
[14:54:42] <drgreenthumb> http://tech.thetonegod.com/debounce/debounce.html
[14:54:51] <drgreenthumb> best resource I found.
[14:55:00] <RikusW> http://www.ganssle.com/debouncing.pdf
[14:55:37] <Landon> RikusW: that's absolutely the page I had in mind
[14:56:56] * RikusW googled ;)
[14:57:09] * Landon google book'd but found it after you
[14:57:30] <Landon> I knew it was mentioned in Making Embedded Systems somewhere
[14:58:49] <RikusW> ---> http://www.google.com/search?q=debouncing+a+switch
[14:58:58] <drgreenthumb> btw thetonegod link has a bunch of different solutions to try. the simplest being a resistor and a cap, which might work if you're lucky.
[15:02:39] <drgreenthumb> heh or one thing to do might just be to sample the pin a bunch of times and count how many highs / lows you receive. after n samples just compare the numbers.
[15:02:56] <drgreenthumb> bigger n means more stable operation
[15:03:02] <drgreenthumb> but slower of course :)
[15:05:05] <drgreenthumb> of course that means polling not pcint. so I'll shutup now.
[15:36:25] <antto> are there some standard names for serial ports on mac osx?
[15:36:42] <antto> like in windows "COM1" "COM2" "COM3" ...
[15:36:47] <mrfrenzy> I would guess they are in /dev/TTY... like in all unixes
[15:37:33] <antto> "/dev/tty.usbserial-A8004B3k"
[15:37:43] <antto> this is what my "mac" fellow pasted
[15:37:50] <antto> the last bit of it looks scary
[16:12:00] <amee2k> hrm. speaking of atmegas, i may have a slight reverse engineering problem ahead
[16:12:31] <landonf> antto: USB serial devices are assigned something driver-specific, IIRC. Such as the above.
[16:12:55] <amee2k> for an entirely unrelated project we bought a kit fill level sensor that works pretty nicely, but we need to adjust the update interval and if possible a few other details about it
[16:14:01] <amee2k> the hardware is well documented (complete schematic and textual description of the working principles) but they keep insisting that they cannot disclose the firmware of the pre-flashed MCU to customers (wtf moment, but still)
[16:15:02] <amee2k> i don't have the unit on my desk, but from the schematic it is a mega168... assuming they were at least somewhat clever and thought of this situation
[16:15:23] <amee2k> what kind of code protection do megaX8s have and what tools do i need to override it?
[16:16:17] <amee2k> the reset pin is wired to an external BOD/supervisor so i'd say it is safe to assume the reset pin is available
[16:19:35] <amee2k> the only thing that i've found so far is the DWEN/SPIEN fuse bits and the memory lock bits
[16:20:13] <amee2k> looks like i can get around messed up SPIEN by using an HVPP programmer, right?
[16:24:25] <amee2k> what would i need to get around locked down memory lock bits?
[16:25:26] <Steffanx> Expensive equipment? :P
[16:25:41] <amee2k> for example? :)
[16:27:59] <drgreenthumb> heh so that LCD + breakout claims to have some solder and you just heat it with an iron. easypeasy eh? not quite so :P can't even align it properly without wearing a loop. and the "tinned" pads don't stick at all
[16:28:32] <drgreenthumb> ended up wiping some solder paste on it. hopefully I didn't destroy the damned thing soldering it :/
[16:28:50] <drgreenthumb> of course, the solder paste worked brilliantly I should have just done that first :P
[16:30:27] <drgreenthumb> it's a bit ugly but the connections do look pretty clean. if a teensy bit skewed.
[16:31:27] <drgreenthumb> time to connect this little thing up, see if I can display some pretty pics :)
[16:44:28] <drgreenthumb> backlight works, that's a good sign =)
[17:04:38] <drgreenthumb> holy spaghetti batman
[17:05:15] <mrfrenzy> got picture?
[17:05:46] <drgreenthumb> coming shortly. bad cell phone pic so don't get too excited :P
[17:09:49] <drgreenthumb> http://i.imgur.com/xnBsx.jpg
[17:11:07] <drgreenthumb> heh now I have to actually get their code sample working on the AVR. I was lazy :)
[17:14:09] <mrfrenzy> cool, which display is it?
[17:15:00] <drgreenthumb> http://www.newhavendisplay.com/nhd18128160tfctxi-p-4981.html
[17:15:45] <mrfrenzy> aah not too expensive for a color lcd
[17:15:46] <drgreenthumb> plus that little breakout board in the "recommend" on that page so I can prototype at 2.54mm :)
[17:16:22] <mrfrenzy> I'm looking for a small cheap monochrome
[17:16:50] <drgreenthumb> yeah and it's got a controller, I can just feed it when I want to. so it's nice for an 8 bit AVR
[17:16:59] <drgreenthumb> check newhaven's other categories. might be something you can use.
[17:17:22] <mrfrenzy> all too expensive
[17:17:36] <mrfrenzy> waiting for a quote from Capnkernel ;)
[17:17:43] <drgreenthumb> heh good plan
[17:18:20] <mrfrenzy> goodnight
[17:25:23] <Ahti333> i want to learn avr programming, is buying an arduino and not using the arduino library an option?
[17:27:08] <mrfrenzy> certainly
[17:27:30] <mrfrenzy> it's an excellent way to get a cheap dev board
[17:29:14] <Ahti333> and the arduino bootloader stuff will not stand in the way even if i want to try some assembler code?
[17:33:32] <drgreenthumb> heh newhaven sent a CDROM with that LCD. and the only thing on it is... the datasheet I've already been looking at for three weeks :P
[17:34:02] <drgreenthumb> what a waste of plastic.
[17:36:48] <iR0b0t1> Ahti333: It takes up some latent room, but not much
[17:38:48] <Ahti333> cool thanks iR0b0t1 mrfrenzy :)
[21:00:32] <drgreenthumb> bleh I seem to be completely unable to pull this active low line down low X_X DDRx=1, PORTx=0 that should be a ground, right?
[21:02:01] <drgreenthumb> tried quite a wide range of pullups 1.4k up to 54k. the damn line never goes low. blurg.
[21:02:29] <Tom_itx> pulldown?
[21:04:34] <drgreenthumb> hrm Tom_itx should I really need one? I have this other IC on this same circuit, some random ~5k pullup on it and asserting DDRx and PORTx like I mentioned seems to work. but on this other port/pin/device it doesn't I'm so confused.
[21:06:05] <drgreenthumb> this is just your normal active low chip select type circuit. done it bunches of times. why am I failing so bad this time?!! maybe this pin is reserved for something and I'm missing it.
[21:09:47] <Tom_itx> breadboarded?
[21:09:53] <drgreenthumb> yeah
[21:09:54] <Tom_itx> check that if so
[21:10:02] <drgreenthumb> maybe I should just use the internal pullup
[21:38:07] <drgreenthumb> heh and now I can't get another pin on that same port to go high with DDRx=1, PORTx=1. I think portc is forked.