What to do with PEN?

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What should I with a PEN pin on the Mega128? I can program it with a PEN on 1, I can program it with PEN equal zero. I'm using the ISP. I put it on VCC in the board design. Through a 10k pullup resistor.

Is it just a decorational pin?

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

See page 7

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I've seen what it's supposed to do, but:
I:
1. Power up the device with PEN on +5V.
2. Succesfully program the device with a ponyprog ISP.
3. Think a moment about why it worked.

I do this a moment later:
1. Power up the device with PEN on GND.
2. Succesfully program the device with a ponyprog ISP.
3. Think a moment about why it worked again, and what's the PEN for...

Quote from the datasheet:

Quote:
PEN is a programming enable pin for the SPI Serial Programming mode. By holding this
pin low during a Power-on Reset, the device will enter the SPI Serial Programming
mode. PEN has no function during normal operation.

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From our experience:

"Just say no!" to hooking up PEN--let it float.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"float"? Page 7 says it's internally pulled up ;-)

(which brings me back to my previous post)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

"float"? Page 7 says it's internally pulled up

OK, unconnected.

When we did our first Mega64 design, we tried to tie it and it caused problems--no matter which way it was wrong. Allowing it to remain unconnected dosn't interfere with ISP or normal operation, and doesn't seem to hurt noise immunity & similar.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is the following explination on page 305 in the Mega128 datasheet.

Just realize that, unlike RESET, PEN muse be released after programming and, power must be physically cycled to release the controller from the PEN derived reset condition.

Just leave PEN floating and use the standard ISP programing.

See page 50 for a block diagram of the PEN pin and how it relates to the rest of the RESET circutry.

Attachment(s): 

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is what people used to write with before they invented the computer :D

Sorry, couldn't resist!

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Koshchi: I think I have one of those! But I coulndn't find the input, nor the output...
;-)

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daqq wrote:
Koshchi: I think I have one of those! But I coulndn't find the input, nor the output...
;-)

Simple!!! Push the button on one end and drag the other end on a piece of paper. The ink just flows out on to the paper.

OMG!!! It's magic!

Seriously...

Have a look at the STK501 schematics. They'll show you the correct usage ot the PEN pin on the Mega64 & Mega128.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston