Jump to content
43oh

reme

Members
  • Content Count

    6
  • Joined

  • Last visited

Reputation Activity

  1. Like
    reme reacted to RobG in msp430 development kit   
    What is the name of this board?
    P2.4's brightness suggests weak pull resistor (make sure JP3 is in off position) or possible mistake in code (0x10 instead of 0x01.)
    Looking at the picture, P2.0 switch is most likely SW23. Also, can you changing JP5 to off and see if the switch works?
     
    EDIT: OK, I found the schematic. There are some other things connected to P2.0 but above steps should work.
  2. Like
    reme reacted to RobG in msp430 development kit   
    Try this:
    int main( void ) { WDTCTL = WDTPW + WDTHOLD; P2REN |= 0x01; P2OUT |= 0x01; P1DIR = 0xFF; P1OUT = 0x00; while(1){ if(P2IN & 0x01){ P1OUT = 0xFF; gecikme(); } else { P1OUT = 0x00; gecikme(); } ?} } BTW, is your switch connected to P2.0 and GND?
  3. Like
    reme reacted to RobG in msp430 development kit   
    P2SEL is only set for BIT6 and BIT7, so there's no need to clear it for BIT1.
    Do while(1) {.....} to have infinite loop, the if() statement to detect button. Since your button is grounded, use pull up resistor, P2OUT |= 0x01;
  4. Like
    reme reacted to RobG in msp430 development kit   
    How is your button connected?
     
    As for your code, here are some notes
    int maint(void) { //P2SEL &= ~0x01; // those 2 lines are not necessary //P2DIR &= ~0x01; P2REN |= 0x01; P2OUT |= 0x01; //this is necessary if your switch is connected to GND while (P2IN & 0X01) { // this will never execute (unless your switch is connected to Vcc and you are holding in down when starting to run,) pull resistor is set to pull-down, so P2IN & 0x01 is always false } return 0; }
×
×
  • Create New...