HI,
I am using eSCi interface of MPC5777C to connect to external device.
I am using GPIO 103, 104 pins as TX and RX respectively.
I have configured GPIO[103] as GPIO and OBE and GPIO[104] as GPIO and IBE
These are my transmit and recieve functions
void TransmitData(void)
{
uint8_t j;
for (j=0; j< sizeof (TransData); j++) { /* Loop for character string */
while (eSCI_A.IFSR1.B.TDRE == 0) {} /* Wait for transmit data reg empty = 1 */
eSCI_A.IFSR1.R = 0x8000; /* Clear TDRE flag */
Here instead of writing data to data register of esci, I am writing data to SIU GPDO output register
//eSCI_A.SDR.B.RDTD = TransData[j] << 24; /* Write byte*/
SIU_GPDO[103] = TransData[j] << 24; /* Write byte*/
}
}
void ReceiveData(void)
{
while (eSCI_A.IFSR1.B.RDRF == 0) {} /* Wait for receive data reg full = 1 */
eSCI_A.IFSR1.R = 0x2000; /* Clear RDRF flag */
Same here. Instead of reading data from data register of esci, I am reading data directly from SIU GPDI input register
//RecData = eSCI_A.SDR.B.RDTD; /* Read byte of Data*/
RecData = SIU_GPDI[104];
while (eSCI_A.IFSR1.B.TDRE == 0) {} /* Wait for transmit data reg empty = 1 */
eSCI_A.IFSR1.R = 0x8000; /* Clear TDRE flag */
}
Is this the correct way to use GPIO pins for esci interface?
Thanks
Vrushali