Maker Pro
Maker Pro

Digital Pot setup

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
I only wish my electronic skills were greater so that I could make the most of this new found marvel that is chip programming.

There are two things, the electronics and the programming. Look at it this way, anyone who knows one is half way there.

There are plenty of people who think "I only wish my programming skills were greater". :)
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Justin, 'DacSetup' is a Pin configuration Function. It's prefixed with a % Operator which specifies it as a Binary number. It is explained in the help file named "Basic Commands". File name is "picaxe_manual2.pdf".

Do you own a DVM, VOM or VTVM?

Chris
 
Hi Chris

I have just got home and I am going to start the build soon..

I do own a DVM. I intend to use it to measure the output from the project board.

I've already been looking into other uses for this set up and I have read that the current from the chip is so low that the voltage can't be used to power something like an LED. To do that I believe we would have to add a op amp. Is this correct?

Ill keep you posted on the build...

Justin
 
The chip can provide enough current (up to 25ma) to drive an LED. Just be sure to use a resistor in series.

Bob
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
<snip>I've already been looking into other uses for this set up and I have read that the current from the chip is so low that the voltage can't be used to power something like an LED. To do that I believe we would have to add a op amp. Is this correct?

Ill keep you posted on the build...

Justin



Yes, that's why I asked you earlier what the voltage control input impedance of your motor controller is. You said 1Meg, so buffering should not be needed here.

Have you ran the code in the simulator?
Do you know what to do when the simulator starts?
Do you know how to executed a button press on Pin4(Up) & Pin3(Down)?
Do you know how to read the data in the variables panel?

I was going to make a screen video for you but my PC seems to have symptoms of memory loss. Creating a screen vid uses mucho RAM and uP resources, so I probably won't be able to do that till I buy a new laptop. I'm dreading the move to W7 and all the hoops I'm going be jumping through to get my old apps to work with it. Particularly VB6!

Chris
 
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
The chip can provide enough current (up to 25ma) to drive an LED. Just be sure to use a resistor in series.

Bob

Bob, that's true if the Pin is designated as a Digital Output. The DAC is another story though. From the literature, which is vague on the particulars, I'm guessing that the DAC functions like a 'Charge Pump' circuit. This would explain the need for a HiZ load shunted by a 100nF cap. Admittedly, I'm guessing here. ;)

Chris
 
Bob, that's true if the Pin is designated as a Digital Output. The DAC is another story though. From the literature, which is vague on the particulars, I'm guessing that the DAC functions like a 'Charge Pump' circuit. This would explain the need for a HiZ load shunted by a 100nF cap. Admittedly, I'm guessing here. ;)

Chris

The DAC is a 32 step resistor ladder where each step is approx 5k, rather high impedance. The mid-step will have an impedance of about 40k, gradually lower up and down.

TOK ;)
 
Are you trying to run an LED off the DAC? That would not work. The way you control a LED to vary it's output is with PWM, another feature of the chip.

Bob
 
Hi Chris

It works a treat,:D I have manage to run the simulator and figured out all the questions you asked by trial and error.

I then hooked up the USB cable and connected the board and 08m2. I connected a 3*AA battery pack and for this build I have eliminated the 7805CT part of the design.

The circuit worked perfectly and from the V meter I got reading ranging from 0.2 - 4.2V (I think my AA are a little out of PUFF!)

I`m going to now rig up another version using the 7805CT

I asked about the LED connection as I was just interested to know if any other device could be run from the DAC output. Ive tried to connect an LED to the output and Yes, it does produce light but its very dim, however does get brighter (slighter) as you count up through the button pushes. I'm assuming that to get more power you would need to use and OP AMP??

Regards

Justin
 

Attachments

  • picaxe.jpg
    picaxe.jpg
    151.3 KB · Views: 118
Hi Chris

Is there a reason why Im getting .02V from the board when set to the lowest or 1 st step. Shouldn't this be ZERO V.

Justin
 
I asked about the LED connection as I was just interested to know if any other device could be run from the DAC output. Ive tried to connect an LED to the output and Yes, it does produce light but its very dim, however does get brighter (slighter) as you count up through the button pushes. I'm assuming that to get more power you would need to use and OP AMP??
No, you don't control an LED by voltage. The way they are typically controlled is by turning them on and off rapidly and varying the ON time. This is called PWM (Pulse Width Modulation). There should be info on using PWM in your PICAXE documentation.

Bob
 
'0' is the lowest step = 0V. A '1' will give you 0,15V @5V supply. '31' is the max value = 31/32*5V = 4.84V in theory.

TOK ;)
 
'0' is the lowest step = 0V. A '1' will give you 0,15V @5V supply. '31' is the max value = 31/32*5V = 4.84V in theory.

TOK ;)

I understand this, however I am getting .02 V from the output when I should be getting 0V

b1=0 but its showing .02V

Justin
 
Have you got a capacitor on the output, and how do you measure the output, DVM or scope?

The 20mV could only be induced noise on the measuring leads.

TOK ;)
 
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
The DAC is a 32 step resistor ladder where each step is approx 5k, rather high impedance. The mid-step will have an impedance of about 40k, gradually lower up and down.

TOK ;)

That's very good info. Makes more sense than a charge pump too. Where did you find it?

Thanks,
Chris
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Justin, I wouldn't work up a sweat over 20mV. It's fairly insignificant value in this application. By the way, did you find a wallwart to power the protoboard. Anything from 8VDC to 18VDC will work with the integral 7805 regulator on your protoboard. An 8 to 9V wallwart is about perfect though because the 7805 doesn't have to work hard at these input voltages.

You will not reach the upper voltage you need from the DAC if you run it on 3 cells (4.5V).

Chris
 
Chris

I didn`t get a wallwart yet, I do have a switching mode power supply I can use though. I have rebuilt the system again using the 7805, I still get the 20mV. Are you sure I shouldn't be concerned?? I can't actually put it to the test until I get the controller, which I am awaiting.

I have a question regarding the LED. This is going to sound simple to the electronics experts here I'm sure, but I just cant get my head around it.

You use the command Low 1 to switch the led on, how does this work. I have read the notes and looked at other examples and it seams that to switch on the flow of electrons you should use the command high 1, but in the case you are saying (I guess) switch off the channel with the command Low 1. Im not sure if you will be able to actually understand my question, sorry.

Justin
 
Have you got a capacitor on the output, and how do you measure the output, DVM or scope?

The 20mV could only be induced noise on the measuring leads.

TOK ;)

Yes I have a cap on the output and I`m using a DVM. I have rebuilt the circuit again but I still get the 20mV. It did at one point read 30mV. Not allot I know, but I`m concerned it might mean the motor won't stop when I actually connect a controller to the circuit.

However, I wont know until I am able to fully build and test the system.:(

Justin
 
I have a question regarding the LED. This is going to sound simple to the electronics experts here I'm sure, but I just cant get my head around it.
Setting the pin to low means that it is at ground. If the other end of the LED is connected (through a resistor hopefully) to V+, then it will turn on when the pin is low. You can also wire it the other way around, put the other end of the LED through a resistor to ground. Then the LED will turn on when the pin is set to high. PIC ouputs are push-pull, the can either source or sink current, and it is even the same amount (25ma max).

Bob
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Justin, most of is like to low side switch, which is how the Led is wired, as Bob explained. As far as your concern about 20mV; you should have a separate On/Off switch connected in line with the battery anyway. Your motor controller and the Picaxe circuit will always be drawing current without it.

Chris
 
Top