SPRAM and SEROUT
Falcon
Posts: 191
Hello,
Recently Mike Green helped me figure out how to use the SP STR L modifier with the SERIN command to accept multiple bytes of data and move them immediately to Scratchpad RAM to save variable space on the receiving end of two Serially-connected BS2Px's. I'm now using this code:
Now, how can I save space on the sending end? I hope to use the GET command to retreive the data from Scratchpad RAM and send it immediately out with the SEROUT command.
I know that the SP STR L modifier only applies to the SERIN command so that's not an option.
How could the STR ByteArray {\L} modified be used to send multiple bytes retreived from Scratchpad RAM
This example from the BSM requires a byte-array which I want to avoid in order to minimize variable space.
Is it possible to use a FOR-NEXT loop to send multiple bytes like so?
Or would I need to send individual SEROUT commands for each BYTE with a different WAIT statements, i.e. "Report1" etc.?
falcon
Recently Mike Green helped me figure out how to use the SP STR L modifier with the SERIN command to accept multiple bytes of data and move them immediately to Scratchpad RAM to save variable space on the receiving end of two Serially-connected BS2Px's. I'm now using this code:
SERIN SI\FC, baud, 100, notalk,[WAIT ("Report"), SPSTR 6] ' Serial In from Remote BS2 PAUSE 50 HIGH FC FOR index = 0 TO 5 GET index, work 'DEBUG work, CR PUT index + 50, work NEXT
Now, how can I save space on the sending end? I hope to use the GET command to retreive the data from Scratchpad RAM and send it immediately out with the SEROUT command.
I know that the SP STR L modifier only applies to the SERIN command so that's not an option.
How could the STR ByteArray {\L} modified be used to send multiple bytes retreived from Scratchpad RAM
This example from the BSM requires a byte-array which I want to avoid in order to minimize variable space.
serStr VAR Byte(5) ' create 5-byte array Main: serStr(0) = "H" ' fill array serStr(1) = "E" serStr(2) = "L" serStr(3) = "L" serStr(4) = "O" SEROUT 1, 16468, [STR serStr\5] ' transmit
Is it possible to use a FOR-NEXT loop to send multiple bytes like so?
FOR idx = 0 TO 5 GET idx, a2dResult SEROUT SO\FC, Baud, 2, Main, [ "Report", a2dResult] ' Serial Out to Remote BS2 NEXT
Or would I need to send individual SEROUT commands for each BYTE with a different WAIT statements, i.e. "Report1" etc.?
falcon
Comments
So I can still use "Report" to signal that bytes are about to be sent. Then I can send those 6 bytes individually instead of in the one SEROUT statement. The SERIN (as written in the 1st post) will still accept the first six bytes that follow "Report".
I'll give that a try.
falcon