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.

Current consumption is getting increased when configured UART and SPI. TX is shorted to MOSI and RX is shorted MIS0

Hi

I am using MSP4305419A controller. In my project I have to use SPI and UART port but at time only one will active. So I have shorted  UCB2SIMO  Pin to UCA3TXD pin (MOSI is shorted to Tx) and UCB2SOMI Pin to UCA3RXD (MISI is shorted to RX.) Now If I am using UART what should be the MISO and MOSI pins status? Bothshould be i/p? I have configured Tx as o/p and RX as i/p and MISI and MOSI both are i/p as its unused currently. I am able to transmitt data using UART currently but current is getting increased 400 micro amp. As in my project current consumaption is very much constraints. So how these both ports can I configured so that my cirrent should not increased more than 30 micro amp? Can anybody help me? Thank You

  • I haven't done this, but I have done a one-wire UART and a two-wire SPI, which I think are analogous.

    If you could explain why you need to talk to a (single?) device using both UART and SPI, over the same wires, that might reduce some of the mystery (ergo better answers).

    1) The pins on the (SPI or UART) ports should be set as input when you're not using them. You should also use PxSEL to take the (GPIO) pins away from the port.

    2) When the SPI slave isn't selected (/CS high), it's not supposed to drive MISO; however, a (rare) few do anyway, so check the slave manual.

    3) There's (typically) no way to tell the UART slave (peer, really) not to drive its Tx line (the 430's RXD), so you're probably stuck with the UART contention while the SPI is active.

    4) You may be able to get some mileage out of connecting the shared pins with a medium-strength resistor (5K? I just made that up) rather than a simple wire. Again, I'm not picturing very well what you're doing, so this may or may not help (or even work).

  • If UART and SPI aren't ever used at the same time, then the same USCI module (USCIAx) can be used to drive both by reconfiguring the USCI when the protocol changes. THis way, no pins need to be shorted and no conflicts can arise between the two - at least from the MSPs side.
    However...

    Bruce McKenney47378 said:
    3) There's (typically) no way to tell the UART slave (peer, really) not to drive its Tx line (the 430's RXD), so you're probably stuck with the UART contention while the SPI is active.

    That'Äs the problem. The SPI slaves will be transparent if their CS line isn't driven low, but the other side's TX line might be active and interfere wiht an SPI transmission. Also, the other side's UART will try to interpret SPI transmissions as UART data on its RX line.
    A possible workaround is to gate the RX and TX line with a CS signal for the UART peer. For teh TX side, a simple OR gate is enough to keep the "slave's" RX high when it isn't selected, but in the opposite direction, a tri-state BUS driver should be used, whose output is disabled when CS is high.

**Attention** This is a public forum