Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Communication Interface
(eSCI)
D. Valli
Associate Professor
TIFAC CORE in Automotive Infotronics
E-mail: dvalli@vit.ac.in
1
Communication Interfaces
9The eSCI has special features which allow the eSCI to operate as a LIN
bus master, complying with the LIN 2.0 specification.
9600=1MHz/(16*x)
1. Initialization of eSCI
a. Enable the module of esCI
b. Initialize eSCI control.
c. Configure Pads
2. Transmit Data
a. Wait for Transmit Data Empty register Status Flag.
b. Clear Status Flag.
c. Load data to Data Register.
Hence,
MFD = ( 64MHz / 8MHz) – 4
= 4
Therefore,
MFD = 00100
RFD = 000
PREDIV = 000
FMPLL.SYNCR.R = 0x0200000;
while(FMPLL.SYNSR.B.LOCK != 1);
Module Disable
MDIS When 1 - Disable
0 - Enable
ESCI_A.CR2.R = 0x0000;
ESCI_A.CR1.R = 0x01A1800C;
3,4,5 - PA
SIU.PCR[90].R = 0x0400;
SIU.PCR[89].R = 0x0400;
TDRE When
0 - No byte transferred to transmit shift register
1 - Byte transferred to transmit shift register; transmit data register empty
while(ESCI_A.SR.B.TDRE == 0);
ESCI_A.SR.B.TDRE = 1;
ESCI_A.DR.B.D = txdata;
while(ESCI_A.SR.B.RDRF == 0);
c. Load Data from the data register eSCI Data Register (ESCIx_DR)
rxdata = ESCI_A.DR.B.D;
# include “MPC5554.h”
uint8_t recdata[10];
uint8_t j; ESCI_A.DR.B.D = txdata;
const uint8_t transdata[ ] = { “HELLO” };
void main(void)
{
FMPLL.SYNCR.R = 0x0200000;
while(FMPLL.SYNSR.B.LOCK != 1);
ESCI_A.CR2.R = 0x0000;
ESCI_A.CR1.R = 0x01A1800C;
SIU.PCR[90].R = 0x0400;
SIU.PCR[89].R = 0x0400;
while(1) {
for( j=0; j<size of(transdata); j++) {
while(ESCI_A.SR.B.TDRE == 0);
ESCI_A.SR.B.TDRE = 1;
ESCI_A.DR.B.D = txdata;
while(ESCI_A.SR.B.RDRF == 0);
ESCI_A.SR.B.RDRF = 1;
rxdata[j] = ESCI_A.DR.B.D;
}
}
}
1. Initialization of eSCI
a. Enable the module of esCI
b. Initialize eSCI control.
c. Configure Pads
2. Transmit Data
a. Wait for Transmit Data Empty register Status Flag.
b. Clear Status Flag.
c. Load data to Data Register.
Hence,
MFD = ( 64MHz / 8MHz) – 4
= 4
Therefore,
MFD = 00100
RFD = 000
PREDIV = 000
FMPLL.SYNCR.R = 0x0200000;
while(FMPLL.SYNSR.B.LOCK != 1);
Module Disable
MDIS When 1 - Disable
0 - Enable
ESCI_A.CR2.R = 0x0000;
ESCI_A.CR1.R = 0x01A1000C;
3,4,5 - PA
SIU.PCR[89].R = 0x0400;
TDRE When
0 - No byte transferred to transmit shift register
1 - Byte transferred to transmit shift register; transmit data register empty
ESCI_A.DR.B.D = txdata;
ESCI_A.DR.B.D = txdata;
# include “MPC5554.h”
uint8_t j;
const uint8_t transdata[ ] = { “HELLO” };
void main(void)
{
FMPLL.SYNCR.R = 0x0200000;
while(FMPLL.SYNSR.B.LOCK != 1);
ESCI_A.CR2.R = 0x0000;
ESCI_A.CR1.R = 0x01A1000C;
SIU.PCR[89].R = 0x0400;
while(1) {
for( j=0; j<size of(transdata); j++) {
while(ESCI_A.SR.B.TDRE == 0);
ESCI_A.SR.B.TDRE = 1;
ESCI_A.DR.B.D = txdata;
}
}
}
Hence,
MFD = ( 64MHz / 8MHz) – 4
= 4
Therefore,
MFD = 00100
RFD = 000
PREDIV = 000
FMPLL.SYNCR.R = 0x0200000;
while(FMPLL.SYNSR.B.LOCK != 1);
Module Disable
MDIS When 1 - Disable
0 - Enable
ESCI_A.CR2.R = 0x0000;
ESCI_A.CR1.R = 0x01A1000C;
3,4,5 - PA
SIU.PCR[90].R = 0x0400;
RDRF When
0 Data not available in eSCI data register
1 Received data available in eSCI data register
rxdata = ESCI_A.DR.B.D ;
ESCI_A.DR.B.D = txdata;
# include “MPC5554.h”
uint8_t recdata[10];
uint8_t j;
void main(void)
{
FMPLL.SYNCR.R = 0x0200000;
while(FMPLL.SYNSR.B.LOCK != 1);
ESCI_A.CR2.R = 0x0000;
ESCI_A.CR1.R = 0x01A1000C;
SIU.PCR[90].R = 0x0400;
while(1) {
for( j=0; j<10; j++) {
while(ESCI_A.SR.B.RDRF == 0);
ESCI_A.SR.B.RDRF = 1;
rxdata[j] = ESCI_A.DR.B.D;
}
}
}
48