Good catch.But even with the res=24 inside the loop, I'm still reading 100k across the wipers and the A terminals, and low resistance across the wipers and the B terminals. I slowed down the clock with a "define shift_pauseus 100", took the res=24 outside the loop, but still can't see any changes in resistance. Here's my adjusted code:
--------------------
cmcon=7
define osc 8
define shift_pauseus 100
res var byte
CS var porta.2 'CS
CLK var porta.3 'CLK
SI var porta.4 'SI
LED var porta.1 'LED
high CS
high LED
pause 500
low LED
pause 500
high LED
res=24
repeatit:
low CS
shiftout SI,CLK,1,[%00000000\8,res\8]
high CS
pause 10
low CS
shiftout SI,CLK,1,[%00010000\8,res\8]
high CS
pause 500
res=res+32
goto repeatit
end
--------------------
I also have 10k resistors between the MCP4261 pins and the 16F628A pins, but that shouldn't affect anything.
WP and SHDN can be left floating, right? Am I correctly formatting the command byte? Aren't the memory locations %0000 and %0001 the correct ones to address?
Thanks for the help!
Dave
Bookmarks