Jump to content
43oh

Pin Contention on MSP430F5438AIZQW?


Recommended Posts

I would like to confirm my understanding of the GPIO setup on the MSP430 - as I am seeing behaviour that suggests that internal Timer A1 functionality takes priority over the GPIO selection for a specific pin.

 

I am using TI's sample application which is using Timer A1 as the source of System Time Scheduling

Link to post
Share on other sites

The table following the schematic may be more informative.

 

If you want to leave P2.2 as a GPIO, make sure BIT2 (0x04) is clear in P2SEL (P2SEL &= ~BIT2).  Then the value of P2DIR & BIT2 determines whether the GPIO is an output (non-zero) or an input (zero).  In this case the settings related to TA1 are irrelevant, and the pin's output value or input behavior is completely disconnected from its peripheral function.

 

If you want to use it as a TA1 peripheral function make sure BIT2 is set in P2SEL (P2SEL |= BIT2).  Then the following two clauses apply:

 

If P2DIR & BIT2 is non-zero then the peripheral function is TA1.1, i.e. the clock output from CCI 1 of TA1.  You might use this, for example, to PWM an LED.

 

If P2DIR & BIT2 is zero then the peripheral function is TA1.CCI1A, i.e. TA1 can be programmed to capture rising and or falling edges of an incoming signal on P2.2 and record the value of TA1's 16-bit clock counter in the corresponding TA1CCR1 register.  You might use this, for example, to determine how wide a measured pulse is.

 

I think what's above at best rephrases what's in the data sheet and user's guide, but perhaps a rephrase will help you understand how to make it do what you want.  I think the answer to your question is that you can use the pin as an input, you just have to make sure the peripheral function is disabled (which it is, based on your description).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...