PSA: Flashing blank chip on brand new control board

I just took an interesting journey and wanted to share here in case it helps anybody in the future.

Background: This is my first time doing anything more complicated than playing with Arduino. I sourced the Shruthi board and a pre-flashed MCU from a local (US) supplier and sourced all of the components myself from Digikey and Mouser. Tonight I just got the control board to the point of the first test where I power it on and check for led’s 3 & 7. Much to my dismay, all the LEDs were lit and no amount of knob turning or button pushing changed that.

I spent a few hours reviewing my soldering and testing for continuity and voltages at pins based on suggestions here in the forum. Everything looked ok (at least from my beginner perspective). As a last resort, I decided to try reflashing the chip. I had bought a spare MCU with my parts order just in case, so I swapped that in and, not to my surprise, all LEDs were lit just like on the ‘preflashed’ chip.

I happen to have a AVRISP mkII from long ago and plugged it into my usb-c port of my relatively new MacBookPro and ran ‘make bake all’. Here is what I saw:

avrdude: usbdev_open(): did not find any USB device "usb"

There’s not a lot about troubleshooting this error on a current mac. I expected I needed to better identify my usb device port, because on the Arduino IDE, I see it listed as /dev/cu.usbmodem14501. But I couldn’t figure out what the AVR programmer port was when it was plugged in. When I did a ls /dev, it wasn’t listed.

Finally, on a whim, I tried using the more current avrdude from my Arduino install and I got some life:

 $ /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrd
ude -C /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -p m644p -c avrispmkII

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e960a (probably m644p)

avrdude: safemode: Fuses OK (E:FF, H:99, L:62)

avrdude done.  Thank you.

This looked promising - at least it wasn’t complaining about the usb port.

After some messing around with the Shruthi arvlib/makefile.mk, I eventually made this change on line 69:

AVRDUDE = $(AVRDUDE_LATEST_PATH)avrdude -C $(AVRDUDE_LATEST_PATH)avrdude.conf

and defined:

AVRDUDE_LATEST_PATH ?= ~/.platformio/packages/tool-avrdude/

to take advantage of my platformio installation which has the latest versions of the avr toolchain including avrdude.

and BOOM, I saw the code being uploaded to the chip and even better - LEDs 3 & 7 were lit.

So - hopefully if somebody else gets into this same situation, this post will help them out in the future.

Tomorrow - solder the LED and begin the filter board…

1 Like

PS - if nothing helps - i sell pre-proged Atmegas for Shruthi / XT and Ambika .
www.tubeohm.com
Greets
Andre’