MikroElektronika PIC Microcontrollers PIC18 Manual do Utilizador Página 22

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 40
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 21
the masks and filters to determine if the message should be accepted. If a mask
bit is set to 0, that bit in the identifier is automatically accepted regardless of the
filter bit.
9.9.9 Calculating the Timing Parameters
Setting the nodes’ timing parameters is essential for the bus to operate reliably. Given
the microcontroller clock frequency and the required CAN bus bit rate, we can calculate
the values of the following timing parameters:
Baud rate prescaler value
Prop_Seg value
Phase_Seg1 value
Phase_Seg2 value
SJW value
Correct timing requires that
Prop_Seg þ Phase_Seg1 Phase_Seg2
Phase_Seg2 SJW
The following example illustrates the calculation of these timing parameters.
Example 9.2
Assuming the microcontroller oscillator clock rate is 20MHz and the required CAN bit
rate is 125KHz, calculate the timing parameters.
Solution 9.2
With a 20MHz clock rate, the clock period is 50ns. Choosing a baud rate prescaler
value of 4, from Equation (9.4), T
Q
¼ 2
*
(BRP þ 1)
*
T
OSC
, gives a time
quantum of T
Q
¼ 500ns. To obtain a nominal bit rate of 125KHz, the nominal bit
time must be:
T
BIT
¼ 1=0:125MHz ¼ 8ms; or 16T
Q
www.newnespress.com
496 Chapter 9
Vista de página 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 39 40

Comentários a estes Manuais

Sem comentários