hi there,
i just wrote my first “hello world” programm on easyweb II using the icc430 application builder.
it shall turn on the status-led when pressing B1 and switch the relais 1 when pressing B2.
there is only one problem:
when pressing no button, the status-led blinks and when pressing B1 it is permanently on an the relais is switched. when pressing B2 nothing happens.
so it says “hello world” but its more like “heloh werld”
can you tell me, what i made wrong?
here is my code
//ICC-MSP application builder [F149] : 25.11.2003 22:55:46
//Target 14x device
#include <msp430x14x.h>
#include <msp430def.h>
void clock_init()
{
//DCO=0x00
DCOCTL=0x00;
BCSCTL2=0x00;
BCSCTL1=0x00;
}
void port_init()
{
//P1OUT=0x00;
P1DIR=0x60;
P1IES=0x00;
P1IE=0x00;
P1SEL=0x00;
P2OUT=0x00;
P2DIR=0x02;
P2IES=0x00;
P2IE=0x00;
P2SEL=0x00;
P3OUT=0x00;
P3DIR=0xF0;
P3SEL=0x00;
P4OUT=0x00;
P4DIR=0x0F;
P4SEL=0x00;
P5OUT=0x00;
P5DIR=0x00;
P5SEL=0x00;
P6OUT=0x00;
P6DIR=0x00;
P6SEL=0x00;
}
//call this routine to initialise all peripherals
void init_devices(void)
{
//stop errant interrupts until set up
DINT(); //disable all interrupts
ME1=0X00; //disable sfr peripherals
ME2=0X00;
IE1=0x00; //disable sfr interrupts
IE2=0x00;
//watchdog initialisation including nmi function
WDTCTL=0x5A00 | 0x00;
//initialise other peripherals
clock_init();
port_init();
ME1=0x00;
ME2=0x00;
IE1=0x00;
IE2=0x00;
EINT(); //re-enable interrupts
}
//interrupt handlers
void main(void){
//clock_init();
port_init();
init_devices();
while(1){P2OUT=0x00;
P1OUT=0x00;
while (P4IN & 0x10) {P2OUT=0x02;}
while (P4IN & 0x20) {P1OUT=0x20;}
}
}
thanks a lot
xray