Browse Source

edite el codigo

master
GrisC 2 years ago
parent
commit
c848d1ff8b
1 changed files with 20 additions and 19 deletions
  1. +20
    -19
      Guía de usuario MSP430 GCC Toolchain.md

+ 20
- 19
Guía de usuario MSP430 GCC Toolchain.md View File

@ -1,6 +1,6 @@
# Guía de usuario MSP430 GCC Toolchain
Galván.A , Chváez.G , Julio,2022.
Galván.A , Chávez.G , Julio,2022.
------
@ -102,24 +102,25 @@ $ pico Ejemplo.c
A continuación, se muestra el programa copiado en la ventana que se abrió con el comando *pico*.
```c
#include <msp430fr6989.h>
int main(void) {
volatile int i;
// stop watchdog timer
WDTCTL = WDTPW | WDTHOLD;
// set up bit 0 of P1 as output
P1DIR = 0x01;
// intialize bit 0 of P1 to 0
P1OUT = 0x00;
// loop forever
for (;;) {
// toggle bit 0 of P1
P1OUT ^= 0x01;
// delay for a while
for (i = 0; i < 0x6000; i++);
#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();
}
}
}
[ 26 líneas leídas ]


Loading…
Cancel
Save