Mikroelektronika MIKROE-442 데이터 시트
248
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
CAN Library
mikroBasic PRO for dsPIC30/33 and PIC24 provides a library (driver) for working with the dsPIC30F CAN module.
The CAN is a very robust protocol that has error detection and signalization, self–checking and fault confinement.
Faulty CAN data and remote frames are re-transmitted automatically, similar to the Ethernet.
Data transfer rates depend on distance. For example, 1 Mbit/s can be achieved at network lengths below 40m while
250 Kbit/s can be achieved at network lengths below 250m. The greater distance the lower maximum bitrate that can
be achieved. The lowest bitrate defined by the standard is 200Kbit/s. Cables used are shielded twisted pairs.
CAN supports two message formats:
- Standard format, with 11 identifier bits, and
- Extended format, with 29 identifier bits
Important:
- Consult the CAN standard about CAN bus termination resistance.
- CAN library routines require you to specify the module you want to use. To use the desired CAN module,
simply change the letter
x in the routine prototype for a number from 1 to 2.
- Number of CAN modules per MCU differs from chip to chip. Please, read the appropriate datasheet before
utilizing this library.
Library Routines
- CANxSetOperationMode
- CANxGetOperationMode
- CANxInitialize
- CANxSetBaudRate
- CANxSetMask
- CANxSetFilter
- CANxRead
- CANxWrite