MikroElektronika PIC Microcontrollers PIC18 Instrukcja Użytkownika Strona 25

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 40
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 24
bus for PIC microcontrollers having no built-in CAN modules. In this section we
will discuss only the library functions available for PIC microcontrollers with built-in
CAN modules. Similar functions are available for the PIC microcontrollers with no
built-in CAN modules.
The mikroC CAN functions are supported only by PIC18XXX8 microcontrollers
with MCP2551 or similar CAN transceivers. Both standard (11 identifier bits) and
extended format (29 identifier bits) messages are supported.
The following mikroC functions are provided:
CANSetOperationMode
CANGetOperationMode
CANInitialize
CANSetBaudRAte
CANSetMask
CANSetFilter
CANRead
CANWrite
9.10.1 CANSetOperationMode
The CANSetOperationMode function sets the CAN operation mode. The function
prototype is:
void CANSetOperationMode(char mode, char wait_flag)
The parameter wait_ flag is either 0 or 0 FF. If it is set to 0 FF, the function blocks
and will not return until the requested mode is set. If it is set to 0, the function returns as
a nonblocking call.
The mode can be one of the following:
CAN_MODE_NORMAL Normal mode of operation
CAN_MODE_SLEEP Sleep mode of operation
CAN_MODE_LOOP Loop-back mode of operation
www.newnespress.com
499Advanced PIC18 Projects—CAN Bus Projects
Przeglądanie stron 24
1 2 ... 20 21 22 23 24 25 26 27 28 29 30 ... 39 40

Komentarze do niniejszej Instrukcji

Brak uwag