This may be slightly off topic because I'm not specifically trying to produce a MiniPOV, but I am trying to program an ATTiny2313, using the instructions from http://www.ladyada.net/learn/avr/
, and the example test_leds.hex file in the tutorial is part of the MiniPOV firmware...
I'm using a USBasp programmer, an ATTiny2313, and I don't really have any components attached except for the microcontroller itself on a breadboard.
First I just tried to write the sample test_leds.hex file (http://www.ladyada.net/learn/avr/test_leds.hex
) from the tutorial directly to the microcontroller (not compiling, burning the downloaded .hex file straight to the chip). No problems, I plugged in an LED to port B0 to see it running, and no problems from what I could tell. It did seem to be running really slow, as I thought the .c file showed 200 ms in between each LED, but I was still happy that I could see the LED turning off and on where I expected it to.
Then I used the source code from the MiniPOV set (http://www.ladyada.net/media/minipov2/minipov2%20firmware.zip
) as a basis for my makefile and c file, so I would have an idea of how to start. I made the necessary changes in the makefile for my programmer and port, and then I changed DDRB to DDRD, changing the main loop to go between port D6 and all ports off. I was just trying to get the one LED to blink by itself, instead of cycling through all the ports. I compiled it and wrote it to the chip. All I could get was a solid LED, no blinking, and I used basically the same code. Then I noticed that it was solid on all of the D ports, even though there was no code specifying those ports.
I went back to the original test_leds source code and makefile, compiled and wrote it to the chip, and it was doing the same thing on all of the B ports; all solid, not cycling through.
I tried the downloaded .hex file again, and it was fine.
The first thing that comes to mind is that I have my fuses set wrong, but I set mine from the calculator (http://www.engbedded.com/fusecalc/
, using the 8MHz clock, and 14 CK + 65 ms as the start-up time), and I'm pretty sure that the makefile from the MiniPOV source sets the lfuse. Where am I going wrong?
Sorry for such a long post, and thank you in advance!