Reprogramming Trinket Pro 5V using Trinket Pro 5V?

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
erikledding
 
Posts: 2
Joined: Thu Jan 09, 2025 5:57 pm

Reprogramming Trinket Pro 5V using Trinket Pro 5V?

Post by erikledding »

I have a handful of Trinket Pro 5Vs that all but one have non-functional bootloaders (no red LED activity at all), so I thought I'd try to reprogram the bootloaders on the defective boards using the good board. Instructions say to use an Uno, but I only have Trinket Pros. The only wiring difference was connecting the two VBUS (USB 5V bus) pins together, as the good board was being powered from a 2A capable USB power supply.

It fails, sadly. I've tried 3 boards so far and am thinking either that the instructions weren't kidding when they said to use a true Uno, or these are majorly defective Trinket Pros. Here's what I get when I click "G" in the Serial Monitor to start the programming:

Code: Select all

Starting Program Mode [OK]

Reading signature:950F
Searching for image...
  Found "trinket_5V_2015_03_17.hex" for atmega328

Setting fuses
  Set Lock Fuse to: 3F -> E000  Set Low Fuse to: FF -> A000  Set High Fuse to: D0 -> A800  Set Ext Fuse to: 5 -> A400
Verifying fuses...
	Lock Fuse: 3F is 3F	Low Fuse: 0xFF is 0x62Failed to verify fuses
So, is this issue due to simply using the Trinket Pro 5V to reprogram the bootloader on a 2nd Trinket Pro 5V, did I make simple error, or is there something else going on here?

Thanks,
Erik

User avatar
adafruit_support_mike
 
Posts: 68178
Joined: Thu Feb 11, 2010 2:51 pm

Re: Reprogramming Trinket Pro 5V using Trinket Pro 5V?

Post by adafruit_support_mike »

Yeah, you need to borrow the Arduino's USB-to-Serial converter to convert the signals that come from the computer to something the ATmega328 can understand.

The good news is that USB-to-Serial converters are far more common than they used to be. This one is only about six bucks:

https://www.adafruit.com/product/5335

User avatar
erikledding
 
Posts: 2
Joined: Thu Jan 09, 2025 5:57 pm

Re: Reprogramming Trinket Pro 5V using Trinket Pro 5V?

Post by erikledding »

Thanks for responding! But I'm confused though.

I was using a serial adapter that converts the TTL levels to RS232 voltages through a DB9 connector, then used a USB to DB9 serial adapter on my laptop. That's how I got the console display.

But the PC isn't doing the programming, is it? The data to program the flash is in the images.cpp file in the constant named "image_328", yes? Is that supposed to come from the PC somehow? I was thinking that was being put on the "programmer" Arduino.

User avatar
adafruit_support_mike
 
Posts: 68178
Joined: Thu Feb 11, 2010 2:51 pm

Re: Reprogramming Trinket Pro 5V using Trinket Pro 5V?

Post by adafruit_support_mike »

erikledding wrote: Fri Jan 10, 2025 7:11 pm But the PC isn't doing the programming, is it? The data to program the flash is in the images.cpp file in the constant named "image_328", yes?
Ah.. you're using the SPI based direct programmer.

That code does put the whole workload on the Arduino, turning it into an in-system programmer capable of generating signals that write data directly to a bare ATmega328's Flash array through the SPI pins.

A Pro Trinket can run the code and should be able to program another ATmega328 in general.

The error message says it wasn't able to change the fuse bits, which is likely to be a signal or voltage problem. The good news is that you're getting default values for the chip, which suggests the microcontroller is still working correctly.

It's hard to guess the exact problem without getting more information about the signals.

Post Reply
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”