Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
RaceDriver205
PostPosted: Jul 22, 2007 - 07:45 AM
Hangaround


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
 
 View user's profile Send private message  
Reply with quote Back to top
microcarl
PostPosted: Jul 22, 2007 - 07:52 AM
Raving lunatic


Joined: May 30, 2004
Posts: 8506
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!!!
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
daqq
PostPosted: Jul 22, 2007 - 08:49 AM
Raving lunatic


Joined: Dec 15, 2003
Posts: 4417
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.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
peret
PostPosted: Jul 22, 2007 - 11:02 AM
Raving lunatic


Joined: May 26, 2004
Posts: 2542
Location: Las Vegas, Nevada

I believe it's to get into program mode after you burned the reset disable fuse.
 
 View user's profile Send private message  
Reply with quote Back to top
Jepael
PostPosted: Jul 22, 2007 - 11:04 AM
Raving lunatic


Joined: May 24, 2004
Posts: 6280
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
 
 View user's profile Send private message  
Reply with quote Back to top
microcarl
PostPosted: Jul 22, 2007 - 02:51 PM
Raving lunatic


Joined: May 30, 2004
Posts: 8506
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!!!
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits