Go Down

Topic: Yay! I screwed up the DDRD register! :( (Read 1 time) previous topic - next topic

baum

So I wanted to use a 7-segment display with direct port manipulation, and since portD (pins 0-7) is the only port with all 8 pins available, I decided to use it. I set all 8 pins to outputs:
Code: [Select]
DDRD = B11111111 (my first mistake)
Now of course this would disable serial communication, I thought I could hold reset while uploading (that was my second mistake).

Odd thing is, my code never uploaded at all. I get the stk-500 not repsoning.... error:
Code: [Select]
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0
avrdude: stk500_getsync(): not in sync: resp=0x39
avrdude: ser_drain(): read error: Device not configured


But since code never uploaded, why is the DDRD register set????

What should I do to get back serial communiction?

Thanks!
baum

JChristensen

#1
Jun 24, 2011, 03:18 am Last Edit: Jun 24, 2011, 03:47 am by Jack Christensen Reason: 1
Are you saying that the code that had DDRD = B11111111 in it never uploaded?
How do you know that DDRD is set to all ones?
The DDRs initialize to all zeroes.  If cycling power doesn't help, then something else must be going on.  Your line of code does nothing permanent.  Actually, a reset is sufficient.

baum

Don't know what went wrong... now it works.

Go Up