Tool/software:
Im back to this ADC code in the new MSPM0G3507 But im not sure if I need
#include "ti/devices/msp/m0p/mspm0g350x.h"
#include "ti/driverlib/dl_adc12.h"
#include "ti/driverlib/dl_common.h" // For DL_Common_delayCycles function
#include "ti_msp_dl_config.h"
#include "IndexMacros.h"
#include "stdio.h"
uint16_t threshold = 1;//16384 / 2; // VCC/2 or 1.15V
int i=0;
int j=0;
int main (void)
{
ADC0->ULLMEM.GPRCM.CLKCFG = 0xA9000000; // ULPCLK
ADC0->ULLMEM.CLKFREQ = 7; // 40-48 MHz
ADC0->ULLMEM.CTL0 = 0x03010000; // divide by 8
ADC0->ULLMEM.CTL1 = 0x00000000; // mode
ADC0->ULLMEM.CTL2 = 0x00000000; // MEMRES
ADC0->ULLMEM.MEMCTL[0] = 3; // channel 3 PA24 ADC1pin
ADC0->ULLMEM.SCOMP0 = 0; // 8 sample clocks
ADC0->ULLMEM.CPU_INT.IMASK = 0; // no interrupt
ADC0->ULLMEM.CTL0 |= 0x00000001; // enable conversions
ADC0->ULLMEM.CTL1 |= 0x00000100; // start ADC
uint32_t volatile delay=ADC0->ULLMEM.STATUS; // time to let ADC start
NVIC->IP[1] = 1<<4; // ADC0 is IRQ 4
NVIC->ISER[0] = 1<<4;
NVIC->IP [1] = (NVIC->IP [1] & (~0xFF000000)) | (2<<6) ;
__enable_irq();
while(1)
{
//ADC0->CTL0 |= ADC0_CTL0_ENC | ADC0_CTL0_SC;
printf("NoData\n");
DL_Common_delayCycles(40000000); // 1/2 sec
j++;
}
}
void ADC0_IRQHandler(void)
{
uint16_t adcRaw = ADC0->ULLMEM.MEMRES[0];
while((ADC0->ULLMEM.STATUS&0x01)==0x01)
{
if(adcRaw>0)
{
i=i+1;
printf("ADC = %d \n", i);
}
}
} a Handler Please TI need input