ADC with ATMEGA32

General discussion on mikroBasic for AVR.
Post Reply
Author
Message
joprinz
Posts: 8
Joined: 04 Apr 2008 14:25

ADC with ATMEGA32

#1 Post by joprinz » 20 Apr 2008 11:51

My project is about 75% done. My Thanks to The MikroElektronika Team :D

However I have hit a new issue. My project requires voltages to be measured. I tried using the ADC Library using a POT across the VCC n GND but somehow I am only getting a "0" as output. I would like to know if My circuit is missing something or is my code alright???

My Setup:

ATMEGA32
1MHz
VCC = 5V
POT = 1K
GLCD for display

Code: Select all

 program TESTADC
dim data as word
       text as string[7]
main:
Glcd_Set_Font(font5x8, 5, 8, 32)
Glcd_Init(PORTC, 0, 1, 2, 3, 5, 4, PORTD)
   while true
    data=Adc_Read(0)
    WordToStr(data, text)
    Delay_ms(10)
    Glcd_Write_Text(text,0,0,1 )
  wend
end.
Circuit Diagram:
Image

Please Advice.

Thank You!

Southern Bear
Posts: 15
Joined: 04 Jul 2007 05:22
Location: Crimea

#2 Post by Southern Bear » 24 Apr 2008 06:12

Simulation in Proteus not always gives expected result. In iron execution this example normally works.

Post Reply

Return to “mikroBasic for AVR General”