Hi all, I know it's a German forum so sorry for the English post. I'm in the learning period of German I can read it roughly but can't write. Now I'm using atmega128 to do a project. Before the uC worked totally okay, however from this week it just stops working. I dont know what went wrong so I used a simple method to check it, by which I attached a LED to the I/O port. My circuit is truely simple, connect the PORTB.1 with a 470ohm resistor and the longer end of the LED, the shorter end of the LED was connected to the GND. I use 5V Vcc and JTAGICE. my program is like this: .INCLUDE "m128def.inc" .CSEG .ORG 0x00 RJMP main main: ldi r16, low(ramend) out spl, r16 ldi r16, high(ramend) out sph, r16 repeat: ldi r16,0x01 out ddrb,r16 ldi r16,0x01 out portb,r16 jmp repeat After all the uC didnt work any more, I was wondering if the microcontroller is broken. So I checked the voltage between Vcc and GND, and it is okay. So now I'm in no where. Could anyone tell me how to check if the microcontroller is broken? Dank!
Hi peekel, > connect the PORTB.1 -> Port B.1 > ldi r16,0x01 > out ddrb,r16 > ldi r16,0x01 > out portb,r16 -> This is Port B.0 Otto
Another good method is to put one PORT into output mode (using the DDR), and then give it some pattern like 0b10101010. Then just measure with a voltmeter, if you can see this pattern on the used port.
aha, hi, otto, thanks for the quick reply and pointing out the mistake. It is a writen mistake, I did connect it to the PORTB.0.
then try "Bernhard"s method - maybe only one pin is broken.... Otto
Thank Bernhard for the hint, I just did what u suggested, set the DDRB as 0xff, and PORTB as 0b10101010, and measure the voltage between each pin and GND, but I didnt see any pattern coming out, all the voltages stay constant which arounds zero.
hi, otto, the fuse is staying as it was before, I didnt change it. I think it should be no problem. Now I think I really have some problem with either the microcontroller or the JTAG, but dont know where to start to fix it.
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.