Discussion forum for the BasicX family of microcontroller chips.
|
Thank everybody for your answers, I am building my project with Basicx-24 microcontroller and one Serial 2x16 LCD. This microcontroller has been working well, but I have a big problem with the AD convertion. I have used GetADC(integer version) and GetADC(Float version) funtions, to convert analog to digital signal. But neither GetADC (integer version) nor GetADC(Float Version) funtions return to the real value. for instance when I imput 4.2 Volt to pin 18 the out put is 1023 and this is not real since it should be 879, the ground to the voltage I am reading is common with the Basicx-24 ground. The voltage input to the Basicx-24 is 7.9 V and the voltage measured in the pin 21 is 5.05 V. PLEASE ADVISE ME WHAT THE PROMEM IS, AND WHAT I SHOULD DO. ...............LOOKING FORWARD TO RECEIVING PROMPT RESPONSE.............................YIWY |
|
|
|
> ... when I input 4.2 Volt to pin 18 the output is 1023... Is pin 18 configured for input? If it is set to either Pullup or 1, you'll see fullscale from the ADC. Tom Becker --... ...-- www.RighTime.com The RighTime Clock Company, Inc., Cape Coral, Florida USA +1239 540 5700 |
|
|
|
Thank a lot for prompt reply, Mr Tom Becker, in the library saids, "the funtions GetADC(float version) and GetADC(integer version)do not need a separate call to configure the pin to input mode". Do you think I shuold configure the pin first?, and what is that funtion? looking forwars to hearing from you......Yiwy --- Tom Becker <> ha scritto: --------------------------------- > ... when I input 4.2 Volt to pin 18 the output is 1023... Is pin 18 configured for input? If it is set to either Pullup or 1, you'll see fullscale from the ADC. Tom Becker --... ...-- www.RighTime.com The RighTime Clock Company, Inc., Cape Coral, Florida USA +1239 540 5700 Yahoo! Groups Sponsor Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ______________________________________________________________________ Yahoo! Mail: 6MB di spazio gratuito, 30MB per i tuoi allegati, l'antivirus, il filtro Anti-spam http://it.yahoo.com/mail_it/foot/?http://it.mail.yahoo.com/ |
|
|
|
> ... Do you think I shuold configure the pin first?, and what is that funtion? Try Call PutPin(bxPin18, bxInputTristate) or Call PutPin(18,2) before the first ADC conversion. Tom Becker --... ...-- www.RighTime.com The RighTime Clock Company, Inc., Cape Coral, Florida USA +1239 540 5700 |