Ali Shah wrote:

SetupP1:
            bis.b   #0x05, &P5DIR            ; P5.4  output
            bis.b   #0x06, &P5DIR            ; P5.5  output
            bis.b   #0x07, &P5DIR            ; P5.6  output

#0x05 == 0000_0101 in binary
#0x06 == 0000_0110 in binary
#0x07 == 0000_0111 in binary

So it seems your intention is
             bis.b   #(BIT4+BIT6+BIT7), &P5DIR ; P5.4-6  output

BITx are predefined constants in <common.h>.


            mov.b   #llo(0xFFFF), &P5OUT     ; Toggle off P5

P5OUT is a byte register.
             mov.b   #0xFF, &P5OUT             ; Toggle off P5



Let me give you one hint: C-Compilers are great. They generate very good code - especially for the MSP430 which is a C-friedly architecture. Even a good software engineer has to do a hard job to generate better code than a C-compiler. Therefore: Use C! It makes development much faster and less error-prone ad results often in even better code than handmade assembler. And if you look into the disassembled code after C compilation and find some not so good parts of code then MSPG430-gcc offers a very good inline assembler that can be used to replace inefficient C instructions.

Ralf

Reply via email to