Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: SmAsH on January 02, 2010, 12:29:23 AM

Title: AVR ATmega "PEN" and "SS" pins.
Post by: SmAsH on January 02, 2010, 12:29:23 AM
Hi, i was looking at the pinout for some atmegas today 64 and 32 and i noticed two pins that confused me.
PEN pin one on the mega64 has a description in pin definitions:
Quote
This 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 is internally
pulled high. The pullup is shown in Figure 22 on page 52 and its value is given in Section
“DC Characteristics” on page 325. PEN has no function during normal operation.
What exactly does this mean? That i have to hold it low to program the device?
Also, i found this on avr freaks but it didn't quite set it out for me:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=340086 (http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=340086)

The other pin that confused me was "SS", pin ten on the mega64.
It had no definition in the pin description area... I have read around and found it may have something to do with I2c?

Any help would be greatly appreciated.
Title: Re: AVR ATmega "PEN" and "SS" pins.
Post by: sonictj on January 02, 2010, 02:59:16 AM
pen is on a few of the older ATmegas and as the guys in avrfreaks said it serves much the same purpose as the reset line.  When low the PEN line drives the atmega into the a reset and holds until a power cycle occurs.  The SS function is for the spi interface.  I believe it stands for slave select, and I think it is an input used to enable the atmega's spi interface when in slave mode.  The master device uses the ss pin to turn on the atmega.  By having a slave select line multiple slaves can comunicate to one master.  This is assuming that the slaves tristate miso when ss is high (look in the spi portion of the datasheet).     
Title: Re: AVR ATmega "PEN" and "SS" pins.
Post by: SmAsH on January 02, 2010, 03:11:03 AM
So, is it safe to leave it disconnected? Or connect it to the programmer header?
Title: Re: AVR ATmega "PEN" and "SS" pins.
Post by: airman00 on January 02, 2010, 10:51:06 AM
So, is it safe to leave it disconnected? Or connect it to the programmer header?
Treat it like the reset line and put a 10k pullup resistor
Title: Re: AVR ATmega "PEN" and "SS" pins.
Post by: SmAsH on January 02, 2010, 04:36:54 PM
Ok, thanks airman00 :)