Other Parts Discussed in Thread: MSP430FR6877
Greetings,
I am trying to work with MSP4133 in LPM4 mode for a power conscious operation, for this I am using an external crystal oscillator of 32.768khz.
The required functionality is as follows.
There are two microcontrollers in my module, connected by UART.
When a button is pressed on another microcontroller (MSP430fr6877) , it sends a certain symbol/character over uart to 4133 module. The 4133 module has 2 screens, 1 - total liters 2 - flowrate,
On receiving this character, the 4133 module should display the second screen for some time and then jump back to the default screen i.e., screen 1. However, when the character is received the 2nd screen is coming up blank, and after the time elapses it goes back to the default screen. When i tried pausing the program after pressing button on the other controller,the program stops into fs_add.asm or fs_div.asm.
i changed all the float variables to Integer still the issue persists.
here is the related code
//UART Interrupt
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_A1_VECTOR))) USCI_A1_ISR (void)
#else
#error Compiler not supported!
#endif
{
__bic_SR_register_on_exit(LPM4_bits);
switch(__even_in_range(UCA0IV, USCI_UART_UCTXCPTIFG))
{
case USCI_NONE: break;
case USCI_UART_UCRXIFG:
while(!(UCA0IFG&UCTXIFG));
gucrcvChar = UCA0RXBUF;
gucRxBuffer[guiRXIndex] = gucrcvChar;
if(gucrcvChar=='*') //Loop for switching between flowrate and current litres.
{
displayflowrateflag^=1;
if(displayflowrateflag==0)
{
flowrateDisplay_Count=0;
LCDM7 |= 0x00;
LCDM13 = 0x00;
LCDM10 |= 0x00;
}
//clear_data();
count=1;
}
// guiRXIndex++;
break;
case USCI_UART_UCTXIFG: break;
case USCI_UART_UCSTTIFG: break;
case USCI_UART_UCTXCPTIFG: break;
}
}
// display loop.
while(1)
{
if ((gulPulseTimeCount > (RefPulseTimeCount * 2)) && ((RampFlag==1) || (RPMRampFlag==1)))
{
tempFloat = 0;
PtoPFlowrate=0;
RPM_flowrate=0;
tempIndex = 0;
RPM_tempindex=0;
start_timer=0;
PtoPstart_timer_flag=0;
avgarr[0] = 0;
avgarr[1] = 0;
avgarr[2] = 0;
avgarr[3] = 0;
avgarr[4] = 0;
RPMavgarr[0] = 0;
RPMavgarr[1] = 0;
RPMavgarr[2] = 0;
RPMavgarr[3] = 0;
RPMavgarr[4] = 0;
gulPulseTimeCount = 0;
//pulseofftime = 0;
// RampFlag = 0;
// RPMRampFlag=0;
}
if(guc_SetupMode)
{
setup_Mode(); //setup mode to edit the scale factor
}
if(gucReset_TT_Flag)
{
gucReset_TT_Flag = 0;
SYSCFG0 &= ~PFWP; // Program FRAM write enable
FRAM_gud_TT_LTR = 0;
SYSCFG0 |= PFWP; // Program FRAM write protected (not writable)
wait();
}
if((gui_dispParameter==1) && (guc_SetupMode==0) && (displayflowrateflag==1) && (flowrateDisplay_Count<=25000))
{
if((PtoPFlowrate > Min_flowrate) && (start_timer >= 200))
{
tempFloat=RPM_flowrate;
_nop();
}
else
{
tempFloat= PtoPFlowrate;
}
if(count)
{
clear_data();
count=0;
}
display_flow(tempFloat);
}
if((gui_dispParameter==1) && (guc_SetupMode==0) && (displayflowrateflag==0))
{
display_Total((unsigned long int)FRAM_gud_TT_LTR);
}
__bis_SR_register(LPM4_bits | GIE);
__no_operation(); // For debugger
}
}
I would highly appreciate your input.
Regards
Pratik.