Hi.
I'm trying to implement an external reset on the xmega. I want to reset the device when pressing the reset button but I dont knwo how to check if reset button is pressed or how does the device know that!
Here is my reset button on pin 90 of xmega.
Xmega128a1 external reset
Reset is handled in ATxmega128A1 hardware. Drive the pin low and it will reset. (Assuming you haven't programmed the reset disable fuse.)
Are you using a PDI programmer?
If so, DON'T use the above circuit, as the PDI programmer won't work, or will work very unreliably.
One can often put a small cap on the reset pin an a Mega, or Tiny, and many ISP programmers will work.
On the Xmega the impedance on the two programming pins as to be equal. Putting a resistor and a cap on one pin makes them very unequal.
If this is for a simple push button switch, pressed by a person, just connect the (normally open) push button switch from the reset pin to ground. Press to reset.
It may bounce a bit, which (generally) doesn't matter.
If another chip is resetting the Xmega, then the signal goes low to reset the Xmega. This circuitry can be a bit more involved so that it doesn't interfere with the programmer.
JC
Im using JTAG (mk II). I also want the reset button to be activated when I hold it down for 10 seconds. Is that possible to program?
Im using JTAG (mk II). I also want the reset button to be activated when I hold it down for 10 seconds. Is that possible to program?
I think the "easiest" way to do that is to put a push button switch on a normal I/O pin, (with the internal pull up resistor active).
Using either a "normal" switch debouncing routine, or an ISR set up specifically to read this switch, when it has been pressed for 10 Sec then execute a watch dog timeout to reset the micro.
The Xmega has priority interrupts, so one could make this a high level priority, if needed.
The bottom line is you don't use the Reset\ Pin to implement this function.
JC