PIC32MZ tutorial -- UART Communication
扫描二维码
随时随地手机看文章
At this moment, I accomplish the interface of UART communication for PIC32MZ EC Starter Kit. This interface configures the PIC32MZ for communication with a host PC at 115200 baud. There are five functions in the interface -- Uart_Init(), Uart_Getc(), Uart_Gets(), Uart_Putc() and Uart_Puts().
Uart_Init() configures PIC32MZ UART1 with 115200-8-None-1. It uses PPS to select RPC13, RPC14 as TX and RX.
Uart_Getc() is a reception funtion for a character. It will be blocked until a character got.
Uart_Gets() is a reception funtion for string. It will receive multiple characters until the 'r' 'n' or the buffer is full.
Uart_Putc() is a transmit function for a character.
Uart_Puts() is a transmit funtion for string. It will transmit multiple character until '