Abl-electronic PIC Microcontrollers PIC16 Manuel d'utilisateur Page 164

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 312
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 163
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
156
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Prototype
void CANSPISetBaudRate(char SJW, char BRP, char PHSEG1, char
PHSEG2, char PROPSEG, char CAN_CONFIG_FLAGS);
Description Sets CANSPI baud rate. Due to complexity of CANSPI protocol, you cannot simply
force a bps value. Instead, use this function when CANSPI is in Config mode. Refer to
datasheet for details.
Parameters:
SJW as defined in 18XXX8 datasheet (1–4)
BRP as defined in 18XXX8 datasheet (1–64)
PHSEG1 as defined in 18XXX8 datasheet (1–8)
PHSEG2 as defined in 18XXX8 datasheet (1–8)
PROPSEG as defined in 18XXX8 datasheet (1–8)
CAN_CONFIG_FLAGS is formed from predefined constants (see CAN constants)
Requires CANSPI must be in Config mode; otherwise the function will be ignored.
Example
init = CAN_CONFIG_SAMPLE_THRICE &
CAN_CONFIG_PHSEG2_PRG_ON &
CAN_CONFIG_STD_MSG &
CAN_CONFIG_DBL_BUFFER_ON &
CAN_CONFIG_VALID_XTD_MSG &
CAN_CONFIG_LINE_FILTER_OFF;
...
CANSPISetBaudRate(1, 1, 3, 3, 1, init);
CANSPISetBaudRate
Vue de la page 163
1 2 ... 159 160 161 162 163 164 165 166 167 168 169 ... 311 312

Commentaires sur ces manuels

Pas de commentaire