I'm having difficulty getting the 'alternate' SCI to work on the RM48
( this shares pins N2HET1[06] and N2HET1[13] )
I've confirmed that I can drive the pin using :
hetREG1->GCR = 0x01000001;
hetREG1->PULDIS = 0x00000000;
/** - Configure NHET pins as output */
hetREG1->DIR = 0x00002000;
/** test UART TX ( NHET1[13] */
hetREG1->DOUT = 0x0; //low
hetREG1->DOUT = 0x00002000; //high
I think the SCI setup is OK :
pSCI = ((sciBASE_t *)0xFFF7E500U);
/** - bring SCI out of reset */
pSCI->GCR0 = 0x00000001;
/* Clear SWnRST to 0 */
pSCI->GCR1 = 0x00000000;
/** - Disable all interrupts */
pSCI->CLRINT = 0xFFFFFFFFU;
pSCI->CLRINTLVL = 0xFFFFFFFFU;
/** - global control 1 to 0x03020023*/
pSCI->GCR1 = SCI_TXENA | SCI_RXENA | SCI_CONT | SCI_I_CLK | SCI_ATIM | SCI_COMM;
/** - set baudrate */
pSCI->BAUD = 42; /* 115200 baudrate */
/** - transmission length */
pSCI->LENGTH = 8 - 1; /* length */
/** - set SCI pins functional mode (0x6) */
pSCI->FUN = (1 << 2) /* tx pin */
| (1 << 1) /* rx pin */
| (0); /* clk pin */
/** - Finally start SCI */
pSCI->GCR1 |= SCI_SWnRST; /** - global control 1 to 0x030200A3*/
pSCI->FUN = 0x6; //re-affirm port function ?
while ((pSCI->FLR & 0x4)==0x4); //Wait for IDLE bit to be cleared ?
while (1) {
//send test message
while ((pSCI->FLR & SCI_TX_INT) == 0) { /* wait */ };
pSCI->TD = 'H';
while ((pSCI->FLR & SCI_TX_INT) == 0) { /* wait */ };
pSCI->TD = 'e';
while ((pSCI->FLR & SCI_TX_INT) == 0) { /* wait */ };
pSCI->TD = 'l';
GREEN_LED_ON;
while ((pSCI->FLR & SCI_TX_INT) == 0) { /* wait */ };
pSCI->TD = 'l';
while ((pSCI->FLR & SCI_TX_INT) == 0) { /* wait */ };
pSCI->TD = 'o';
while ((pSCI->FLR & SCI_TX_INT) == 0) { /* wait */ };
pSCI->TD = '\r';
while ((pSCI->FLR & SCI_TX_INT) == 0) { /* wait */ };
pSCI->TD = '\n';
GREEN_LED_OFF;
}
No characters are visible on the TX pin ( pin N2 )
but it is as if the SCI is not connected to the port pin
What stage have I forgotten ?
The loop takes around 650us, which is approximately correct.
Thanks