Can't reprogram Trinket

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Can't reprogram Trinket

Post by dastels »

Quite possible. ISP is for low level programming. I've used it to burn the bootloader into black ATMega328 chips.

Dave

User avatar
dbetz
 
Posts: 49
Joined: Thu Jul 10, 2008 7:21 pm

Re: Can't reprogram Trinket

Post by dbetz »

I definitely must have trashed the bootloader since the red LED doesn't do anything when I press reset. How do I re-flash it? Just using the "Burn boot loader" option in the Arduino IDE doesn't seem to work.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Can't reprogram Trinket

Post by dastels »


User avatar
dbetz
 
Posts: 49
Joined: Thu Jul 10, 2008 7:21 pm

Re: Can't reprogram Trinket

Post by dbetz »

I saw that but I was hoping there was a way to do it with the AVRISP mkII directly rather than having to wire up an Arduino UNO. Surely an Atmel programmer can write the boot loader.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Can't reprogram Trinket

Post by dastels »

Agreed. I assume any ISCP programmer could.

Dave

User avatar
dbetz
 
Posts: 49
Joined: Thu Jul 10, 2008 7:21 pm

Re: Can't reprogram Trinket

Post by dbetz »

Is an ISCP programmer different from an ISP programmer?

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Can't reprogram Trinket

Post by dastels »

No.. and I have it wrong as well. It's an ICSP connector. In any case it's that 2x3 header on an Arduino UNO (and the like). SPI connector for low level programming.

Dave

User avatar
dbetz
 
Posts: 49
Joined: Thu Jul 10, 2008 7:21 pm

Re: Can't reprogram Trinket

Post by dbetz »

That's what the AVRISP mkII has. I'm going to see if I can find the source code for that Arduino app that flashes the boot loader to see if I can extract the boot loader code from it. Or maybe I'll just bite the bullet and dig out an Arduino to use the code as is. I'm a little confused about why the Arduino IDE overwrote the boot loader when I used it to program my sketch though. It should only have written to the application area.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Can't reprogram Trinket

Post by dastels »

The Trinket's bootloader isn't protect from overwriting... it's a pretty simplistic MCU. And ICSP is for flashing at thgat level... i.e. flashing the bootloader.

Dave

User avatar
dbetz
 
Posts: 49
Joined: Thu Jul 10, 2008 7:21 pm

Re: Can't reprogram Trinket

Post by dbetz »

I broke down and used an Arduino Uno to reflash the boot loader and I'm now able to use the AVRISP mkII to program new sketches into the Trinket. My ornament is now working and my Christmas tree is still up so there is still time to enjoy it. Thanks for your help! I've attached the code in case anyone is interested. It uses a 16 LED NeoPixel ring.
Attachments

[The extension ino has been deactivated and can no longer be displayed.]


User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Can't reprogram Trinket

Post by dastels »

That is great to hear!

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”