SCI0 without LIN interface

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

SCI0 without LIN interface

Jump to solution
8,804 Views
lotfi_bensalem
Contributor I

Hi,


I use the DEVKIT-S12VR64: Dev Board for #S12VR64 MCU and the CW V5.1. I would like to use a pure serial interface SCI0  without through the LIN interface. At first, I used the serial SCI1 as presented in the LAB3_SCI_S12VR, just to familiarize myself and be sure that the control settings are correct, everything works fine. Then I wanted to adapt this example for the SCI0 interface, but it does not work. In the MC9S12VRRM, it explains on page 82/83 that SCI0 is shared with LINPHY interface. I programmed the register MODRR2 = 0b0110 to use PS1 / TXD0 and PS0 / RXD0 but it does not work. I also tried MODRR2 = 0b1110 to use PT1 / TXD0 and PT0 / RXD0, does not work . Here is a registry initialization code:

//route SCI0
/* MODRR2: MODRR23=0,MODRR22=1,MODRR21=1,MODRR20=0, */ //Module Routing Register 2
setReg8Bits(MODRR2, 0x06U); //TXD0 on PS1, RXD0 on PS0, see page 82, 83
/* LPCR: LPE=0 */ //LIN Control Register (LPCR)
clrReg8Bits(LPCR, 0x08U); //The LIN Physical Layer is in shutdown mode, see page 82, 83
/* PPSS: PPSS1=1,PPSS0=1 */ //polarity select, pull down
setReg8Bits(PPSS, 0x03U);
/* PERS: PERS1=1,PERS0=1 */ //polarity enabled
setReg8Bits(PERS, 0x03U);
/* WOMS: WOMS1=0 */ //Output Wired mode: Push pull
clrReg8Bits(WOMS, 0x02U);

What's wrong ? 

0 Kudos
1 Solution
585 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi,

I would like to point to the example code for the S12VR64 MCU where can be seen the initialization, settings, and interrupts of the SCI0. There SCI0 is routed to Port S.

Please refer to the attachment.

I hope it helps you. If you have any questions, let me know.

Best Regards,

Diana

View solution in original post

0 Kudos
2 Replies
586 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi,

I would like to point to the example code for the S12VR64 MCU where can be seen the initialization, settings, and interrupts of the SCI0. There SCI0 is routed to Port S.

Please refer to the attachment.

I hope it helps you. If you have any questions, let me know.

Best Regards,

Diana

0 Kudos
585 Views
lotfi_bensalem
Contributor I

Hi Diana,
Thank you for this example, it works well, it allowed me to debug my program and find the problem.
thanks again
Lotfi

0 Kudos