PreviousNext
Open
Help > Peripherals > UART > Open

This command opens the UART peripheral at a specified baud rate (predefined symbols DpaBaud_xxx can be used in the code) and discards internal read and write buffers. The size of the read and write buffers is 64 bytes.

 

Request

 

NADR

PNUM

PCMD

HWPID

0

NADR

0x0C

0x00

?

BaudRate

 

BaudRate         specifies baud rate:

         0x00             1 200 Baud

         0x01             2 400 Baud

         0x02             4 800 Baud

         0x03             9 600 Baud

         0x04            19 200 Baud

         0x05            38 400 Baud

         0x06            57 600 Baud

         0x07           115 200 Baud

         0x08           230 400 Baud

 

Response

 

The general response to writing request with STATUS_NO_ERROR Error code.

 

 

Error codes

ERROR_DATA      Invalid BaudRate value.

 

Example 1

 

Open UART for communication with 9 600 baud rate:

 

         DPA Request (master → slave)
NADR=0x0001, PNUM=0x0C, PCMD=0x00, HWPID=0xFFFF, PData={0x03}(9 600 Baud)

 

         DPA Response (slave → master)
NADR=0x0001, PNUM=0x0C, PCMD=0x80, HWPID=0xABCD, PData={0x00}(No error), {0x07}(DPA Value)