PDA

View Full Version : Digital Potentiometer-555 timer Question



farrelli
04-25-2007, 04:11 AM
Hi,I know this is prob basic stuff but I'm havin trouble getting a Digital Pot to control the pulse width of a 555 timer. I was originally using a variable resistor (worked OK) but am switching to the digital pot to be controlled by the BS2.


Ok so its not quite working ATM, At the moment I have Low end of the resistor (dig. pot.) connected to discharge(555 timer) could anyone tell me if this is correct as I think this might be the problem?

Thanks.

Post Edited (farrelli) : 4/24/2007 9:47:57 PM GMT

PJ Allen
04-25-2007, 07:52 AM
Can you upload a schematic? Perhaps you could copy yours with a page scanner or compose something using "Paint."

farrelli
04-25-2007, 06:23 PM
Hi PJ, thanks for your reply.
Sorry I was a bit vague in my question.



The circuit I am building is almost identical to this one: http://www.uoguelph.ca/~antoon/circ/pwm555.html

except I am powering a 12V fan.

Instead of the variable resistor I am using a digital pot - DS1804 50K (data sheet http://datasheets.maxim-ic.com/en/ds/DS1804.pdf



Dig Pot:

Pin 3 High end of resistor is connected to +5V

Pin 5 Wiper is connected to the trigger (pin 2) and threshold (pin 6) of the 555 timer

Pin 6 Low end of resistor is connected ground



At the moment the Dig Pot seems to be working, when I run this code:




' {$STAMP BS2}

' {$PBASIC 2.5}

counter VAR Byte

LOW 12 'U/D toggles wiper direction

LOW 10 'Chip Select, Active Low
DO

FOR counter = 0 TO 99

PULSOUT 11,12


PAUSE 100

NEXT

TOGGLE 12

LOOP


This code goes through the resistor steps of the pot in sequence, but I am not getting anything out of the 555 at the moment.



what should i connect discharge (pin 7) of the 555 timer to as I had this connected to one of the terminals of the variable resistor now its no connected to anything?



Any help would be greatly appreciated, Thanks.

Post Edited (farrelli) : 4/25/2007 12:25:31 PM GMT

Lee Harker
04-25-2007, 08:30 PM
farrelli,
It appears that your digital pot should be connected the same as the 50K pot in the circuit you referenced. The two "ends" of the pot should be connected to the diodes and the center of the pot should be connected to pin 6 & 2 of the 555. The adjustment of the pot is what changes the duty cycle of the pulse. When your pot value is in the middle, you should get a square wave. Some digital pots have restrictions about which "end" of the pot must be high and which must be low but the data sheet for the DS1804 does not seem to restrict you that way.

farrelli
04-30-2007, 12:54 AM
Thank you Lee for the reply, I have tried swapping the digital pot instead of the variable resistor but I am not really getting it to work properly. The code I'm using is:
Modified from "whats a micro controller chapter 9"

' {$STAMP BS2p}
' {$PBASIC 2.5}


counter VAR Byte
LOW 7
DO
FOR counter = 0 TO 99
PULSOUT 6,7
PAUSE 60
NEXT
TOGGLE 7
LOOP

This code should step through the dig pot resistor values: bs2 o/p 6 - clk dig pot pin1
And toggle the dig pot wiper direction and start again: bs2 o/p 7 - U/D dig pot 2

When I measure the outputs with my multi-meter I can see o/p 7 switching between 0-5V every 6secs (toggle), but when I measure across o/p 6 it reads 0V, I thought this would step through voltages between 0-5v then 5-0v etc??


I have included a schematic of how its wired up at the moment, Could someone have a look at it please and tell me if it looks OK, I'm not too sure if I should connect dig pot high end of resistor to 5V or pin 4 of 555 timer (trigger) and dig pot low end resistor to GND or pin 7 of 555 timer (discharge)?

If anyone can help me that would be great, thanks.