Jump to content
Sign in to follow this  
none

MSP430G2231 IO pull-up/-down resistors - good for anything?

Recommended Posts

I just spent some time trying to figure out why my button was not detected properly when polling as soon as I disabled the TimerA compare unit output on Port1* - it seems this had an effect on the load of the pull-down resistors (35+/- 15 kOhm) so the level did not go below hysteresis threshold.

This means the inputs are pretty low impedance - and then: what good are those 'weak' resistors?

 

 

*By port function select, which is a Timer_A register. SLAU144h:

NOTE: Modifying Timer_A Registers

It is recommended to stop the timer before modifying its operation (with exception of the

interrupt enable, and interrupt flag) to avoid errant operating conditions.

Share this post


Link to post
Share on other sites

I'm not sure about your question regarding the timer, but I've found the internal resistors to work great for I2C communications, and they allowed me to eliminate an external pullup resistor from my midi input circuit.

 

I'm a little confused about your question regarding the timer in output mode. The internal resistors are generally used on input pins. They need to be weak enough so the pin with the internal pull-up can be set low by an external device. Same with pins pulled-down internally -- an external device should be able to set them high.

 

Is this an answer to your question?

Share this post


Link to post
Share on other sites

Thanks for your reply. I just expected the pin to be pulled below low-level when the internal resistor is activated and the pin left open (as input). And I thought this was actually happening, until I found out that it was merely by chance (chance being the timer compare output connected to a pin of the port).

Share this post


Link to post
Share on other sites

It should work the way you say, so I wrote something quick to test it.

 

#include 

void main(){	
DCOCTL = CALDCO_1MHZ;
BCSCTL1 = CALBC1_1MHZ;

WDTCTL = WDTPW + WDTHOLD;

P1DIR &= 0x00;				// all pins input
P1REN |= 0xFF;				// enable all internal resistors
while(1){
	P1OUT |= 0xFF;			// set all internal resistors pull-up
	if(P1IN != 0xFF)		// test if all are actually pulled high
		while(1);			// pin(s) are low, fail, hold here

	P1OUT &= 0x00;			// set all internal resistors pull-down
	if(P1IN != 0x00)		// test if all are actually pulled low
		while(1);			// pin(s) are high, fail, hold here
}
}

 

I ran this on my launchpad, and it fails on the second test -- the pull-down test. It looks like pins 1.1, 1.2, and 1.3 were staying high. I pulled the TXD and RXD jumpers, and that fixed pins 1.1 and 1.2. Something on the emulator side must have been pulling them high. As for 1.3, I think the button debounce resistor is pulling it high.

 

I think the other pins should work as you expect. Now that I think of it, this may have been mentioned on the forum before.

 

Changing the second test to this stopped the blocking:

P1OUT &= 0x00;			// set all internal resistors pull-down
	if((P1IN & ~0x0E) != 0x00)		// test if all (except 1.1, 1.2, 1.3) are actually pulled low
		while(1);	

Share this post


Link to post
Share on other sites

About these jumpers: because the serial level is high by default, even if the vcc jumper is unplugged, it may not power cycle the microcontroller because it gets its power through the other lines..

And the jumpers are also the reason why the reset button does not do anything..the debugger keeps control..

Share this post


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.

Sign in to follow this  

×
×
  • Create New...