#avr | Logs for 2014-09-12

Back
[10:14:07] <Bushman> ave
[10:14:33] <Bushman> i have a very common problem tho i can't seem to resolve it.
[10:14:56] <Bushman> i can't seem to programm atmega8 while atmega16 on other board works like a charm
[10:15:23] <Bushman> i've tried double and triplechecking the connections but i'm still not sure where the problem lies.
[10:15:27] <Bushman> any sugestions?
[10:15:39] <twnqx> stop telling your programmer you want to program an atmega16
[10:15:49] <Bushman> check!
[10:15:55] <Bushman> PS: avrdude: initialization failed, rc=-1
[10:16:25] <twnqx> sounds like a power supply problem, then
[10:16:41] <Bushman> twnqx: i have 2 separate makefiles for them and also tried manualy enter the command line
[10:17:05] <Bushman> power is connected from programmer and it is 5V
[10:17:34] <twnqx> then still something is wrong :P
[10:17:42] <twnqx> schematics available?
[10:18:07] <twnqx> tries flipping miso/mosi?
[10:18:09] <twnqx> tried*
[10:18:27] <Bushman> tried it.
[10:18:56] <Bushman> no schematic... it's a prototyping board and no aprication connected (plain mcu)
[10:54:54] <Bushman> i've used -F to override the check and got this output:
[10:54:59] <Bushman> avrdude: Device signature = 0xc8279a
[10:55:01] <Bushman> avrdude: Expected signature for ATmega8 is 1E 93 07
[10:55:30] <Bushman> i thought if there's problems with communication i'd get lots of 0xffff
[10:56:55] <Bushman> each invocation yealds random output...
[10:59:41] <twnqx> so you have a problem with the communication.
[11:14:51] <Bushman> yes. i've noticed.
[11:15:38] <Bushman> does atmega8 have something like disabling the reset pin?
[11:16:14] <Bushman> or what can be OTHER reasons than bad connection or wrong clock settings ?
[11:16:40] <Bushman> the programmer is working fine. tested with other mcu.
[11:21:36] <twnqx> well
[11:21:50] <twnqx> you could have put it to +5V directly, or using a too small pullup resistor
[11:22:14] <twnqx> you could have other (SPI) devices on the bus and not using pullup on the enable to deactivate it
[11:22:43] <twnqx> but hey, guessing is fun
[12:22:40] <Bushman> twnqx: it's plain mcu... there's nothing else on the prototyping board
[12:23:17] <Bushman> i gave up with this one... must be broken
[12:23:57] <Bushman> will give it one more try in parellel programmer at home. but for now i consider it fried.
[12:33:53] <twnqx> consider more bypass capacitors on it :P
[12:48:24] <Tom_itx> avrdude: initialization failed, rc=-1
[12:48:29] <Tom_itx> means it can't see the chip
[12:48:54] <Tom_itx> MISO MOSI backwards or no power or fried chip
[12:49:18] <Tom_itx> being a mega8, i'd fry it anyway
[12:52:24] <Bushman> heh
[12:52:54] <Bushman> well, power and miso/mosi were checked multiple times. i gave up.
[12:53:25] <Bushman> doing it on atmega16 for now, will try the code on 8 later when i'll get another one
[12:53:47] <Bushman> speaking of code... i've downloaded this example from internet:
[12:53:47] <Bushman> http://pastebin.com/YVH6Ma4r
[12:54:15] <Bushman> http://pastebin.com/7eeHSBuT
[12:54:33] <Bushman> i'm not quite sure what's happening there
[12:54:44] <Bushman> heh.
[12:55:52] <Bushman> #define RS485R_RE PC0 //Active Low Read Enable (for reading) used in DMX Receiver
[12:56:21] <Bushman> i'm not sure if it suppose to be read enable pin or just RX pin
[13:52:52] <Jartza> hah
[13:53:06] <Jartza> got my programmerboard to work
[13:53:20] <Jartza> not pretty though
[13:53:43] <Jartza> one zif socket and hell-of-a-lot of jumpers :)
[13:54:15] <Jartza> but it can now program all of these: http://tablica.qllp.pl/wp-content/uploads/2014/05/microcontroller-reference-sheet.png
[13:54:23] <Jartza> no more breadboard mess
[16:13:04] <Jartza> hmmh
[16:13:20] <Thrashbarg> hmm?
[16:13:25] <Jartza> silent :)
[16:13:31] <Thrashbarg> yes
[17:02:09] <megal0maniac> I'm really struggling to get my head around pin change interrupts
[17:02:09] <megal0maniac> I'm using an atmega328p
[17:02:09] <megal0maniac> There are PCINTs on most of the pins
[17:04:12] <jeremyabel> megal0maniac: what are your questions about it?
[17:06:33] <megal0maniac> Haha sorry. I had a 3 minute ping :/
[17:07:10] <megal0maniac> Will the ISR be triggered by any of the PCINT pins? Or is it maskable?
[17:08:11] <jeremyabel> it's maskable
[17:08:29] <jeremyabel> so like you have PCINTn_vect as the ISR vectors
[17:08:39] <jeremyabel> n being the number of whatever PCINT it is
[17:08:53] <jeremyabel> now the thing that got me about them is that PCINTs are on ANY pin change,
[17:09:01] <jeremyabel> and you can't specify rising or falling edge
[17:09:05] <jeremyabel> just any change will trigger it
[17:09:37] <jeremyabel> the 328 probably has 2 or 3 "external interrupts", marked as INT0-2, which you can specify rising or falling edge for
[17:09:39] <megal0maniac> Yip. INTn you can select, I remember that one
[17:10:01] <jeremyabel> which kinda pisses me off
[17:10:23] <jeremyabel> I'm using the 324P right now and it put two of them on TX/RX lines
[17:10:43] <jeremyabel> and since I'm using both those lines, bam I don't get the interrupts anymore
[17:10:56] <megal0maniac> Haha oh dear
[17:10:59] <megal0maniac> xmega? :P
[17:11:06] <jeremyabel> nah, just 8-bit
[17:11:08] <jeremyabel> low-power
[17:11:13] <megal0maniac> Yeah, but you could use xmega
[17:11:19] <jeremyabel> I could, yeah
[17:11:27] <megal0maniac> also 8-bit, low-power. And interrupts for daaaaaays
[17:11:35] <jeremyabel> eh, I worked around it
[17:11:42] <megal0maniac> Okay I think I found the section I was wondering about
[17:11:45] <jeremyabel> too late to change at this point :P
[17:11:48] <megal0maniac> And couldn't find
[17:11:56] <jeremyabel> board is already in production
[17:12:28] <jeremyabel> yeah there's like two registers you have to set or clear or whatever to enable PCINT on whatever pin
[17:12:46] <jeremyabel> (I forget what exactly they are)
[17:13:29] <megal0maniac> PCICR and PCMSK
[17:13:40] <jeremyabel> yeah that
[17:13:46] <megal0maniac> \o/
[17:13:57] <megal0maniac> Thanks for clarifying :)
[17:14:04] <jeremyabel> np
[17:15:58] <jeremyabel> yeah I had some stuff set up on PCINTs and then I found out that I didn't get to pick rising or falling edges and was like FFFFFFFF and had to rethink some stuff
[17:17:35] <megal0maniac> An if statement should do it, though? It'll only be 1 cycle behind the interrupt source
[17:18:35] <megal0maniac> Wow. I'm getting a crapton of bounce
[17:18:50] <megal0maniac> Which is okay, though. I'll just put a delay in the ISR :P
[17:19:25] <jeremyabel> yeah I had to do a lot of debounce stuff
[17:20:07] <jeremyabel> then I switched to the normal INT0 thing and my standard debounce circuit and it worked perfectly
[17:21:10] <megal0maniac> Hmmm... It isn't bounce. Any idea why it would fire twice?
[17:21:11] <N1njaneer> Hi megal0maniac!
[17:21:16] <megal0maniac> N1njaneer: Hello!
[17:21:29] <megal0maniac> (am pasting code)
[17:21:59] <N1njaneer> megal0maniac: Do you have the ISR set up to trigger just on one edge, or on any transition?
[17:22:11] <jeremyabel> yeah it'll fire on both edges
[17:22:17] <jeremyabel> N1njaneer: he's using PCINTs
[17:22:22] <N1njaneer> (just came back to my desk, so haven't read scrollback)
[17:22:40] <megal0maniac> N1njaneer: It's PCINT, so it's any change
[17:23:13] <N1njaneer> megal0maniac: Have you specifically checked the state of the pin in the ISR to make sure it's only firing when high or low, and returning otherwise, etc?
[17:23:31] <N1njaneer> If you push and hold the button without releasing does it only fire once?
[17:24:01] <megal0maniac> It's a snippet, and I do know that delays in an ISR are a bad idea, but it's crude debounce
[17:24:04] <megal0maniac> http://pastebin.com/YHTR47Yy
[17:25:08] <megal0maniac> I think I just need to clear the flag
[17:25:09] <twnqx> well
[17:25:12] <N1njaneer> megal0maniac: Something else you can do to be more efficient - set up one of the timers to count in ms or such, then when your ISR fires you can cache the value of the timer, then check on subsequent ISRs to see if enough time has elapsed, else reject.
[17:25:17] <twnqx> what state but high or low could a pin have? :D
[17:25:27] <twnqx> (that would be readable)
[17:25:40] <megal0maniac> Sidenote: I had a polygraph today
[17:26:02] <jeremyabel> oh dang
[17:26:04] <jeremyabel> what for?
[17:26:15] <N1njaneer> megal0maniac: What AVR? 328?
[17:26:31] <megal0maniac> N1njaneer: 328p, yeah. Seems the flag is cleared automatically
[17:26:37] <megal0maniac> jeremyabel: A job interview
[17:26:42] <twnqx> O_O
[17:26:45] <jeremyabel> whoa
[17:26:47] <jeremyabel> wtf job?!
[17:26:48] <megal0maniac> Right?
[17:26:59] <jeremyabel> government job?
[17:27:00] <N1njaneer> megal0maniac: Security clearances?
[18:57:49] -hobana.freenode.net:#avr- *** Notice -- TS for #avr changed from 1410562092 to 1164523365
[18:57:50] hobana.freenode.net changed topic of #avr to: http://www.avrbeginners.net http://tom-itx.ddns01.com:81/~webpage/index.php http://www.avrfreaks.net ENCOURAGE PEOPLE OR WE WILL SQUASH YOU, REALLY!
[18:58:16] <megal0maniac> Silly freenode
[18:58:16] <jeremyabel> srsly
[18:58:16] <jeremyabel> it's tripping balls right now
[20:50:29] -morgan.freenode.net:#avr- [freenode-info] why register and identify? your IRC nick is how people know you. http://freenode.net/faq.shtml#nicksetup