9S08 + digital pot internally?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

9S08 + digital pot internally?

2,951 Views
irob
Contributor V
Anyone have any digital potentiometer ideas for the 9S08? I've got a very small board with not much room for an external digital pot. Wondered if there's a slick way to vary output impedance on a port pin. Hmmm.
Labels (1)
0 Kudos
Reply
3 Replies

572 Views
rocco
Senior Contributor II
Hi, Rob:

Are you talking about the impedance to ground? Will a PWM approach work? Will a regular PWM voltage output not work?

I don't know which chip you are using or what you're interfacing to, but if the standard PWM does not get you what you electrically need (varying impedance), you could try modulating the pin impedance in a very crude fashion.

When a pin is an input, it has a very high impedance. When a pin outputs a zero, it has a very low impedance to ground. If the device won't mind the impedance varying between the two extremes in a modulated fashion, you could bit bang the duty cycle.

By putting a zero in the pin's data register and modulating the pin's direction register, you could effect an 'average' impedance over time. You could solicit the help of a timer to bit-bang it, but it may not be very fast.

If you need to vary the impedance to Vcc, simply change the zero in the pin's data register to a one.
0 Kudos
Reply

572 Views
irob
Contributor V
I asked the vendor of the chip I'm interfacing to about PWM and they said it was risky (coupling PWM noise into their circuitry). So I guess I'll stick with a tiny 8-pin Microchip DAC.

Thanks for the feedback.
0 Kudos
Reply

572 Views
Truk
Contributor I
why don't you use PWM + a cheap Tiny OpAmp + RC at +INP?
On the same way I made 4-20mA Current Outputs.
Truk
 
0 Kudos
Reply