This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

using SCI (not SCI LIN) on RM48L952

Other Parts Discussed in Thread: HALCOGEN

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

  • Phil,

    The SCI pins are multiplexed with N2HET1[06] and N2HET1[13] as you mentioned.

    It is necessary to configure the IOMM module to change the default function (N2HET) to SCI prior to use these pins.

    I recommend to use HalCogen to do this setup for you.
    In Halcogen, there is a tab named "PINMUX", by default all the primary function are selected.
    To use SCI, just check the box SCI and the IOMM module will be configure to switch from N2HET to SCI function for the ball W3 (SCIRX) and ball N2 (SCITX).

  • Thanks for that information, Jean-Marc
    I'm now able to get it to work OK.

    That fixes the issue.

    I now know to investigate that tab if I get similar problems in the future.
    It's a bit annoying that the descriptions of the SCI don't seem to
    refer the PINMUX hardware.

    I've been using Halcogen as a helper tool, and then attempting to cut-n-paste the
    resultant code into an existing project.
    Sometimes easy to miss one step.
    Just for information (for others using a similar method), I also missed the stage
    for enabling interrupts (bit field) specifically for the SCI, in sys_startup.c


    vimREG->REQMASKSET2 (etc.) //no comments to help !

    Regards  Phil Bowden

     

  • Phil,

    The multiplexing information is available in the device datasheet.
    In your case, you have to look in http://www.ti.com/lit/ds/spns174/spns174.pdf
    First is to look the terminal function for the package you are using. Pinmuxing is package dependent.
    For SCI, the description for the terminal is done on page 27. Under signal name you will see:

    N2HET1[06]/SCIRX   W3
    N2HET1[13]/SCITX   N2

    This has to be read as, W3 is by default N2HET and has an alternate function as SCIRX.

    The detail on how to program the IOMM module is part of the TRM, but the easiest and recommended way is to use HalCogen.

    Note: Halcogen offers 2 way to deal with the pin muxing.
    1] By using the check box for a module (SCI for example). In this case, all pins associated to this module will be selected.
    2] By using the table with all independent pins. In this case you will have to select SCI_TX and SCI_RX as alternate function.

    Halcogen also checks that the configuration is valid.(List Conflict)
    It is obvious that if a given pin or ball has more than 2 functions, only one can be selected at a time.