Jump to content
dchaplinsky

XIN/XOUT as digital outputs

Recommended Posts

It's indeed not clear from the LP schematic if P2.6 and P2.7 are hooked up to the header but I have confirmed that they are by looking at the PCB layout files. The connection is made through R28 and R29 (0 Ohm).

Share this post


Link to post
Share on other sites

Thanks dchaplinsky for the discovery and thanks energia for the fix.

Will be nice to upload the corrected file and save all the task of search-cut-paste.

Share this post


Link to post
Share on other sites

Modified the file hardware/msp430/variants/launchpad/pins_energia.h

 

But when code is verified the following message appears:

Button.cpp:31:23: error: 'XIN' was not declared in this scope

Button.cpp:32:21: error: 'XOUT' was not declared in this scope

 

I used this as declaration, but using P2_6 and P2_7 gives the same error.

const int buttonPin = XIN;

const int ledPin = XOUT;

Using the actual pin number 18 and 19, no compile error.

But when used as OUTPUT, the output goes High one time, but not Low anymore. *Edit: error in code :lol:

 

In the file "hardware/msp430/variants/launchpad/pins_energia.h"

Under section "// Pin names based on the silkscreen" XIN and XOUT, or P2_6 and P2_7, are not mentioned as well.

 

Am i doing something wrong, or is there something else wrong?

 

Thanks

Share this post


Link to post
Share on other sites

You will have to declare the friendly names. Put the following in pins_energia.h under the "Pin names based on silkscreen" section:

 

static const uint8_t P2_7 = 18;
static const uint8_t P2_6 = 19;


static const uint8_t XIN = 19;
static const uint8_t XOUT = 18; // depends on chip

 

By default these pins come up as XTAL pins. If you would like to use them as GPIO pins then put the following snip in your setup() routine:

 

P2SEL &= ~(BIT6|BIT7);

Share this post


Link to post
Share on other sites

THANKS !!

The friendly names work, and also the last code for enabling GPIO to these ports.

I can now use these ports as an Input or Output.

 

Could you include the mods of the pins_energia.h file in next releases ? ;)

Or does this affect the default/actual operation (XTAL) of these pins?

Share this post


Link to post
Share on other sites

I am experiencing the same problem, but my version of pins_energia.h seems to be correct based on the above comments.

I have the latest version of Energia, 0101E0010 with MSP430G2553.

 

The XIN and XOUT pins are not reacting correctly to the digitalWrite commands as the other pins are.  

Watching the pin via LED it pulses while communicating over other pins, like it's "communicating" not acting as the digital on/off I need.

 

Is anyone else still having this issue?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×