How to calcul error bit rate? with

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to calcul error bit rate? with

3,421 Views
shigoto
Contributor I
Hi
 
I'm quite new user of S12 family, plz can you help me for calculate the error % for MC9S12C64, 16MHz bus. I need HS CAN and I use a 16MHz resonator.
thanks
 
Shigoto
Labels (1)
0 Kudos
Reply
4 Replies

876 Views
Nabla69
Contributor V
Hi Shigoto,
 
It's not precised, but I guess you want to know the precision of the clock of the msCAN module for your High Speed CAN transmission.
 
You have several possibilities depending on how you clock the module itself.
First you need to know that there is a divider by two between the reference clock and the bus clock.
It means that when you use a 16MHz crystal, you will get an 8MHz bus by default.
If, from an 16MHz crystal you want a 16MHz bus, you need to configure the PLL.
 
Now, you can either clock the msCAN module to use the reference clock or the bus clock:
  • If you use a crystal direct to clock the msCAN module, the jitter on the CAN transmission will be linked to the precision of the crystal and the MCU will actually improve the jitter as you will divide the crystal clock to get the CAN rate.
  • If you use the bus clock and use the PLL, you need to know that PLL introduced jitter. You will not be out of CAN spec normally, but if you are not the end manufacturer, check with your customer as some require that PLL must not be used.
 
Hope this help...
Alvin.

Message Edited by Nabla69 on 2006-08-23 04:12 AM

0 Kudos
Reply

876 Views
shigoto
Contributor I
Hi Alvin,
 
I will not used a PLL, so the frequency will be 8MHz as I understand. I've seen the AN1798.pdf document application and I didn't understand how to find the information on the example to know the tolerance admitted of the oscillator and so on to calculate the value in bauds to fullfilled the HS CAN bauds of 500kbauds. Is it the correct may to do? thanks for your help
 
Shigoto
 
 
(Extract of the documentation

Example 1

Calculate the bit segments for the following system constraints:

Bit rate = 1M bit per second
Bus length = 20m
Bus propagation delay = 5 x 10-9 sm-1

Physical Interface (PCA82C250) transmitter plus receiver propagation delay = 150ns at 85C
MCU oscillator frequency = 8MHz

Step 1: Physical delay of bus = 20 x 5 x 10-9 = 100ns

tPROP_SEG 2 100ns =( + 150ns)=500ns

Step 2: A prescaler value of 1 gives a CAN system clock of 8MHz and a Time Quantum of 125ns. This will give 1000 / 125 = 8 time quanta per bit.

Step 3:

Step 4: From 8 time quanta per bit, subtract 4 for PROP_SEG and 1 for SYNC_SEG. This leaves 3 which is the absolute minimum, so PHASE_SEG1 = 1 and PHASE_SEG2 = 2.

Step 5: RJW is the smaller of 4 and PHASE_SEG1, in this case 1

Step 6: From equation (10):

From equation (11):

The required oscillator tolerance is the smaller of these values, i.e. 0.0049 (0.49%) over a period of 12.75μs (12.75 bit periods). In this case the prescaler = 1 so no reduction in oscillator tolerance can be made without using a higher MCU oscillator frequency. Also PHASE_SEG1 =1 so only one sample per bit is possible.

In summary:
Prescaler = 1
Nominal Bit Time = 8
PROP_SEG = 4
PHASE_SEG1 = 1
PHASE_SEG2 = 2
RJW = 1
Oscillator tolerance = 0.49%)

(Alban corrected copy/paste for legibility) 

Message Edited by Alban on 2006-08-23 10:46 AM

0 Kudos
Reply

876 Views
Nabla69
Contributor V
For tolerances considerations, you can have a look at:

Bosch Controller Area Network (CAN) Version 2.0 Protocol Standard | pdf
(BCANPSV2.0) Bosch Controller Area Network

You want to know the acceptable tolerance of the oscillator.

Alvin.
0 Kudos
Reply

876 Views
shigoto
Contributor I
thanks Alvin, maybe I'll find what I'm looking for in that document.
 
Shigoto.
0 Kudos
Reply