Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

msp430 and mspgcc individual bit access

Status
Not open for further replies.

im_noob

New Member
I have a simple question about mspgcc if anyone used it.
Most of the PIC compiler allow me to access individual bit of a port, for example:
Code:
 PORTA.F1 = 1;
 PORTA.F1 = 0;
or
 output_high(PORTA, 1);
 output_low(PORTA, 1);

in CSC I can even make struct and do things like:
lcd.enable = 1;

With mspgcc I had no luck finding the similar way of dealing with it. The way I do it now is:
Code:
// definition of BIT# macro's
#include <msp430/common.h>
...
  // set P1OUT.F0 to 0
  P1OUT &= ~BIT0;

  // set P1OUT.F0 to 1
  P1OUT |= BIT0;

But I kinda hope there is "faster" way of doing so :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top