...
- All code running on our electrical system is written in C. It would be a good idea to become familiar with C before continuing with this tutorial. You can find many resources online about programming in C such as this one.
- Code Composer Studio (CCS) should be installed.
- A MSP430 EXP430F5529LP Launchpad. (There is some available in the bay to use or you can purchase your own here).
- Read Clearing, Toggling, Setting, and Checking a Bit.
- MSP430F5529 datasheets
Setting up a project
Go to the top menu bar and click File->New->CCS Project. The dialog that appears should look something like this:
...
I've already explained the PxOUT
and PxDIR
registers, so we'll skip over them and look at the for loop. In the for loop, we are toggling bit 0 of P1OUT
using the XOR operator (See Clearing, Toggling, Setting, and Checking a Bit) and then we call a special function, __delay_cycles
.
...