I use ATTINY10 to read sensor data from I2C that leaves me with RESET PIN and 4th pin to drive bicolor or bipolar LED. I upload my code using TPI signal generated from Arduino Uno. Here is the code for LED.
` #define LED_PIN_RED 3 // Pin connected to the red color of the bipolar LED (PB4 pin on ATtiny10) #define LED_PIN_GREEN 2 // Pin connected to the green color of the bipolar LED (PB6 pin on ATtiny10)
void setup() {
pinMode(LED_PIN_RED, OUTPUT); // Set the LED pin as output
pinMode(LED_PIN_GREEN, OUTPUT); // Set the LED pin as output
}
void loop() {
// Turn on red color
digitalWrite(LED_PIN_RED, HIGH);
digitalWrite(LED_PIN_GREEN, LOW);
delay(1000); // Wait for 1 second
// Turn on green color
digitalWrite(LED_PIN_RED, LOW);
digitalWrite(LED_PIN_GREEN, HIGH);
delay(1000); // Wait for 1 second
}
`
When I connect LEDs (2 normal leds) like (reset)--|>--GND and (pin4)--|>--GND, only the led in the pin4 pulses. Reset pin LED does not pulse just lights up the led weakly. When I connect between reset and pin4 LED lights up weak and also pulses.
I have to make reset pin pulse somehow, atleast maybe I can drive a transistor. I cant find the point im missing.
It's not something I've done but only read about, but I think that in order to use the reset pin as an output, you may need to change one of the fuse settings whilst programming the chip.
The problem then, from what I read, is that you can't reprogram the chip again without needing a high voltage programmer to reset the fuse - which then enables you to program the chip again.
I cannot afford to do that right now, I have only one microcontroller and no access to high voltage programmer. So therefore I have to know if I can somehow make this pin on and off. I can solve my issue with a transistor if I could manage to make this pin off somehow.
After that you cannot program it again (without applying 12V to the reset pin). Also the reset pin can drive 1.8mA max, because it needs to survive 12V when using a HV programmer. See 15.3.1 of the datasheet.
So what programmer DO you have access to? IIRC, high voltage programming on the TPI-programmed devices is pretty simple - it may be sufficient to simply attach a 12V power supply (say, one of those tiny 12V batteries used in some keyfobs (type A23)) to the RESET pin during the programming (although, I might not risk that, if I only had one. High danger of hitting some other pin and blowing up the chip.))
I have used this method, generated TPI signals with Arduino UNO. Do you have any source for the method you are talking about? Is there any way to set the fuse on the reset pin back to normal?
I was curious so decided to disable reset on one of my Attiny10 chips after loading your sketch.
The most difficult part was to find out that I had to go back from Avrdudess V2.17 (avrdude V7.3) to Avrdudess V2.14 (avrdude V7.0) because the newer version introduced a bug making it impossible to program the single fuse it only has.
But after that worked, your sketch also worked 100% . Two alternating blinking leds.
Now I need to rig up a 12V source to my Attiny10 without blowing up the USBASP programmer that I use with it.
I can confirm that by connecting a 12V to the RST pin your Attiny10 can be programmed again and/or you can set the fuses. As long as the 12V is applied it will stay in TPI programming mode regardless of the setting of RSTDISBL.