Struggling with the same issues I found this in the data sheet
--------- data sheet page 304 ----------
To program and verify the ATmega128 in the SPI Serial Programming mode, the following
sequence is recommended (See four byte instruction formats in Table 145):
1. Power-up sequence:
Apply power between VCC and GND while RESET and SCK are set to "0". In
some systems, the programmer can not guarantee that SCK is held low during
power-up. In this case, RESET must be given a positive pulse of at least two
CPU clock cycles duration after SCK has been set to "0".
As an alternative to using the RESET signal, PEN can be held low during Poweron
Reset while SCK is set to "0". In this case, only the PEN value at Power-on
Reset is important. If the programmer cannot guarantee that SCK is held low
during power-up, the PEN method cannot be used. The device must be powered
down in order to commence normal operation when using this method.
2. Wait for at least 20 ms and enable SPI Serial Programming by sending the Programming
Enable serial instruction to pin MOSI.
---- end of data sheet ----
Not that I am actually trying to do all the pin manipulation myself I am using avrdude which I assume is doing this. I am just trying to figure out why my ability to program the chip has stopped.
-----Original Message-----From: Lasse Madsen [mailto:lasse.madsen@elektronik.dk]
Sent: Sunday, December 12, 2004 7:12 PM
To: AVR-Chat@yahoogroups.com
Subject: RE: [AVR-Chat] Re: /PEN pin on ATMEGA128 (2)
Hi Ridho,
Tie PEN to your supply (high) no need for a series resistor that’s just a waist of money…
The company I worked for had around 150.000 pieces of a product running all around the globe at the moment in all sorts of environments and it hasn’t failed so far with the PEN being tied high directly and using only SPI for programming.
PEN stand for Parallel Programming Enable if you’re not going to use this FORGET ABOUT IT! Tie it high and don’t listen to what the others say…
I know for a fact that it works when its high… our production numbers speaks its own language.
Regards
Lasse Madsen
From: Ridho
Alpha [mailto:pendekar_ridho@yahoo.com]
Sent: 13. december 2004 00:44
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: /PEN pin on
ATMEGA128 (2)
so....i am now using SPI programming using In-System Programming and i use external reset.......so, i have to tie this /PEN pin to the ground????is it true????
Yahoo! Messenger - Communicate
instantly..."Ping" your friends today! Download Messenger
Now