Other Parts Discussed in Thread: CC2650
Tool/software: TI-RTOS
Hi,
I tried to implement the the example code:
//intialize ADC
Hwi_Params hwiParams;
Hwi_Params_init(&hwiParams);
hwiParams.enableInt = true;
Hwi_construct(&hwi, INT_AUX_ADC_IRQ, adcIsr, &hwiParams, NULL);
// Enable clock for ADC digital and analog interface (not currently enabled in driver)
//AUXWUCClockEnable();
// Set up pins
ADC_pinHandle = PIN_open(&ADC_pinState, alsPins);
AUXWUCClockEnable(AUX_WUC_ADI_CLOCK|AUX_WUC_MODCLKEN0_ANAIF_M); //AUX_WUC_MODCLKEN0_ANAIF_M
Power_setConstraint(PowerCC26XX_SB_DISALLOW);
Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
Power_setConstraint(PowerCC26XX_SD_DISALLOW);
AUXWUCClockEnable(AUX_WUC_ADI_CLOCK|AUX_WUC_MODCLKEN0_ANAIF_M ); //AUX_WUC_MODCLKEN0_ANAIF_M
// Connect AUX IO3 (pin 26) as analog input. see table 11-2 in SWCU117f for pin mapping- our 4X4 package is RSM
AUXADCSelectInput(ADC_COMPB_IN_AUXIO3);
//why is this line crashing the BIOS?
AUXADCEnableSync(AUXADC_REF_VDDS_REL, AUXADC_SAMPLE_TIME_42P6_US, AUXADC_TRIGGER_MANUAL); //AUXADC_REF_VDDS_REL means nominally VDDS as a reference
AUXADCGenManualTrigger(); //reading V1 from ADC on first phase, because at this phase v1 is at the source side electrode terminal
It works from within the JTAG debugger, but it doesn't work when run if powering and running the SW (no JTAG)
it seems to crash on the code line: AUXADCEnableSync(AUXADC_REF_VDDS_REL, AUXADC_SAMPLE_TIME_42P6_US, AUXADC_TRIGGER_MANUAL);
I was told to downport the ADC driver from RTOS 2.2 to RTOS 2.18 and use the driver - but then I couldn't find any driver example.
I've been trying to solve this problem for two weeks by now.
Had any body succeeded using ADC with TI cc2640 from before?
please help
MF