Tool/software: Code Composer Studio
Hello everyone, I have a question about the msp430 board. I am doing a frequency meter(which is working), but I want to switch the input on the LCD with the button P1.3 but there is one problem I try to activate the P1.3 pull-up resistor cuz without it the LCD just switches back and forward between two states in a switch statement.
static unsigned clock_input = 0; //TBC void set_input(void) { lcd_init(); // const unsigned char z = 0; switch(clock_input) { default: clock_input = 0; case 0: TACTL = TASSEL_2; break; case 1: TACTL = TASSEL_1; break; } }
this is the switch statement
if(!(P1IN&BIT3)) {
clock_input++;
set_input();
}
and this is how I want to switch between TASSEL_1 and TASSEL_2.
ill show you pictures
sorry for the quality on this one but here the LCD is showing the internal frequency no problem, but it's constantly switching between 32kHz and the 1MHz frequency from TASSEL_2(1MHz).
I think the problem is that the pull up is not defined and its switching between the two statements.
but when I insert the code for the pull-up
P1OUT |= BIT3;
P1REN |= BIT3;
The code loses its mind and random symbols start to appear just by adding the P1REN line. I am trying to figure this out for hours and I really have no idea whats the problem.