Hey all,
As the title says, I'm running into trouble on my build here. The board is completely put together, all ICs seated properly, etc, and yet, powering it on will produce intermittent results. Those tend to be: light every LED and keep them lit for some period of time in the rage of 30+ seconds and then light only one odd LED afterwards, light no LED whatsoever, or light a subset of LEDs. Futherrmore, there's no activity at all on the OLED.
What I've done so far:
Flash AVR with bootloader hex file.
Build .BIN file and copied that to SD card.
Reflow solder around IC1 socket.
Take out each IC, verify correctness and orientation and reseat.
Verify orientation of each resistor network.
Verify correct voltage (4.9ish) and no continuity between +5VDC and ground at AVR ISP test point.
I'm at a loss at this point.. Anyone have any suggestions or ideas? I can post pictures if necessary.
Thanks in advance
Comments
Is there a way to reset the firmware? Of should it be re-written (even after a bad or interrupted write) anytime I hold the encoder down while powering on?
If it is self sourced, are you shure you have flashed the bootloader on the AVR properly?
Normally when powering on while holding the encoder down, these messages from the bootloader are shown on the OLED:
- "Bootloader v1.2"
- "SD Card OK"
- "updating... (1/2)"
- "updating... (2/2)"
- "success! please reboot..."
And during the update process the step LEDs are showing the progress.
The OLED is completely dead, not even so much as a blip during power on. Also, I'm still seeing issues where all the LEDs might be lit, none may be lit, or some may be lit. For each case, I definitely have 4.9V at the TP to the right of IC1.
gobinau$ avrdude -p atmega644 -c usbtiny -U flash:w:Downloads/SD_Card.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9609
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "Downloads/SD_Card.hex"
avrdude: input file Downloads/SD_Card.hex auto detected as Intel Hex
avrdude: writing flash (65146 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 65146 bytes of flash written
avrdude: verifying flash memory against Downloads/SD_Card.hex:
avrdude: load data flash data from input file Downloads/SD_Card.hex:
avrdude: input file Downloads/SD_Card.hex auto detected as Intel Hex
avrdude: input file Downloads/SD_Card.hex contains 65146 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 65146 bytes of flash verified
avrdude: safemode: Fuses OK (H:FF, E:99, L:62)
avrdude done. Thank you.
first of all.
you only flash the bootloader to the avr.
this will not activate any LEDs or the display.
it is possible that the leds light up, but this is random due to the state of the shift registers.
when you hold down the encoder while powering up the device you should see the bootloader message on the OLED.
this should even work without the attached mainboard, since it all uses only the avr.
your encoder is soldered correct, too? otherwise you can't start the bootloader.
you also have to set some of the fuse bits. I use the following avrdude commands:
# set fuses
avrdude -B100 -c usbasp -p m644 -U lfuse:w:0xff:m -U hfuse:w:0xd8:m -U efuse:w:0xfc:m
# flash bootloader
avrdude -B1 -c usbasp -p m644 -U flash:w:SD_Card.hex:i
# lock bootloader - BLB1 Mode 2 = SPM is not allowed to write to the Boot Loader Section
avrdude -B1 -c usbasp -p m644 -U lock:w:0x2F:m
could as well be left off
the thing about the fuses is that it sets the clock source to external.
otherwise the AVR will only run at 1MHz with the internal clock instead of the 20MHz external quarz.
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
Ugh... it appears that after running that first command I can't flash the chip at all anymore, even with the force flag set:
avrdude -B1 -c usbtiny -p m644 -U flash:w:SD_Card.hex:i -F
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000 (retrying)
avrdude: Device signature = 0x000000 (retrying)
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATmega644 is 1E 96 09
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude done. Thank you.
The project is described in detail at http://www.paulinthelab.com/2013/12/mp3-headphone-amplifier-tda2822m.html
http://www.engbedded.com/fusecalc
just enter the hig,low and extended hex values at the bottom of the page.
in short:
- disable clock div 8
- change internal clock to external quarz
- enable brown out detection 4.3v
- enable bootloader section in flash
I don't know the usb tiny.
but can you set the speed of the tiny somewhere.
with old avr dude versions you have to set a slow/fast jumper depending on the clock settings of the avr.
but normaly this is only neccessary for the initital fuses, when the avr is too slow for fast programming due to the internal clock. does it work with -b100 instead of b1? (this sets the programming speed)
try removing the SD card while prgramming.
My USBasp has no problems with it, but I don't know the tiny.
the SD card shares the SPI pins with the ISP.
You even mentioned it yourself in your first post (voltage test) :-)