External Links

Creative Science Centre

 

Library_uart

// #include "http://www.byvac.com//mBlib/flb/Library/2016/lib_pps.bas"

There is no specific library for the UART but the pps is used to set the appropriate pins

UART

UART2 is always initialised as this is part of the operating system and is used for general communication. The port pins used are.

MX170 TX=RB10,  RX=RB11
MX370 TX=RF5, RX=RF4

Because of the many options the UART is implemented as the ByPic documentation e.g. keywords. It is important also the PPS is used, to give an example set pins RF2 as RX and RF3 as TX

comopen(1,115200,250) // open com 1, 115200 Baud and a 250 byte buffer
// rx,tx
pps_in(*U1RX(),*PRF2()) // RX pin set to U1RX
pps_out(*PRF3(),*U1TXs()) // TX pin set to U1TX (NOTE the U1TXs)

// the following may not be necessary
io_pinRole(*RF2(),IN,WOFF) // Set RF2 as an input
io_pinRole(*RF3(),OUT,WOFF) // Set RF3 as an output