Connect with us

ATMEGA16 USART problem

Discussion in 'Microcontrollers, Programming and IoT' started by [email protected], Jan 25, 2014.

  1. shahnawaz.inst@gmail.com

    [email protected]

    1
    0
    Jan 25, 2014
    Hi, i am using ATMEGA16 microcontroller with external crystal frequency 12 MHz. when i am running the code of USART, i does't get any data on hyperterminal, plz help me out..
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,174
    2,690
    Jan 21, 2010
    Are you using the arduino environment?

    Have you chosen or compiled a bootloader designed for 12MHz? I believe the code gets and uses the clock speed to set things like delays and UART settings. (I'd have to check that, but you do need to set things up correctly so the code knows the actual clock speed)
     
  3. Harald Kapp

    Harald Kapp Moderator Moderator

    9,137
    1,846
    Nov 17, 2011
    Welcome to the forum.

    We need more information to be able to help.
    Post the relevant sections of your code (Initialization of the µC and UART code)..
    Also show how you connect the ATmega to the PC (RxD TxD crossed?)
     
  4. OLIVE2222

    OLIVE2222

    690
    25
    Oct 2, 2011
    Hi,

    Also 12MHz don't allow all baudtrate check here:
    http://www.wormfood.net/avrbaudcalc.php
    Fuse bits must also be set for external crystal (not the default value if my memory serve me well).

    You can check the clock with a dumb 1 second interval led blink.

    Olivier
     
  5. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,174
    2,690
    Jan 21, 2010
    It might sound dumb, but In every project I build with a microcontroller I include at least 2 things:

    1) a programming header
    2) A LED controlled by the microcontroller.

    The first code I load simply flashes the LED. You'd be surprised how much it tests (Well, Olive2222 might not be)
     
  6. gorgon

    gorgon

    603
    23
    Jun 6, 2011
    I always design a project with an 'I'm alive' LED. If I have spare outputs, I always add a couple of status LEDs too.

    The LED output(s) can also be a stand in for a debug output. Good to have if you have a timing issue, or an interupt latency problem. Using a scope you can see everything from Serial fault codes to timing pulses.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-