Quote Originally Posted by Ross77 View Post
Ok think I've got it sorted. I'm not sure if the trim pots are configured properly as it looks like they will interfer with each other :naughty:. Just reread Kwakers post and I think i should have used the pic to pull them high not low. :whistling:

I've also left the 3.9 res in as I presume it will limit the Vref to 3v mav as per the data sheet. If the pots are pulled high could this be achived with a common 3v supply?
Just to clear any confusion - you the 3k9 res should be removed from the +5v line and connected to a port. The voltage at the other end will never exceed 1v.
Another resistor is connected the same (19k??) one end to the junction of the VR and the 3K9 the other to a second port.

Basically the PIC will pull either of the lines high - if it pulls the 3k9 one high you get whatever current you've set the VR for, if it pulls the 19k one high you get a quarter of that.
The pic avoids interference by essentially disconnecting the unused resistor (tri-stating the output).

I've also realised in my pseudo code there's no need to set the port pins high in the loop - this can be done outside - plus I don't show the pin being 'un-tri-stated' - which obviously it would need.