EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / Hi Shashank,For all

Hi Shashank,For all

|

Microcontroller › AVR › looping problem in ATmega16 › Hi Shashank,For all

June 18, 2013 at 1:23 pm #9979
AJISH ALFRED
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.

RSS Recent Posts

  • Measuring controller current output with a meter December 12, 2025
  • What is involved to convert a small town to fiber optic? December 12, 2025
  • Droplet1 December 12, 2025
  • Help to Identify capacitor fault December 12, 2025
  • Dog fence help December 12, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise