Abl-electronic PIC Microcontrollers PIC16 Manual do Utilizador Página 152

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 312
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 151
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
144
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Prototype
void CANSetBaudRate(char SJW, char BRP, char PHSEG1, char PHSEG2,
char PROPSEG, char CAN_CONFIG_FLAGS);
Description Sets CAN baud rate. Due to complexity of CAN protocol, you cannot simply force a bps
value. Instead, use this function when CAN 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 CAN 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;
...
CANSetBaudRate(1, 1, 3, 3, 1, init);
CANSetBaudRate
Vista de página 151
1 2 ... 147 148 149 150 151 152 153 154 155 156 157 ... 311 312

Comentários a estes Manuais

Sem comentários