11/4/2022 0 Comments Msp432 tutorialP1DIR |= BIT6 //Same as above, use Standard BIT definitions P1DIR |= (1<<6) //(binary using left shift - OR and assign: other pins not affected)ĬASE 4. P1DIR |= 0x20 //or 0x20 (hexadecimal - OR and assign: other pins not affected)ĬASE 3. P1DIR = (1<<6) //(binary using left shift - direct assign: other pins set to 0)ĬASE 2. Lets say, we want to set PIN 6 of Port 1 as output. If your compiler supports other notations like binary notation use can use that too. We can use Hexadecimal notation & decimal notation for assigning values. Now lets see how we can assign values to registers. Where BITn is equivalent to (1<<n) i.e the nth bit location is a 1 and rest bits are 0s. Each of the device specific headers also include bit definitions viz. This header identifies your device and accordingly includes the device specific header. Msp430.h is common header for all MSP430 devices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |