Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216280

Forum Post: RE: MSP430F5529: P1OUT, P5DIR, P5DS, P3SEL

$
0
0
I looked at the documentation and the ports seem to work the same as other microcontrollers. So why are my bits always inverted? For example: #define bit_set(A,B) A |= B // should set bit to a 1 or output 3.3 volts #define bit_clr(A,B) A &= ~B // should output a 0 or zero volts. But they work opposite? bit_set(P1OUT,BIT0); sets to a low bit_clr(P1OUT,BIT0); sets high There are no interrupts or other internal peripherals in use. port initialization below: int main(void) { int i,j,x,y,x0,y0,x1,y1; WDTCTL = WDTPW | WDTHOLD; // Stop wdt P1SEL = 0x0; P2SEL = 0x0; P4SEL = 0x0; P1DIR = 0xFF; P2DIR = 0x0; P4DIR = 0xFC; P5DIR = 0xFF; P6DIR = 0xFF; P7DIR = 0xFF; P8DIR = 0xFF;

Viewing all articles
Browse latest Browse all 216280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>