Hello,
First i have a problem with a simple program. (I have the same in a bigger code, so first i tried it in a smaller one..)
First code with if:
#include <msp430G2153.h>
void main(void){
WDTCTL = WDTPW | WDTHOLD;
BCSCTL1 = CALBC1_16MHZ;
DCOCTL = CALDCO_16MHZ;
P1DIR |= BIT0;
P1SEL = 0x00;
while(1){
if(P1IN & BIT1)
P1OUT |=BIT0;
else
P1OUT &= ~BIT0;
}
}
The picture from osc.:
Second code with an interrupt.
#include <msp430G2153.h>
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
P1OUT ^= BIT0;
P1IFG &= ~BIT2;
P1IES ^= BIT2;
}
void main(void){
WDTCTL = WDTPW | WDTHOLD;
BCSCTL1 = CALBC1_16MHZ;
DCOCTL = CALDCO_16MHZ;
P1DIR |= BIT0;
P1SEL = 0x00;
P1IFG &= ~BIT2;
P1IE |= BIT2;
_enable_interrupts ();
while(1){
}
}
The picture from the osc.:
My Question: Why is there a little interrupt after the low-high edge?
My second question is, when i will compile my code in ccs5 there occurs an error:
"10010 errrors encountered during linking; project.out not built
"#10099-D program will not fit into"
It is only when i have a "if" with more than 2 conditions like: if(a==0 && b==1 && c<=5){}
I am very thankfull for any answers ;)
Best regards