In the application code, make
sure to check the SPI and UART maximum packet sizes against the requirements of
the application.
To increase the UART baud rate,
adjust the value in the SysConfig UART tab labeled Target Baud Rate.
Below this, observe the calculated baud rate change to reflect the target baud
rate. This is calculated using the available clocks and dividers.
Check error flags and handle them
appropriately. The UART and
I2C
peripherals are both capable of throwing informative error interrupts. For easy
debugging,
this subsystem uses an enumeration and a global variable to save error codes
when error codes are thrown. In real-world applications, handle errors in the
code so the errors do not break the project.
The current form of the project
defines all of the formatted parts of the packet, such as
UART_START_BYTE, UART_READ_SPI_BYTE, and
UART_WRITE_SPI_BYTE. These are accompanied by definitions to specify
where in the packet header these commands are found. Values in the
implementation can be changed. Make sure that the UART start and read or write
bytes are bytes that are not expected in the application.