Shop OBEX P1 Docs P2 Docs Learn Events
MCP41050 <- Working code sample — Parallax Forums

MCP41050 <- Working code sample

ArchiverArchiver Posts: 46,084
edited 2004-02-18 18:32 in General Discussion
Hi All,

With Sid's help, I got the MCP41050 going. Not the MAX41050 as I mistakenly
said earlier. Anyway, I thought I'd post a code snip:

cs con 0
clk con 1
si con 2

potData var word
potSet var potData.lowbyte
potData = %00010000100000000

main:
pause 100
debug "PotSet: ", dec potSet,cr
low CS
shiftout si,sck,msbfirst,[noparse][[/noparse]potData\16]
high cs
if potSet = 255 then
potset = 0
goto main
endif
potSet = potSet +1
goto main

Thanks to all for the help,

Jonathan

www.madlabs.info
Sign In or Register to comment.