Serial Port Complete - Latest Microcontroller projects

(lily) #1

Chapter 11


sequence, starting over on reaching the end of the task list. For example, one
task can check for received serial-port data while another task reads and stores
sensor data from another port.

 serial_in var byte
timeout var word


loop:
'Task loop.

gosub receive_serial_data

' Call routines fo perform other tasks.

goto loop

receive_serial_data:

if (PIR1.5 = 1) then

' A byte is available. Read it.

hserin [serial_in]

' Do something with the received byte.

endif

return
Free download pdf