BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 8:25 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: reading analog voltage using basic atom pro
PostPosted: Wed Jun 29, 2011 3:14 am 
Offline
Citizen

Joined: Wed Jun 29, 2011 2:29 am
Posts: 21
I wanted to read analog voltage(0-5v) using basic atom pro ..used the following program..

temp var word
main
adin p0,temp
serout s_out,i9600,[0,"analog voltage= ",dec temp]
pause 10
goto main

I used ADIN cmd..this one will give 1024 positions. so GND=0 AND 5V=1023
but it is giving same output as 1023 for all voltage b/w 0 and 5v
why it is not giving correct position value according to the voltage..? is there anything wrong with the program?
can anyone plz help me..


Top
 Profile  
 
 Post subject: Re: reading analog voltage using basic atom pro
PostPosted: Wed Jun 29, 2011 9:02 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Which AtomPro are you using? Also can you describe your wiring? Are you using a devboard? What is supplying the analog voltage(sensor,POT)?

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: reading analog voltage using basic atom pro
PostPosted: Wed Jun 29, 2011 9:47 am 
Offline
Citizen

Joined: Wed Jun 29, 2011 2:29 am
Posts: 21
Acidtech wrote:
Which AtomPro are you using? Also can you describe your wiring? Are you using a devboard? What is supplying the analog voltage(sensor,POT)?



I'm using basic atom pro 40..and devboard also..
i have given analog voltage to the pin p0 using POT..


Top
 Profile  
 
 Post subject: Re: reading analog voltage using basic atom pro
PostPosted: Thu Jun 30, 2011 10:03 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
1. checked the actual voltage at P0 with a multimeter
2. please try another pin
3. make sure the chip selection drop down is set to Auto, or AtomPro40.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: reading analog voltage using basic atom pro
PostPosted: Fri Jul 01, 2011 3:02 am 
Offline
Citizen

Joined: Wed Jun 29, 2011 2:29 am
Posts: 21
[quote="Acidtech"]1. checked the actual voltage at P0 with a multimeter
2. please try another pin
3. make sure the chip selection drop down is set to Auto, or AtomPro40.[/quo

thank you.. problem is with the p0 voltage. voltage at p0 is different..
This might happened due to loose wiring connections.
now i have checked all the connections and voltage at p0 also..it is giving output as
1v=294
2v=570
3v=860
4v=1023
5v=1023
i tried with other pins and got the same o/p as above..
why it is giving 1023 positions for 4v?


Top
 Profile  
 
 Post subject: Re: reading analog voltage using basic atom pro
PostPosted: Fri Jul 01, 2011 10:15 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Hmm. This usually indicates you are not on the pin it is actually reading, just one that is near by. Inductive/Capacitive coupling(can't remember which causes it) is why nearby floating pins will see voltage changes when a pin near by is changing it's voltage.

What version of Studio are you using? You should be using the latest version(2.0.0.14). If you aren't uninstall Studio and install 2.0.0.14.

Also, assuming you are already using the latest Studio, manually select AtomPro40 instead of Auto in the drop down. This will garuntee it is using the AtomPro40 pin mappings and we can see what happens from there.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: reading analog voltage using basic atom pro
PostPosted: Sun Jul 03, 2011 10:05 pm 
Offline
Citizen

Joined: Wed Jun 29, 2011 2:29 am
Posts: 21
Acidtech wrote:
Hmm. This usually indicates you are not on the pin it is actually reading, just one that is near by. Inductive/Capacitive coupling(can't remember which causes it) is why nearby floating pins will see voltage changes when a pin near by is changing it's voltage.

What version of Studio are you using? You should be using the latest version(2.0.0.14). If you aren't uninstall Studio and install 2.0.0.14.

Also, assuming you are already using the latest Studio, manually select AtomPro40 instead of Auto in the drop down. This will garuntee it is using the AtomPro40 pin mappings and we can see what happens from there.



I'm using 2.0.0.8 version.I unstalled that one and installed 2.0.0.14 version.
I have given the voltage to pin p0 and trying to read the voltage from that pin.But still it is giving the same o/p as i said earlier.


Top
 Profile  
 
 Post subject: Re: reading analog voltage using basic atom pro
PostPosted: Mon Jul 04, 2011 12:37 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
WHat is your exact circuit for the pot producing the voltage? Also what brand of pot. I've got some pots that don't go to ground, which could explain why yours isn't. Not sure why it is getting to 1023 before it should. Can you check the Vdd pin on the module and make sure it is aty 5v and not 4v. If it is at 4v that would explain the early reading.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: reading analog voltage using basic atom pro
PostPosted: Mon Aug 01, 2011 4:35 am 
Offline
Citizen

Joined: Wed Jun 29, 2011 2:29 am
Posts: 21
Acidtech wrote:
WHat is your exact circuit for the pot producing the voltage? Also what brand of pot. I've got some pots that don't go to ground, which could explain why yours isn't. Not sure why it is getting to 1023 before it should. Can you check the Vdd pin on the module and make sure it is aty 5v and not 4v. If it is at 4v that would explain the early reading.



Thank you for guiding me. I found out the problem with your help.
Actually circuit is generating a square wave of amplitude 0-5v. I have checked out the voltage at vdd pin,it is 3.7v approximately. I have given 5v power supply to the development kit (and to my circuit also as it needs strictly 5v). but dev kit has 7805 regulator included in it which regultes 5v to 3.7v. After increasing power supply to 6v,
BAP is giving the exact reading.


Last bumped by mini on Mon Aug 01, 2011 4:35 am.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO