Simplest code not working
bboy8012
Posts: 153
I am trying to connect to the mini SSC II, I have this and for some reason it isnt working
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hunger hurts, starvation works!
CON _clkmode = xtal1 + pll16x '80MHz operating frequency. _xinfreq = 5_000_000 VAR byte position OBJ comm : "Simple_Serial" PUB main comm.init(0,-1,9600) repeat position from 0 to 254 step 1 send2SSC(255, 0, position) waitcnt(1_000 + cnt) PRI send2SSC(sync, servo, pos) comm.tx(sync) comm.tx(servo) comm.tx(pos)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hunger hurts, starvation works!
Comments
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hunger hurts, starvation works!
comm.init(-1,0,-9600)
The SSC manual says the data should be inverted
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hunger hurts, starvation works!
You are trying to send characters in the serial but you need to send this information as
· comm.dec(...)
I presume the simple_serial has the same options as FullDuplexSerial object. There is also
· comm.hex(...,8) 'where 8 is the number of hex digits you want to display
It is possible that the spin code is slower that the 1000 you have added to cnt - try 1_000_000 just to be sure.