I need some help (newbie) starting a program that continuously displays a value sampled from the A/D input terminal through a UART in hexadecimal. How would I start my code (using C for Atmega644) ?
Once you have got the ADC converted result inside the AVR, you can change it into hexidecimal and then send it out via the USART. For the USART part, look at this tutorial:
Thanks! That's really helpful. So, if I don't want to include high/low LED's and just want to continuously display the value, will this work? (without the UART Part)
Thanks! That's really helpful. So, if I don't want to include high/low LED's and just want to continuously display the value, will this work? (without the UART Part)
The above setting depends on the MCU clock speed you are using and is good for 16MHz only. If you use a lower frequency crystal or MCU's internal oscillator, then you have to make adjustment to keep the ADC clock within 50~200KHz by choosing suitable divisor ratio.
One common mistake is there is an exit on the MAIN program which it shouldn't. Add an infinite loop statement so that it is the last code statement in the Main.