Hi there,
I have this code to initialize and play with MAX7219, using 28X1
symbol data7219 = B.2
symbol cs7219 = B.0
symbol clk7219 = B.1
symbol reg = b9 ' 7219 register
symbol val = b8 ' value to register
symbol datareg = w4 ' 16bit data register
gosub Init7219
do
... some stuf ...
loop
Init7219:
let pins=$0
datareg = $09ff
gosub Write7219
datareg = $0b07
gosub Write7219
datareg = $0a0f
gosub Write7219
datareg = $0c01
gosub Write7219
return
Write7219:
low cs7219
spiout clk7219,data7219,MSBFirst_L, (datareg / 16)
high cs7219
return
the question is why this works
spiout clk7219,data7219,MSBFirst_L, (reg,val)
but
spiout clk7219,data7219,MSBFirst_L, (datareg / 16)
doesnt
w4 = b9:b8 so it should works same way, shouldnt?
Thanks for explanation
I have this code to initialize and play with MAX7219, using 28X1
symbol data7219 = B.2
symbol cs7219 = B.0
symbol clk7219 = B.1
symbol reg = b9 ' 7219 register
symbol val = b8 ' value to register
symbol datareg = w4 ' 16bit data register
gosub Init7219
do
... some stuf ...
loop
Init7219:
let pins=$0
datareg = $09ff
gosub Write7219
datareg = $0b07
gosub Write7219
datareg = $0a0f
gosub Write7219
datareg = $0c01
gosub Write7219
return
Write7219:
low cs7219
spiout clk7219,data7219,MSBFirst_L, (datareg / 16)
high cs7219
return
the question is why this works
spiout clk7219,data7219,MSBFirst_L, (reg,val)
but
spiout clk7219,data7219,MSBFirst_L, (datareg / 16)
doesnt
w4 = b9:b8 so it should works same way, shouldnt?
Thanks for explanation