PDA

View Full Version : Controlling A Digital Pot



TonyA
- 26th April 2006, 19:52
Hi,

I was wondering if someone could refer me to a basic schematic and code for controlling a digital pot with the pic. I am using the pic18F452 with pbp 2.46


Thanks for any help.

Tony

mister_e
- 26th April 2006, 22:59
Any plan on your digital pot? Microchipone or else... it will be handy for us to know at least the pot you want to play with...

TonyA
- 26th April 2006, 23:50
Hi,

I am thinking about using MCP41100-I/P IC
http://www.jameco.com/wcsstore/Jameco/Products/ProdDS/241787MCH.pdf

What I'd like to do is control the digital pot with the pic. The pic will be interfaced with an analog sensor, the pic will read the sensor (using ADCIN) and based on the the result of the sensor the pic will respond by making changes to the digital pot.

What I'm wondering is how to get the code going. I guess it would start like this:

ADCIN sensor input pin, result
result = digital pot control

mister_e
- 27th April 2006, 04:15
As my hands can't place anything on a board now, i'll just give you some tips ... typing on a keyboard is hard enough:

You'll need 3 I/O (CS,SCK,SI)
Read the datasheet Section 5.0 (Few Microchips datasheet are fairly well explain, that's one of those. Really easy)
PBP manual under the SHIFTOUT statement.

No specific schematic, plug and play. Just check the POT limitation first about max current and all the plah plah plah and you shouldn't have too much problem.

Ioannis
- 27th April 2006, 09:15
Also take into account that a digital pot never reaches absolute zero. Always do show a minimum resistance. If you can tolerate it then go use it.

Ioannis

TonyA
- 27th April 2006, 20:07
Thanks. So this would be using the Serial port of the digital pot?

Thanks again,
Tony

Ioannis
- 27th April 2006, 20:49
The pots usually have SPI bus not really RS232 serial but ... serial too!

You have to read the datasheet (as always...) for the device to be used.

Ioannis

TonyA
- 27th April 2006, 21:30
Thank you.