| Author |
Message |
|
|
Posted: Jul 22, 2007 - 07:45 AM |
|

Joined: Dec 08, 2006
Posts: 142
|
|
I just wanted to check I have this right. If I leave the PEN pin permanently connected to ground, will the device just program as normal? Or will it cause problems if I reset the device when im not programming it?
Thanks |
|
|
| |
|
|
|
|
|
Posted: Jul 22, 2007 - 07:52 AM |
|


Joined: May 30, 2004
Posts: 8141
Location: Cincinnati, Ohio
|
|
If you leave PEN connected to GND, you will go into RESET and never get out as, it takes a power cycle to get out of the PEN RESET.
It has an internal pull-up resistor so, just leave PEN disconnected. |
_________________ Carl W. Livingston, KC5OTL
microcarl@roadrunner.com
"There are only two ways to sleep well at night... be ignorant or be prepared."
The original Dragon Slayer !
Long live the AVR!!!
|
| |
|
|
|
|
|
Posted: Jul 22, 2007 - 08:49 AM |
|


Joined: Dec 15, 2003
Posts: 4412
Location: Slovakia, Bratislava
|
|
| I never actually understood the point of the PEN pin. The programmer works fine even with the pin unconnected, when grounded it dies. What's its purpose? |
_________________ There are pointy haired bald people.
Time flies when you have a bad prescaler selected.
|
| |
|
|
|
|
|
Posted: Jul 22, 2007 - 11:02 AM |
|


Joined: May 26, 2004
Posts: 2538
Location: Las Vegas, Nevada
|
|
| I believe it's to get into program mode after you burned the reset disable fuse. |
|
|
| |
|
|
|
|
|
Posted: Jul 22, 2007 - 11:04 AM |
|

Joined: May 24, 2004
Posts: 6028
Location: Tampere, Finland
|
|
The purpose of the PEN pin is to go into programming mode when RESET pin cannot be used for this for some reason.
One reason I can think of is that the ISP programmer hardware cannot guarantee the SCK (or whatever) pin is in correct state when the RESET is driven low (or high, whatever).
So basically, if I have understood this correctly, the ISP header on the Mega64 board would have the PEN signal instead of the RESET signal, and it would work. This way the RESET signal can be driven with something else, or it can be unused, and connected directly to VCC.
So for normal operation, PEN should be left disconnected (it has a weak pull-up), pulled up externally (I use 1k), or connected to VCC. So PEN connected directly to GND is definitely wrong.
- Jani |
|
|
| |
|
|
|
|
|
Posted: Jul 22, 2007 - 02:51 PM |
|


Joined: May 30, 2004
Posts: 8141
Location: Cincinnati, Ohio
|
|
|
Jepael wrote:
The purpose of the PEN pin is to go into programming mode when RESET pin cannot be used for this for some reason.
- Jani
As the PEN RESET is latched within the controller, I think it's more to keep the controller in reset during programming as, the ISP/JTAG may release the normal RESET during some operation, premature to SCK, MIOS or MOSI coming to completion.
Just remember, if PEN RESET is used to put the controller into a RESET state, the controller power MUST be cycled to release that controller from the RESET state. |
_________________ Carl W. Livingston, KC5OTL
microcarl@roadrunner.com
"There are only two ways to sleep well at night... be ignorant or be prepared."
The original Dragon Slayer !
Long live the AVR!!!
|
| |
|
|
|
|
|