Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Digital potentiometer?
Page 2 of 2 | |||||
Author | Message | ||||
goc30 Guru Joined: 12/04/2017 Location: FrancePosts: 425 |
in my prog, I have some times, bad value. Not big error, but bad (like 0.1 to 0.2v error) and after it give good value. It is an random small error. to morrow I give you all my results on test prog |
||||
hitsware2 Guru Joined: 03/08/2019 Location: United StatesPosts: 705 |
There is bound to be some small error in the resistance. As with any resistance ( temperature as one factor ) Look Here Edited 2020-04-11 13:57 by hitsware2 my site |
||||
goc30 Guru Joined: 12/04/2017 Location: FrancePosts: 425 |
hi my values on test with mx170 28 pins pot is between 3.3v and gnd pot=1 give 3.v const pincs=26 'Chip Select const pinrel=16 'I have led on this pin const pinvl=6 'analog pin in dim i as integer dim valpot as integer dim valin as float setpin pinrel,DOUT SetPin pincs,dout setpin pinvl, ain Pin(pincs)=1 Pin(pinrel)=1 valpot=&h1 'value to output SetTick 500, task1,1 ' task toggle led each 500ms do Pin(pincs)=0 'active cs SPI open 10000000,0,16 'spi mode 0 in 16b spi write 1,valpot 'adresse 0 + value Pin(pincs)=1 SPI close valpot=valpot+1 if valpot=>256 then valpot=1 pause(50) valin=pin(pinvl) print "pot=";str$(valpot);" lue:";str$(valin) loop sub task1() pin(pinrel)=(pin(pinrel) xor 1) end sub result pot=3 read:3.2371 pot=4 read:3.11505 pot=5 read:3.1828 pot=6 read:3.21344 pot=7 read:3.27366 <--- error pot=8 read:3.11129 pot=9 read:3.18064 <--- error pot=10 read:3.13441 pot=11 read:3.1543 <--- error pot=12 read:3.04892 pot=13 read:2.93226 pot=14 read:2.82151 pot=15 read:2.9914 <--- error pot=16 read:2.82796 pot=17 read:2.87204 <--- error pot=18 read:2.73763 pot=19 read:2.91398 <--- error pot=20 read:2.88118 <--- error pot=21 read:2.73387 pot=22 read:2.7172 pot=23 read:2.82527 <--- error pot=24 read:2.67634 ... same prog in explorer64 RUN pot=2 lue:3.251612856 pot=3 lue:3.224731136 pot=4 lue:3.199999954 pot=5 lue:3.174193503 pot=6 lue:3.148387051 pot=7 lue:3.1225806 pot=8 lue:3.096774149 pot=9 lue:3.070967698 pot=10 lue:3.045161246 pot=11 lue:3.019354795 pot=12 lue:2.995161247 pot=13 lue:2.968279527 pot=14 lue:2.941935441 pot=15 lue:2.918817162 pot=16 lue:2.893548345 pot=17 lue:2.867741894 pot=18 lue:2.841935443 pot=19 lue:2.816666626 pot=20 lue:2.793010712 pot=21 lue:2.767741895 pot=22 lue:2.741935444 pot=23 lue:2.716128993 pot=24 lue:2.692473079 pot=25 lue:2.664516091 pot=26 lue:2.640860177 pot=27 lue:2.616128994 Edited 2020-04-11 18:40 by goc30 |
||||
goc30 Guru Joined: 12/04/2017 Location: FrancePosts: 425 |
I found the origin of my value imprecision problem with digital pot. this comes from the fact that I had not wired the 8Mghz quartz (with 2x22pf), so everything was more or less unstable. With quartz it became correct |
||||
goc30 Guru Joined: 12/04/2017 Location: FrancePosts: 425 |
after doing a reverse test, it seems that the problem would not come from the presence or not of quartz, but perhaps from an instability of my power supply. I will continue to test other configurations to find out where the problem comes from Matherp chip select on 26 or on 22 take same result Edited 2020-04-24 16:45 by goc30 |
||||
goc30 Guru Joined: 12/04/2017 Location: FrancePosts: 425 |
I confirm that after several tests, the problem concerning the imprecision of the output values, came from the poor quality of power converter So be careful to choose this kind of circuit for information: circuit to avoid |
||||
CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 1985 |
SM PSUs of all types can be noisy. I replaced a mains 9V PSU in a Rugby MSF clock for my mother with one of these type of modules and it couldn't lock onto the time source at all. Took it out and built up one using a transformer, bridge and a 7809 regulator... good as gold, locked on right away. I suspect PSU in most cases where weird stuff is happening - not always on the money but a good portion of the time. Definitely still room for a good old-fashioned linear PSU. Edited 2020-04-26 06:29 by CaptainBoing |
||||
Page 2 of 2 |
Print this page |