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.

MSP430FR2476: eUSCI pin re-use in SPI mode

Part Number: MSP430FR2476

Champs,

A customer uses eUSCI as a SPI master to only write data out hence only requires the SIMO and the clock. they are short on pins and would like to re-use STE as an analog input and SOMI as digital output. it is not quite clear in the documentation whether SYSCFG3 or PxSEL config takes precedence in defining pin function. Will appreciate your clarifying if the above use case is feasible.

Thank you,

Michael

  • Hi Michael, 3-pin and 4-pin SPI operation is support on USCI SPI Mode. STE pin can be used as IO if 3-pin SPI operation is selected. but I think SOMI can't be reused in this case. Thanks!

  • I hesitate to disagree with Xiaodong, but as far as I know you can take any or all of the SPI pins away from the eUSCI and it will continue to operate, without affecting those pins.

    PxSEL=11 doesn't assign the pin to the ADC so much as it conditions the pin, turning off the Schmitt trigger and the REN resistors. [Ref data sheet (SLASEO7B) Fig 6-4] The ADC "takes" the pin based on INCH.

    I'm not sure what you mean by the reference to SYSCFG3 -- are you asking about the RMP bits?

  • Hi Bruce. I agree "as I know you can take any or all of the SPI pins away from the eUSCI and it will continue to operate, without affecting those pins" Thanks!

  • Hi Bruce,

    Thank you for your suggestion. Re SYSCFG3 - yes, I mean the remapping configuration, so once it is configured, 3 or 4 (depending on SPI mode config) pins of port 1 will be physically "wired" to the eUSCI block inside the MCU. What is not entirely clear to me is what happens when after that P1SEL is configured to re-assign one of the SPI functional pins to be a general purpose I/O for example. Will it physically re-wire the signal inside the MCU to do the I/O? have you ever tried doing such a thing?

    thank you

    Michael

  • User Guide (SLAU445I) Fig 23-1 shows (e.g.) SIMO going off the right side of the page. It then goes through "some stuff" and re-emerges in data sheet (SLASEO7B) Fig 6-4 as "From Module1", where it is then gated by PxSEL. RMP doesn't appear in either of these, so it is presumably part of the "some stuff" circuitry, and PxSEL has final control.

    A reductionist argument mentions that RMP is an A/B switch, not an on/off switch, i.e. either one pin set or the other is always in effect. So the question becomes "Can a program which never touches UCB0 (or its RMP) ever do GPIO on P1.1-P1.3?", which can be fairly easily demonstrated.

    Analog input is a different thing, since [Ref data sheet Fig 6-4 again], the ADC makes an "end run" directly to the pin. So you can run the ADC on a pin used as (e.g.) a GPIO, and you will get the correct (albeit boring) answer.

  • Hi Michael, SLASEO7B Figure 6-4 is the good reference. Function Select Registers PxSEL should be set to (SPI) after select SPI function through setting SYSCFG3. Otherwise, it will operate in default GPIO mode.

    SYSCFG3|=USCIA0RMP;                       //Set the remapping source
    P5SEL0 |= BIT0 | BIT1 | BIT2;             // set 3-SPI pin as second function (normal case)

    P5SEL0 |= BIT0 | BIT2;                       // A customer uses eUSCI as a SPI master to only write data out hence only requires the SIMO and the clock. (user case)

**Attention** This is a public forum