#6 El código en C no funciona

Closed
opened 1 year ago by gmarx · 0 comments
gmarx commented 1 year ago
Owner

El código en C compila pero no hace nada. Lo probe en un Launchpad F5529 y la única forma de hacer lo funcionar fue eliminar la línea de código PM5CTL0 = 0x0000; // disable high impedance mode: 👎

#include <msp430fr6989.h> 
void main(void)
{
	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer
	//PM5CTL0 = 0x0000;		// disable high impedance mode
	P1DIR = 0x01;   		//set up bit 0 of P1 as output
	P1OUT = 0x00;  			//initialize bit 0 of P1 to 0
	
	for(;;){    			//loop
	    volatile unsigned int i;
	    P1OUT ^= 0x01;  		//toggle bit 0 of P1
	    				//Delay
	    for(i=40000; i>0;){
	        i--;
	        __no_operation();
	    }
	}
}

El código en C compila pero no hace nada. Lo probe en un Launchpad `F5529` y la única forma de hacer lo funcionar fue eliminar la línea de código `PM5CTL0 = 0x0000; // disable high impedance mode`: 👎 ``` #include <msp430fr6989.h> void main(void) { WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer //PM5CTL0 = 0x0000; // disable high impedance mode P1DIR = 0x01; //set up bit 0 of P1 as output P1OUT = 0x00; //initialize bit 0 of P1 to 0 for(;;){ //loop volatile unsigned int i; P1OUT ^= 0x01; //toggle bit 0 of P1 //Delay for(i=40000; i>0;){ i--; __no_operation(); } } } ```
gmarx closed this issue 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.