View Full Version : Using an output to generate a variable resistance

11-02-2010, 04:08 AM
I've got a display chip that I'm using a 10K pot to ground to control display intensity. At 10K the display is very dim. At zero resistance the display is at full intensity. I still have to check the open circuit voltage on the pin of the driver but I'm wondering if I can set the duty cycle of a PWM object driving a Propeller output pin so that the display driver sees the sinking part of the Propeller output pin duty cycle as a variable resistance to ground. The chip itself only has dim and bright settings available through its serial port. If the current is too high, I have a lot of Propeller pins left over so I might be able to bridge them together to get under net current sinking limits. If I can make it work it gives me software intensity control. If the voltage on the driver is higher I may need a zener in there to protect the Prop pin at low display intensity. The driver chip has to have Vdd at 5 volts to drive the display but accepts 3.3 volts just fine for clock, enable, and data.

11-02-2010, 04:27 AM
Try it and see.
The only caveat would be to use a transistor instead of going directly from the pin.

11-02-2010, 05:30 AM
I don't know what your electrical current requirements are, but have you considered using a digital potentiometer?

This one is fairly easy to use, but check your current requirements, etc.


Peter Jakacki
11-02-2010, 08:49 AM
I've got a display chip that I'm using a 10K pot to ground to control display intensity. <snip>

If it is anything like the standard character displays then all they are expecting is a bias voltage which could be set via a resistor but what I do is simply feed a 220R resistor + 100nF cap combo from a duty-cycle output (this only needs a counter, not a cog). Most of the time for character displays the bias voltage is around 0.5V. The 220R could easily be higher like 1K even.

Just a tip but next time just mention what you are trying to do (like "vary LCD contrast") and include the details of the hardware rather than trying to ask for a solution to "variable resistance". As you can see you will get the right answer to the wrong question.

11-03-2010, 02:29 AM
I measured the open circuit voltage on pin 8 of my MC14489s. I got 4.3 volts, to high for a prop pin directly. I tried to measure current drain and didn't get a reading. I just did the third shift-second shift rotation so after I'm back on daze tomorrow its time to replace the fuses in my current meters. With the green 4x7 segment displays I can run pin 8 straight to ground without the MC14489 over heating. (the green ones take a higher drive voltage) Whether I can get away with that next July in Phoenix while the instrumentation is installed in my parked car remains to be seen. Thanks for the link to a controllable pot. Sound like a go. A new serial device to play with, WoooHooooo :) ! BTW, I didn't get a hit in the OBEX for this chip. What category would a drive object for it fall into? Yeh Peter, I should get modern and step up to the latest displays but there is just so much of the old stuff out there going for a song.

11-03-2010, 04:26 AM
... BTW, I didn't get a hit in the OBEX for this chip. What category would a drive object for it fall into? ...

If you're talking about the AD5220, it basically has only three control pins you might need to worry about. There's a "chip select" (CS) pin which just allows the chip to respond to any inputs. Probably this can be hardwired so the chip is always able to respond to inputs. The CS pin is mostly used by people who want to control multiple AD5220 chips at a time. But if you're only going to use one AD5220, then you really only have to worry about two control pins. There's the U/D pin which drives the pot up or down in resistance. And then there's the Clock pin which basically tells the chip how many increments to move either up or down the "wiper" of the pot. It's pretty simple to just command a couple of Prop pins to go high or low to drive those two control pins, so I doubt you'd need a full-blown Object to work with this chip.

There is another digital pot chip, which seems to have an object already on the OBEX, but I don't have any experience with it:

http://obex.parallax.com/objects/search/?q=digital+pot&csrfmiddlewaretoken=44df2659315c07da2e75b5aa3d205c c4

11-03-2010, 05:04 AM
Wow, cool. If you see the sun come up while your playing with the Propeller on your days off.........you may be a prop-head. Is there a 12-step program for prop-heads yet?

11-03-2010, 01:07 PM
...Is there a 12-step program for prop-heads yet?

There's Hanno's 12 blocks program. http://12blocks.com/
But that might just add to your addiction. :)

11-03-2010, 03:54 PM
We use a I2C 10K Digi-Pot to control the brightness of the backlight.

11-03-2010, 04:14 PM
any electronic circuit is not really interested in a resistance. It is interested
in a voltage or a current. Of course voltage, current and resistance are a
triple that are always together.

As you could not measure a significant current I guess the LCDisplay wants to have a voltage (and just a very small current of 0,1mA or even only
some ľA).

This can easily be done with a RC-filter.

Prop-IO-Pin-----R--x-> LCDisplay-contrast-pin

The prop-pin will be configured as output and is doing PWM
Through the RC-filter the PWM will be transformed into an analog voltage.
This analog voltage is proportional to the duty-cycle of the PWM.

If you really need 4.3V you would add an OPAmp (like the LM358) with a slight amplification to amplify 3.3V up to 4.3V

best regards


Phil Pilgrim (PhiPi)
11-03-2010, 04:20 PM
I think this could be done with a single external MOSFET (e.g. 2N7000). Although the '7000 has a higher than ideal gate voltage requirement, given the Prop's 3.3V output, it's not being asked to sink much current, so that should not be an issue. Just drive the gate through a 220R resistor with a DUTY-mode output from the Prop. Anyway, it's worth a try to see what happens. (You will likely not get a linear taper, but that can be solved with a lookup table.)


11-03-2010, 09:32 PM
I like the AD5220- some have up to 6 digi-pots per chip.
I'll chime in on the subject of LCD panels. 12Blocks supports HD44780 LCDs: print text/values, goto, scrolling and even "fading" the contrast. This is a cool effect where the LCD slowly fades to a new contrast setting. I use a counter to pwm the LCD's contrast pin.

11-05-2010, 04:19 PM
The nice thing about the AD5258 is that it has split power supplies. You can run the logic supply off the propellers 3.3 volts and the potentiometer off 5 volts.

It is a good idea to keep the noisy devices in your systems on a separate supply. Our led backlight can draw over 350ma and the little inverter runs at 700 Khz.