3.4. PIC16 C UART Serial Link
• RS232 port functions
• Simulation with virtual terminal
A basic serial link is provided by the UART. We have already seen that any pair of pins can be used for this interface, as the data rate is quite low, allowing the signals to be generated in software. However, a dedicated hardware port is provided, which must be used if an interrupt is needed. The CCS C library functions associated with this port are listed in Table 3.6
Title | Description | Example |
---|---|---|
RS232 SET BAUD RATE | Set hardware RS232 port baud rate | setup_uart(19200); |
RS232 SEND BYTE | Write a character to the default port | putc(65) |
RS232 SEND SELECTED | Write a character to selected port | s=fputc(“A”,01); |
RS232 PRINT SERIAL | Write a mixed message ... |
Get Programming 8-bit PIC Microcontrollers in C now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.