Microcontroller › AVR › looping problem in ATmega16 › Hi Shashank,For all
June 18, 2013 at 1:23 pm
#9979
Participant
Hi Shashank,
For all microcontroller codes there should be an infinite loop at the end of the main function like the following
int main(void)
{
unsigned int c=5;
USART_Init();
while(c)
{
usart_putch(usart_getch());
c–;
}
while (1)
{
;
}
}
Which all keys in the keyboard are you pressing to send data to the microcontroller? If you press keys like ENTER key, they will send two characters at a time and hence you will feel that you missed one loop.