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.

MSP430F47187: How can I read a port pin status if it is configured for its peripheral function?

Part Number: MSP430F47187

Hello all, 

Greetings. Can some one help me with the following problem please?

I am using the SPI port B1 (UCxB1) on the MSP430F47187 that is associated with Port 2 pins. specifically P2.1, P2.2, & P2.3

As such I am setting the corresponding P2SEL register to 0x0E. thus selecting the peripheral function for these pins. 

A line in the User manual reads, "when configured for the peripheral function the internal port bit reflects the device pin status"

But how do I channel this status so that I can read the port pin and acquire the current status. I take it the P2IN register is disconnected from the external pin once the pin is configured for its peripheral function?? However theie is NO pin diagram showing the internal pin arrangement ANYWHERE in the entire user manual. 

Could some kind soul please point me to such a diagram if one exists? 

Also is there a way to read the instantaneous pin status while the pin is configured for a peripheral function?

My reason for wanting this is as follows: I am interfacing to a NOR flash memory. The NOR flash outputs a busy status on the SOMI line if the Flash memory is performing an Erase or Write cycle. The alternative to reading this pin is to read the status register which is slower than reading the SOMI pin and hence not an attractive solution. 

This is very important and just a wee bit urgent. 

Thanks to anyone who replies. 

Best regards

Aniruddha

  • Hello,

    From what I can ascertain from your post, you are trying to sense the level on a SPI pin while you are using the SPI peripheral. Below is a pin diagram I found in the device datasheet. Judging by what I see on the diagram, regardless of PxSEL, PxIN should read the level on the pin like you want. Another option is to temporarily change the P2SEL to I/O mode to read the level and then switch back to SPI mode; but if you try reading P2IN and the level is correct then that would be the way to go. Hope this helps!!

    Best regards,

    Matt Calvo

  • Hi Matt,

    Thanks a bunch!!
    Sorry, I did not think to check the datasheet. Yes you are right. It does appear P2IN should have the correct voltage levels irrespective of whether the module or IO function has been selected.
    Best regards
    Aniruddha

**Attention** This is a public forum