Hello,
i have a TMS570LS12x Launchpad and want to work with the SCI.
I tested the SCI1 and SCI2, Transmitting data from the TMS works but i can't receive Data.
I hope sombuddy can help me.
The SCI registers after sending some bytes and hardwareloopback:
GlbCtrl0 0x00000001 global control register [Memory Mapped]
GlbCtrl1 0x030000A2 global control register [Memory Mapped]
GlbCtrl2 0x00000000 global control register [Memory Mapped]
SetInt 0x00000200 Set Interrupt Register [Memory Mapped]
ClearInt 0x00000200 Clear Interrupt Register [Memory Mapped]
SetIntLVL 0x00000000 Set Interrupt Level Register [Memory Mapped]
ClearIntLVL 0x00000000 Clear Interrupt Level Register [Memory Mapped]
Flr 0x00000900 Flags Register [Memory Mapped]
IntVect0 0x00000000 Interrupt Vector Offset 0 [Memory Mapped]
IntVect1 0x00000000 Interrupt Vector Offset 1 [Memory Mapped]
Format 0x00000007 Format Control Register [Memory Mapped]
Brsr 0x00000249 Baud Rate Selection Register [Memory Mapped]
Ed 0x00000000 SCI Data Buffer [Memory Mapped]
Rd 0x00000000 SCI Data Buffer [Memory Mapped]
Td 0x00000004 SCI Data Buffer [Memory Mapped]
Fun 0x00000006 Pin Control 0 [Memory Mapped]
Dir 0x00000000 Pin Control 1 [Memory Mapped]
DIn 0x00000006 Pin Control 2 [Memory Mapped]
DOut 0x00000000 Pin Control 3 [Memory Mapped]
DSet 0x00000000 Pin Control 4 [Memory Mapped]
DClr 0x00000000 Pin Control 5 [Memory Mapped]
PDr 0x00000000 Pin Control 6 [Memory Mapped]
PDis 0x00000000 Pin Control 7 [Memory Mapped]
PSel 0x00000006 Pin Control 8 [Memory Mapped]
LinComp 0x00000000 BLinCompARE Register [Memory Mapped]
LinRd0 0x00000000 LinRd0 Register [Memory Mapped]
LinRd1 0x00000000 LinRd1 Register [Memory Mapped]
LinMask 0x00000000 LinMask Register [Memory Mapped]
LinId 0x00000000 LinId Register [Memory Mapped]
LinTd0 0x00000000 LIntD0 Register [Memory Mapped]
LinTd1 0x00000000 LIntD1 Register [Memory Mapped]
MBrsr 0x00000DAC Maximum Baud Rate Selection Register [Memory Mapped]
SrSel 0x00000000 Slew Rate Control Register [Memory Mapped]
IoDftCtrl 0x00000500 IODFT for BLin moduler [Memory Mapped]
Here the Init code for the SCI:
/** - bring SCI out of reset */
scilinREG->GCR0 = 0U;
scilinREG->GCR0 = 1U;
/** - Disable all interrupts */
scilinREG->CLEARINT = 0xFFFFFFFFU;
scilinREG->CLEARINTLVL = 0xFFFFFFFFU;
/** - global control 1 */
scilinREG->GCR1 = (uint32)((uint32)1U << 25U) /* enable transmit */
| (uint32)((uint32)1U << 24U) /* enable receive */
| (uint32)((uint32)1U << 5U) /* internal clock (device has no clock pin) */
| (uint32)((uint32)(1U-1U) << 4U) /* number of stop bits */
| (uint32)((uint32)0U << 3U) /* even parity, otherwise odd */
| (uint32)((uint32)0U << 2U) /* enable parity */
| (uint32)((uint32)1U << 1U); /* asynchronous timing mode */
/** - set baudrate */
scilinREG->BRS = 585U; /* baudrate */
/** - transmission length */
scilinREG->FORMAT = 8U - 1U; /* length */
/** - set SCI pins functional mode */
scilinREG->PIO0 = (uint32)((uint32)1U << 2U) /* tx pin */
| (uint32)((uint32)1U << 1U); /* rx pin */
/** - set SCI pins default output value */
scilinREG->PIO3 = (uint32)((uint32)0U << 2U) /* tx pin */
| (uint32)((uint32)0U << 1U); /* rx pin */
/** - set SCI pins output direction */
scilinREG->PIO1 = (uint32)((uint32)0U << 2U) /* tx pin */
| (uint32)((uint32)0U << 1U); /* rx pin */
/** - set SCI pins open drain enable */
scilinREG->PIO6 = (uint32)((uint32)0U << 2U) /* tx pin */
| (uint32)((uint32)0U << 1U); /* rx pin */
/** - set SCI pins pullup/pulldown enable */
scilinREG->PIO7 = (uint32)((uint32)0U << 2U) /* tx pin */
| (uint32)((uint32)0U << 1U); /* rx pin */
/** - set SCI pins pullup/pulldown select */
scilinREG->PIO8 = (uint32)((uint32)1U << 2U) /* tx pin */
| (uint32)((uint32)1U << 1U); /* rx pin */
/** - set interrupt level */
scilinREG->SETINTLVL = (uint32)((uint32)0U << 26U) /* Framing error */
| (uint32)((uint32)0U << 25U) /* Overrun error */
| (uint32)((uint32)0U << 24U) /* Parity error */
| (uint32)((uint32)0U << 9U) /* Receive */
| (uint32)((uint32)0U << 8U) /* Transmit */
| (uint32)((uint32)0U << 1U) /* Wakeup */
| (uint32)((uint32)0U); /* Break detect */
/** - set interrupt enable */
scilinREG->SETINT = (uint32)((uint32)0U << 26U) /* Framing error */
| (uint32)((uint32)0U << 25U) /* Overrun error */
| (uint32)((uint32)0U << 24U) /* Parity error */
| (uint32)((uint32)1U << 9U) /* Receive */
| (uint32)((uint32)0U << 1U) /* Wakeup */
| (uint32)((uint32)0U); /* Break detect */
/** - initialize global transfer variables */
g_sciTransfer_t[1U].mode = (uint32)0U << 8U;
g_sciTransfer_t[1U].tx_length = 0U;
g_sciTransfer_t[1U].rx_length = 0U;
/** - Finaly start SCILIN */
scilinREG->GCR1 |= 0x80U;