Page 1 of 1

PCAN-RS-232 Serial and CAN Interrupts

Posted: Wed 19. Dec 2018, 11:54
by G.Foster
Hello, I am writing a CAN to RS232 convertor using the PEAK example code as a base. Is the serial write function (SER_Write) a blocking function, or does it use interrupts to proceed with the program execution between each character transmission?
Also, is the CAN recieve code interrupt driven?

Re: PCAN-RS-232 Serial and CAN Interrupts

Posted: Thu 20. Dec 2018, 07:19
by S.Michaelsen
Hello,

the both, CAN and UART functions, are interrupt driven and maintain an internal software FIFO. The buffers / sizes of the FIFOs is set in the according initialization functions (SER_UserInit () / CAN_UserInit()). Note that SER_Write() might fail with error SER_ERR_TX_SPACE if there is not enough space left in TX FIFO for the number of bytes that should be transmitted.

Best Regards,
Stephan