Using an output to generate a variable resistance
yarisboy
Posts: 245
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.
Comments
The only caveat would be to use a transistor instead of going directly from the pin.
This one is fairly easy to use, but check your current requirements, etc.
http://www.analog.com/static/imported-files/Data_Sheets/AD5220.pdf
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.
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=44df2659315c07da2e75b5aa3d205cc4
There's Hanno's 12 blocks program. http://12blocks.com/
But that might just add to your addiction.
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.
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
Stefan
-Phil
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.
Hanno
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.