Society of Robots - Robot Forum

Software => Software => Topic started by: corrado33 on July 16, 2011, 06:56:58 AM

Title: How to safely (and correctly) use the RESET pin as an I/O pin?
Post by: corrado33 on July 16, 2011, 06:56:58 AM
What are the dangers of doing this?  On the two MCUs I'm looking at right now, you simply change a fuse to have the reset pin function as a RESET pin, or as an I/O pin.

Will I still be able to program it?  What won't I be able to do?  Will I be able to change the fuse back once I change it to I/O?  

EDIT:  So I mustered up the guts to actually program the fuse to make the reset pin into an I/O pin and.......


AvrStudio showed me a popup saying that it'd be impossible to program it if I did so.  So I didn't.   :D

So, that makes me wonder, how else is there to program chips without an ISP programmer?  I think it's time for me to look into bootloading....
Title: Re: How to safely (and correctly) use the RESET pin as an I/O pin?
Post by: waltr on July 16, 2011, 04:17:37 PM
Which processor?
On PICs this works fine and the PIC can easily be re-programmed.
Title: Re: How to safely (and correctly) use the RESET pin as an I/O pin?
Post by: corrado33 on July 16, 2011, 05:35:44 PM
ATTiny4313

Doesn't the ISP programmer use the reset pin to tell the MCU it's ready to be programmed or something?
Title: Re: How to safely (and correctly) use the RESET pin as an I/O pin?
Post by: joe61 on July 16, 2011, 08:11:12 PM
The atmel chips can be recovered as well, but you need something like the STK500 board, and high voltage programming to reset things.

It's probably easier to get a chip with more pins.

Joe
Title: Re: How to safely (and correctly) use the RESET pin as an I/O pin?
Post by: Ro-Bot-X on July 17, 2011, 05:32:12 AM
You can build your own high voltage programmer if you have an Arduino:

http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/ (http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/)

or just get the shield, plug your 4313 and burn!
http://mightyohm.com/blog/products/hv-rescue-shield-2-x/ (http://mightyohm.com/blog/products/hv-rescue-shield-2-x/)
Title: Re: How to safely (and correctly) use the RESET pin as an I/O pin?
Post by: corrado33 on July 17, 2011, 07:58:15 AM
I haven't programmed the fuse YET, so I'm not in any trouble as is.  

I worked around the issue right now, but it would be nice to get this to work.  I have to find the thread started by admin where he was talking about his bootloader and the reset pin, but I think webbot replied and said that your bootloader will work however you want it to work, even by monitoring a UART line to know when it's supposed to be programmed.  Since my board is going to have UART, SPI, and TWI  pins available I think this would be a good idea.  (Or I could just not use one of the communication protocols and use one of those I/O pins).

Like I said, I've worked around it for now, so we'll see what I end up doing.

Here's the link to the thread and conversation between admin and webbot.  I've linked you directly to the post where admin poses the question of whether or not the reset pin is actually needed to program.
http://www.societyofrobots.com/robotforum/index.php?topic=2467.msg16878#msg16878 (http://www.societyofrobots.com/robotforum/index.php?topic=2467.msg16878#msg16878)