mixing rfbyte and rfword
rjo__
Posts: 2,114
in Propeller 2
Using a well tested serial routine (on the Prop2 side)
connected to a somewhat flakey serial connection on the computer side...
to read from the computer into the P2 and interleave image and distance data
(from a KinectV2). The image data is a byte and the distance data is two bytes.
Once I call this, the P2 doesn't seem to respond to further commands although the
computer side of things seems fine.
I suspect that mixing wfbyte and wfword might not be allow?
connected to a somewhat flakey serial connection on the computer side...
to read from the computer into the P2 and interleave image and distance data
(from a KinectV2). The image data is a byte and the distance data is two bytes.
Once I call this, the P2 doesn't seem to respond to further commands although the
computer side of things seems fine.
kinect2hub
mov z,##230400
mov ptra,##_Off_SCREEN_BUFFER
wrfast ##0,ptra
.get3bytes
call #rcv_char
wfbyte rx_char
call #rcv_char
mov xx,rx_char
shl xx,#8
call #rcv_char
add xx,rx_char
wfword xx
djnz z,#.get3bytes
mov rx_char,#0
ret
I suspect that mixing wfbyte and wfword might not be allow?

Comments
The total buffer is 230400 bytes... but I am grabbing 3 bytes per loop... so I only need to
loop 76800 times. With this fix... all is well. Sorry.
By the way... the P2 is just fabulous.
Thanks