Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pic 16f88 reading a potentiometer

Status
Not open for further replies.

limlik

New Member
How should I connect it, and what is the code for reading a potentiometer using a Pic 16f88? I am programming with Asm I have most everything else I need planned out besides this. Also can you explain your method as well? Please and Thank you.
 
You would normally use the supply voltage and ground as the positive and negative voltage references, and they would also be the ends of the potentiometer. The wiper of the potentiometer is should be connected to the analog input of the 16F88. A capacitor from the wiper to ground is a good idea.

The code needs to enable the correct input, wait for a few microseconds (the acquisition time) and then start the conversion. After the conversion time, the "Done" bit is set and the A/D result can be read from ADRESH and ADRESL
 
This wouldn't restrict me to one Pot right? I just need to check one and get the value and the check the other?
 
Yes, that's what you do. There is only one A/D converter but it only takes microseconds to make a reading, so you can read as many as you want so fast that it will appear instantaneous compared to how fast a mechanical pot can move.
 
Status
Not open for further replies.

Latest threads

Back
Top