PDA

View Full Version : Newbie needs help with POT...



greenflight
- 28th August 2007, 01:39
Hey guys, don't mean to be a bother with stupid questions, but I'm just getting started in PB and I want to get some code working.

I'm working with a 16F628A running 20 mHz. I'm working on building a simple PWM motor controller that links the position of a pot to the HPWM duty cycle (if anybody has any code already written up for something like this, a link would be awesome).

Anyway (this is probably the 1000th time or so that you've heard this), I'm looking for the best way to read the pot. I'm mainly looking at using the POT command, but I'm unsure what to use for the SCALE value. Is there a chart of some sort comparing pot values to scale values?

Any help would be greatly appreciated. Thanks!

GrandPa
- 28th August 2007, 05:34
If your chip as ADC, then you should have a look at PBP ADCIN command.

J-P

Acetronics2
- 28th August 2007, 20:04
Hi,

It exists one chart !!!

The book is " Basic Stamp " from C.Kühnel and K. Zahnert ... Newnes publications. ( results are the same w/PbP ...)

The "Optimum" setting is Scale @ 53 ... that gives a 200 units scale ( NOT 255 !!! , you'll never have 255 steps !!! )

Now, there is a bad non linearity hard to avoid ...


Soooooo, RCTime is MUCH,MUCH,MUCH better to use ... and an ADC is THE Linear solution !!!

Alain

PS: I've forgotten POT exists for about ... 10 years !!!

greenflight
- 29th August 2007, 01:39
Thanks guys. Don't know much about ADC, so I'll start reading up on it. Sounds like it's the way to go.