MK312BT-Can you use USB-AVR to program the ATMEGA?


Is there way of using a USB-AVR programmer to load the patched firmware onto the ATMEGA
I’ve gone through the process of downloading the ET312 firmware and applying the patches - do I use the m005.bin file that the process creates or the .upg file or something else ?


You’ll have to use the .bin file.
If you’re going to use the BT module, temporarily flash the BT setup firmware first.


Thanks I think I’ve sorted the basic flashing now and the fuses - when I now power up the unit the display says Failure Mode 21 Shut off Power !
This suggests the PIC must be running ok to drive the display etc - what does mode 21 mean???


It’s not a PIC, it’s an ATMEGA, but yes, it’s probably ok. Have you reconnected the battery and removed the ICSP cable yet? According to the ET312 manual, the error you mentioned has to do with the power supply.


Have connected the battery - ICSP removed
Getting failure mode 21 when connected to the mains power supply
Getting failure mode 20 when running off the battery


By way of an experiment I have connected a 12V DC Model Railway transformer across the battery terminals with the mains disconnected.
The 312 then boots up and am getting stim from Channel A ok.
This suggest the battery isn’t charged and there is a problem somewhere in the charging circuit/mains power feed.
Thoughts ?


I think I would check if there are any shorted pins first.
You could also try to charge the battery with an external charger.


Battery is now charged - same problem
Have started a new thread - as the original USB-AVR programming problem is now solved if you don’t want to use and Arduino/avrdude method.