Posted: 09:28pm 20 Apr 2024 |
|
|
|
This works infallibly; the code on the receiving PicoMite being:
'Picomite Simple Serial Client
Option AUTORUN ON Dim string cmd
SetPin GP1,GP0,com1 'Set up comms channel 1 Open "com1:19200, 256, ActionCommand, 3" As #1
Do WatchDog 500 'This recovers from errors not ignored but resets the chip Loop
Sub ActionCommand 'Message receipt detected On ERROR IGNORE 'This avoids system reset if duff command arrives Pause 30 'ensure all characters in command have arrived Line Input #1,cmd 'Get the command Execute cmd 'Action the received command
End Sub 'Return from the interrupt
and the sending device;
SetPin GP1,GP0,com1 ' SetPin GP1,uart1 Rx: SetPin GP0,uart0 Tx Open "com1:19200, 256" As #1 ' and then type directly
print #1,"option heartbeat on"
print #1,"option heartbeat off"
The heartbeat LED switches perfectly, as do all other output pins when configured and set.
But if I reset the sending device (killing the serial port) and then code;
Device SerialTx GP0, 19200, "option heartbeat on"
the same receiving device crashes. So, thinking I might need a CR + LF I tried;
Device SerialTx GP0, 19200, "option heartbeat on" +chr$13 +chr$10
but again, the receiving device crashes.
Dear friends, where might I be going wrong? Edited 2024-04-21 07:31 by circuit |