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

- 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 helpShigoto(Extract of the documentation

Calculate the bit segments for the following system constraints:**Example 1**Bit rate = 1M bit per second

Physical Interface (PCA82C250) transmitter plus receiver propagation delay = 150ns at 85C

Bus length = 20m

Bus propagation delay = 5 x 10-9 sm-1

MCU oscillator frequency = 8MHzStep 1: Physical delay of bus = 20 x 5 x 10-9 = 100ns

tPROP_SEG 2 100ns =( + 150ns)=500nsStep 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

- 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.

First you need to know that there is a

divider by twobetween the reference clock and the bus clock.Message Edited by Nabla69 on 2006-08-23 04:12 AM