Dear All,
I am new on MSP432 and embedded systems. I will start to new project about differantial voltage measurement and i will visualise on Labview but firstly,
I tried to combine two example code from MSPWARE.
First one is ADC14 single differential 2's complement code.
Second one is 12 Mhz Uart Echo code.
1.This two code from driverlib examples and i enable and define EUSCIA0_IRQHandler and ADC14_IRQHandler from startup file.
2. I copied to uart configuration enabling and interrupt settings to ADC14 code from Echo code.
I want to see ''result'' value in my terminal.
How can i combine this parts.
Thank you.
/* This interrupt happens every time a conversion has completed. Since the FPU
* is enabled in stacking mode, we are able to use the FPU safely to perform
* efficient floating point arithmetic.*/
void ADC14_IRQHandler(void)
{
uint64_t status;
status = MAP_ADC14_getEnabledInterruptStatus();
MAP_ADC14_clearInterruptFlag(status);
if(status & ADC_INT0)
{
adcResult = convertToFloat(MAP_ADC14_getResult(ADC_MEM0));
}
}
/* Converts the ADC result (14-bit) to a float with respect to a 3.3v reference
*/
static float convertToFloat(uint16_t result)
{
int32_t temp;
if(0x8000 & result)
{
temp = (result >> 2) | 0xFFFFC000;
return ((temp * 3.3f) / 8191);
}
else
return ((result >> 2)*3.3f) / 8191;
}
/* EUSCI A0 UART ISR - Echoes data back to PC host */
void EUSCIA0_IRQHandler(void)
{
uint32_t status = MAP_UART_getEnabledInterruptStatus(EUSCI_A0_BASE);
MAP_UART_clearInterruptFlag(EUSCI_A0_BASE, status);
if(status & EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG)
{
MAP_UART_transmitData(EUSCI_A0_BASE, MAP_UART_receiveData(EUSCI_A0_BASE));
}
}