avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] PEN on atmega128


From: Torsten Mohr
Subject: Re: [avr-gcc-list] PEN on atmega128
Date: Sat, 4 Jun 2005 23:54:25 +0200
User-agent: KMail/1.8

Hi,

> > >From the datasheet:
> >
> > "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."
>
> Well! I am not too sure about the PEN pin. The same confused me too. I
> think in certain situations it may be needed but i have not had the
> need for it. I have left the pin floating in my system's design and it
> all works fine.

i wonder if anybody ever successfully used an ATMega128?  I always
assumed that.

Has anything changed in the specs?

Does anybody else experience problems with this chip?

Regarding PEN, as it is not on the programming connector i think
it just has to be either low or high, but can not be changed during
programming, right?

I found out that after disconnecting the power i can do exactly one
step of either:

- erase
- program
- verify

Now i got the problem that the program does not do what i
expect it to do:


int main(void) {
  volatile unsigned int i;
  volatile unsigned char p = 0;

  WDTCR = 0x1f;
  WDTCR = 0x00;

  DDRD = 0xFF;
  PORTD = 0x0f;

  DDRB = 0xFF;
  PORTB = 0x0f;

  do {
    PORTB = p++;

    //    while (PINB & 0x01);

    //    for(i = 0; i < 100; i++);

  } while(1);

  return 0;
}

Is there an obvious error in it?  I can't see the pattern 0x0f on Port D
and all pins on Port B are near 0 V.

I don't see a difference, the pins look always the same, even when
reset is activated and also when not.

There is no external crystal soldered on the board, it should start and
run anyway, right?


Best regards,
Torsten.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]