Datasheet

Programming PIC Microcontrollers in BASIC - mikroElektronika
5.2.3 CAN Library
The Controller Area Network module (CAN) is serial interface, used for communicating with other peripherals or microcontrollers.
CAN module is available with a number of PIC MCU models. BASIC includes a set of library routines to provide you comfortable
work with the module. More details about CAN can be found in appropriate literature and on mikroElektronika Web site.
5.2.3.1 CANSetOperationMode – Sets CAN to requested mode
Prototype
sub procedure CANSetOperationMode(dim Mode as byte, dim Wait as byte)
Description The procedure copies <Mode> to CANSTAT and sets CAN to requested mode.
Operation <Mode> code can take any of predefined constant values.
<Wait> takes values TRUE(255) or FALSE(0)
If Wait is true, this is a blocking call. It won't return until requested mode is set. If Wait is false, this is a non-
blocking call. It does not verify if CAN module is switched to requested mode or not. Caller must use
CANGetOperationMode() to verify correct operation mode before performing mode specific operation.
Example
CANSetOperationMode(CAN_MODE_LISTEN, TRUE) ' Sets CAN to Listen mode
5.2.3.2 CANGetOperationMode – Returns the current operation mode of CAN
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (16 sur 112)05/11/2004 02:20:52