Remember also to set the appropriate Comport Pins for direction In and Out - the may be implied by the uC default condition but good practice is to set the DIR for the USART port.pin
Note that the HSerReceive routine is implemented differently. In this library, it is a subroutine, as with SerReceive in rs232.h. This is purely a design decision, and has been made to keep included routines consistent with each other.
To show USART1 (only USART1) calculations in terms of actual BPS and % error. Use the following constants to control the checking and warning messages
#DEFINECHECK_USART_BAUD_RATE'Show baud rate errors above 2% during compiling
#DEFINEISSUE_CHECK_USART_BAUD_RATE_WARNING'Show actual baud rate during compiling
Enjoy
Last edit: Anobium 2022-10-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is the URL to the test program that has been used to validate the UART library.
Essentially, you set the input and output USART as a constant value, add PPS as required, compile/program. Then, you can send data from a terminal attached the in usart and the data will appear on the out usart.
The program uses interrupts - so, this tests. Init, Receive, Send, Interrupts.
in build 1176 or greater there is support for PIC usart3,4 and 5 for PIC.
Bill and I have also taken the opportunity to improve the library as follows:
USART constants
Remember also to set the appropriate Comport Pins for direction In and Out - the may be implied by the uC default condition but good practice is to set the DIR for the USART port.pin
Note that the HSerReceive routine is implemented differently. In this library, it is a subroutine, as with SerReceive in rs232.h. This is purely a design decision, and has been made to keep included routines consistent with each other.
To show USART1 (only USART1) calculations in terms of actual BPS and % error. Use the following constants to control the checking and warning messages
Enjoy
Last edit: Anobium 2022-10-14
Here is the URL to the test program that has been used to validate the UART library.
Essentially, you set the input and output USART as a constant value, add PPS as required, compile/program. Then, you can send data from a terminal attached the in usart and the data will appear on the out usart.
The program uses interrupts - so, this tests. Init, Receive, Send, Interrupts.
Enjoy
https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/Serial_Communications_Solutions/Hardware_USART_capability_Solutions/USART_COMPLEX_CAPABILITIES.gcb