SCI problem in mc9s12xdp512 CPU

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

SCI problem in mc9s12xdp512 CPU

2,811 Views
kp2309
Contributor I
Hey Guys,
I m using CPU of MC9S12XDP512 and not yet using xgate core
I m facing some problem in driving serial coomunication

the SCI baud rate initialisation is not proper
According to data sheet and related apnotes i ve written d code as follows

Initialisation
SCI.SCxBDL  =   52;   /* baud rate 9600 at 8 MHz */
SCI.SCxBDH  =   0;   /* baud rate 9600 at 8 MHz */

While transmitting character
(!(SCI.SCxSR1 & 0x80)) {};  /* wait for output buffer empty */
    SCI.SCxDRL = ch;

I m not using interrupt but polling mode is used

also wanted to know wot is the relation between system bus clock, oscillator clock
Crystal being used = 8MHz

Can u pls suggest me any solution..................?
Labels (1)
0 Kudos
4 Replies

415 Views
kef
Specialist I
If you didn't selected bus clock to be derived from PLL (PLLSEL bit), then bus clock should be in your case a half of crystal frequency, 8MHz  / 2 = 4MHz.
0 Kudos

415 Views
kp2309
Contributor I
I m not using PLL
hence taken bus clock = 4 Mhz
and calculated with formula
SCI baud rate = SCI bus clock/(16*9600) = 26 ,                     as bus clock = 4MHz
and loaded it in baud rate register but its not working

On hyper terminal it is showing some garbage character with HEX value 0xE0 whereas it is supposed to show 0x85 which is sent by me. Also it is showing the garbage character  for some specific range of characters (i.e. its not communicating when we send 'A' or any number like'1', but it shows same garbage value for 'k' as well as 'U' )



0 Kudos

415 Views
kef
Specialist I
Then your oscilator must be working in self clock mode which is specified from min 1MHz to max 5.5MHz and we may only guess what the value it is.
 
Aren't you porting your application from some older S12 derivative to S12X? If that's the case then please note a changes made, for example there's no more Collpitts oscilator mode.
 
Regards
0 Kudos

415 Views
kp2309
Contributor I
Thanks for the valuable information

We will be goin for hardware change of the board.
I have one more query,
What is the exact difference between colpitts oscillator and pierce oscillator (Full swing as well as loop controlled)?
Is loop controlled oscillator is compatible with MC9S12DP512 and MC9S12XDP512?????????????
So that we can use the same design for both the boards.
In case of full swing pierce oscillator, what will determine Rb and Rs values? is there any standard???
Can we make Rb open and Rs short in the circuit???
Is there any apnote other than AN2727????



Message Edited by kp2309 on 2008-02-13 04:06 AM
0 Kudos