Skip to content

Instantly share code, notes, and snippets.

@trtg trtg/blink.c
Last active Oct 9, 2018

Embed
What would you like to do?
msp430 launchpad sample code to blink LED 1
@HuanyuZang

This comment has been minimized.

Copy link

HuanyuZang commented Sep 25, 2017

//set up bit 0 of P1 as output
P1DIR = 0x01;

I didn't see any evidence that shows bit 0 of P1 is chosen
If I choose bit 2 or 3? What's the code look like?

@karlpetersonn

This comment has been minimized.

Copy link

karlpetersonn commented Dec 28, 2017

0x01 is in hex, in binary that's 0000 0001. So, what the line:
P1DIR = 0x01;
is saying is set bit 0 in port 1 direction register high. This sets the P 1.0 to an output pin.

If you said something like 2 or 3 the code wouldn't run because you are trying to output on P 1.0.

TI actually makes this a little easier by defined all the bits in header file so for example you could write this:
P1DIR |= BIT0;
Instead of:
P1DIR = 0x01;

@pvsivakrishna

This comment has been minimized.

Copy link

pvsivakrishna commented Oct 9, 2018

Can you pls give an idea regarding interfacing Bluetooth with msp430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.