Sometimes when you’re designing electronic circuit boards especially on a budget it’s easy to cut corners and only put the very bare essentials into the board. But the folks at Adafruit Industries make quality inexpensive products and they never cut corners. Case in point is there new ATtiny85 development boards the Adafruit Trinket and Adafruit Gemma. Other boards using the ATtiny85 require you to physically unplug and re-plug their boards every time you want to load a new sketch. On the other hand Adafruit included a reset button and they broke out the reset line on one of the breakout pins. For most people that’s probably not a big deal but for someone with a disability with myself, the inability to physically plug and unplug the board is a dealbreaker. Thanks to Adafruit including this reset breakout I was able to use another microcontroller namely an Arduino Uno to toggle the reset for me and allow me to use the board despite my disability. Here is a demo video I created for the weekly Adafruit Show-and-Tell.
Here is a code used on the Arduino Uno to toggle the pin 5 low for 1/10 of a second
//Sends reset signal from Arduino to
//Adafruit trinket by pulsing the reset line
//low for 1/10 of a second
int reset_pin = 5;
void setup() {
pinMode(reset_pin, OUTPUT);
digitalWrite(reset_pin, HIGH);
delay(100);
digitalWrite(reset_pin, LOW);
delay(100);
digitalWrite(reset_pin, HIGH);
}
void loop() {
}
Here is the code that you load onto the trinket so that it will blink a particular pattern. That verifies that you successfully uploaded.
//Modified trinket blink sketch
int led = 1; // blink pin 1 the built in red LED
void setup() {
pinMode(led, OUTPUT);
}
void Signal (char N,int T) {
for(int i=0;i
Here is the Adafruit Show-and-Tell from September 21, 2013 where I demonstrated this project.
Thanks for the tip.
My project is based on a trinket, accelerometer and a 5-way button and I want people to upload new programs to the device.
Using this technique on the same board is actually a great way to insure end users don’t hold the reset button down for more than 10 seconds and fry the bootloader. (read fewer tech support calls and returns)
I’m going to count when the middle button is held down x seconds and then send your reset code.
Thanks again
Keep in mind I’m using two different Arduinos. A trinket and an Uno. The Uno resets the trinket. I’m not sure what would happen if you tried to get the trinket to reboot itself. That might be problematic.
On the other hand Adafruit included a reset button and they broke out the reset line on one of the breakout pins. For most people that’s probably not a big deal but for someone with a disability with myself, the inability to physically plug and unplug the board is a dealbreaker.
what do you mean in that? you can’t just simply push the reset button located in the 5v adafruit trinket? and you used arduino uno yo do that for you? Sorry I cant understand that. I really need to reset my trinket pls help me out
I have a physical disability which means that I have little or no use of my hands. 99.9% of what I do is using dictation software on my PC. So I cannot physically push the reset button the way an able-bodied person can. However I can use the voice control of my computer to command the Arduino Uno to send a reset signal to the trinket.
This issue however is pretty much moot because it only applies to the original trinket. The newer M0 trinkets do not have to be manually reset in order to upload a new program. When using an M0 trinkets with Circuit Python you can simply drag-and-drop your program onto the board because it appears to operate like a flash drive. Or if programming using the Arduino IDE it has a boot loader that works like traditional Arduino boards. It was only the original 8-bit trinket that had this particular problem of requiring a reset in order to upload new code.