Problem re-flashing original 40h kit firmware - help much appreciated

I seem to have bricked my original 40h kit monome - or at least rendered it non-functioning.

The kit was working fine but I’d noticed it was a bit laggy with some led updates (particularly when using the launchd app in terms), and (perhaps wrongly) assumed that a slightly fresher 40h firmware than the original would make an improvement.

I grabbed the 40h kit firmware from https://github.com/monome/40h

Connected my JTAG ICE clone to the JTAG port on the 40h logic board and ran the following command:

avrdude -p m32 -c jtag1 -P /dev/tty.Repleo-CH341-000013FD -V -v -F -e -u -U flash:w:40h.hex -U lfuse:w:0xee:m -U hfuse:w:0x00:m

Everything seems to write ok (reports 3006 bytes written, and fuses write correctly).
I found that if I didn’t use the -V option to prevent automatic verification, then the command would fail with errors trying to read back from the chip.

Likewise, I needed to use -u to force the writing of the fuses, otherwise it seemed that avrdude would set them back to defaults.

When I disconnect the JTAG programmer and connect the 40h back in, I get no test pattern lighting up on the grid, and although I can select the 40h as a device in serialosc, with the original device ID (m40h0504), no key presses are detected and no leds can be lit up, so I’m assuming I broken something badly.

I’ve checked things like fuses being correct:

avrdude -p m32 -c jtag1 -P /dev/tty.Repleo-CH341-000013FD -v -U lfuse:r:-:r -U hfuse:r:-:r | hexdump

gives me:

avrdude: safemode: lfuse reads as EE
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK (H:FF, E:00, L:EE)

avrdude done. Thank you.

0000000 ee 00

(Note that the last line is the output of the hexdump, which seems to confirm that the fuses are set correctly, even though the last line of the safemode output from avrdude indicates the fuses are not correct).

I’m hoping that there’s something basic that I’ve missed, as from what I understand it’s hard to get the old ATMEGA32 chips now, so if I’ve actually bricked the chip, that will be painful…

I know this is all somewhat ancient history now, so maybe there’s not many folk maintaining a 40h, but any advice much appreciated!

i might have a replacement 40h logic board-- e-mail info@monome.org

it’s been 8 years since i’ve messed with JTAG on the 40h, so if the github makefile isn’t helping, i’m not sure what i’d try next. i didn’t realize atmega32 chips were rare?

Thanks tehn,

I’m going to have another go with a better JTAG programmer - if I’m still stuck I’ll drop you a line re: picking up a spare board.

I was wrong about atmega32’s being rare - I misinterpreted someone else’s comment about them rarely being used compared to newer AVR’s. I ordered a spare one with the JTAG programmer. Cost all of $12.

The github makefile is no problem. Others have posted translations of the avarice to avrdude commands and that’s matched with what I’ve worked out from a bit of RTFM’ing.

I’m hopeful of reviving the 40h - i can honestly say building that kit encouraged me into a bunch of building and exploring on the hardware side that hasn’t stopped - still lots to learn but the monome journey has taken me deeper than any but of off the shelf gear, which is why I’m still using the 40h however many years later.

That curiosity perhaps led me to tinker when I might have been better off leaving it working as is, but I’m learning something nonetheless.

Will post back here with whatever I learn in fixing things up. Thanks again for the support and inspiration.

and there was much rejoicing…

used a better AVR programmer today (Atmel AVRDragon) and the firmware uploaded with no issues and the 40h was alive again.

I’m guessing that my cheap eBay JTAG programmer had just enough chops to erase the ATMEGA32, but was too flaky to correctly upload the firmware - so good old buyer beware strikes again. At least I now have a reliable AVR programmer for any non-arduino AVR projects I embark on…

just for the record, in case anyone else needs to do this in future, the specific avrdude command line I used was:

avrdude -p m32 -c dragon_jtag -u -v -e -U flash:w:40h.hex -U lfuse:w:0xee:m -U hfuse:w:0x00:m

this is documented elsewhere, but I always like a “it was broken but now I fixed it” thread that finishes with the details of the fix :smile:

great to hear!

for anyone else, i highly recommend the pololu isp: https://www.pololu.com/product/1300

it’s the fastest and most reliable programmer i’ve used-- and i’ve tried tons of them.

@chailight
hi, I have the same problem like you wrote here:
I get no test pattern lighting up on the grid, and although I can select the 40h as a device in serialosc, with the original device ID (m40h0205), no key presses are detected and no leds can be lit up, so I’m assuming I broken something badly.
Please, I have a AVR programmer.
Please can you write me instruction for connecting the programmer and logic board of monome?
Can I use terminal for refreshing monome?

hardware and firmware are here:

likelihood that something more is wrong than just the firmware suddenly got erased

also, there’s only a JTAG header for programming, an ISP won’t work

@chailight
can you write me which programmer, the model, what worked in the programming ATmega32 of the monome 40h?

Hi @dariocasillo - I used an ATMEL AVR DRAGON (www.atmel.com/avrdragon). I had tried a cheap $10 JTAG programmed I got off eBay, and that didn’t work, but the Dragon was fine.

the command line I used is posted in the thread above.

cheers,

Mark

@chailight
Did YOU have USED 10pin cable (jtag) OR 6pin cable with adapter to ten FOR connecting ATAVRDRAGON ATMEL And monome logic board?

I’m pretty sure I used a standard 10 pin jtag cable - I know I had to double check the orientation of the cable to be sure I had it plugged in the right way both ends. You need to check which pin is marked as 1 on the PCB so that you have the red stripe of the cable next to pin 1 on both ends.

On my AVRDragon I think pin 9 is marked on the PCB so if I recall correctly pin 1 is on the opposite end of the same row of pins.

Best if you check diagrams for all this as explaining in words is bound to be confusing.

Go well!