Product Specs

2.11 UART Interface
There UART interface can be set on any of the pins (PIN0-PIN8). The parameters of the UART interface
are shown in Table 3-5.
Table 3-5: UART Parameters
Paramete
r
Value
RX Pin
PIN0
-
PIN8
TX
Pin
PIN0
-
PIN8
Flow Control
Not Supported
Supported Baud rates
1200, 2400, 4800, 9600, 14400, 19200,
28800, 38400, 57600, 76800, 115200,
230400, 250000, 460800, 921600, 1000000
An example of UART communications is shown in Figure 3-15.
01 Class Display
2 Shared Disp As Uart
3 Public Sub New()
4 Disp = Uart.Create(9600, Pin.Pin0, Pin.Pin1)
5 End Sub
6 Shared Event Uart0Receive()
7 Dim chr As Integer = Disp.Read()
8 While chr >= 0
09
// Process Character and do something
10
// ....
11
// ....
12
chr = Disp.Read()
13 End While
14 End Event
15 Public Sub DisplayText(row As Byte, col As Byte, str As String)
16 If row >= 0 Then
17
Disp.Write(0xff)
18
Disp.Write(row)
19
Disp.Write(col)
20
Disp.Write(str.Length.ToByte)
21
Disp.Write(str)
22 Else
23
Disp.Write(0xfe)
24
Disp.Write(str.Length.ToByte)
25
Disp.Write(str)
26 End If
27 End Sub
27 End Class
Figure 3-15: UART mc-Script
©2020 mc-Things Inc. Page | 13