I'm porting some software from Microchip PIC (using the HI-Tech C Compiler) to TI MSP430, and in the existing code they access the pins directly with something like:
RA1 = 1;
Is there a similar way to do this with the MSP430, or do I have to write to the entire input/output register each time? If it is not possible has any one come up with a good equivalent? I am using Code Composer Studio v5.3 and the compiler that comes with that.
Best Answer
In the MSP430, accessing individual pins is commonly written using defines and bitwise operators:
Be sure to include the proper header file for your specific chip that contains the port and pin (
BIT#
) defines.