Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Mega128 apparently losing programming

2009-09-23 by Emerson Santos

Hi people ...

I´m a newbie in AVR USART , and i have a problem that i can understand.. I
make a code below

...

#asm("SEI");

main
while (1)
      {

       WR_SERIAL(0x04);

      };
}

....


unsigned char WR_SERIAL(unsigned char dado)
{

      if (!(UCSRA & (1<<UDRE)) )
        {
          return;
        }

       UDR = dado;


}

interrupt [USART_TXC] void usart_tx_isr(void)
{
 OK=~OK;
 for(;;);
}

...

Yes, is a ingenous and simple code, the usart is set in 4800, no parity, 8
bits ... etc etc

My problem is that the interruption is working if i run my program with JTAG
e AVRSTUdio (I run in a ATmega32) in steoping mode... but out the AVRStudio
.. nothing happening the TX is working all time and not have a stop that i
like.

I read the DS and the thing really is like the DS , but works only in the
AStudio ...

Thanks for any help and sorry for my bad english :)

Emerson


[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.