I am able to write text to both UART1 and UART2 using printf but cannot read data from them. Are there serial routines to buffer and read data from the serial ports that work with WPILIB or DDT?
WPILIB has the following:
unsigned char ReadSerialPortOne(void);
unsigned char ReadSerialPortTwo(void);
void WriteSerialPortOne(unsigned char byte);
void WriteSerialPortTwo(unsigned char byte);
void OpenSerialPortOne(unsigned baudRate);
void OpenSerialPortTwo(unsigned baudRate);
I’ve used serial successfully from EasyC Pro. Here is a code sample.
Cheers,
- Dean
Hi Dean,
I only have Easy C 2.0 or PIC18 C. I tried using the DDT library but could only get the printf working. I also tried to use the WPILibrary routines that you listed but they did not seem to work with PIC18 C. I will try converting your example to PIC18 C and see if it will work.
Regards,
Daniel