This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC43x ADC conversion done IRQ

Other Parts Discussed in Thread: HALCOGEN

Hi! 

Iam training with TMS570 and right now my goal is to learn how to set up and use ADC1group1 conversion ready IRQ. 
In HALCOGEN i have set up following:

Enable ADC1 driver,

set cycle time,

enable pin 9 (ambient light sensor on HDK)

VIM channel 0-31 i have enabled ADC1 Group 1 IRQ

My main looks like this:
- in endless loop i start conversion and then there is hudge dummy wait time (decrementing i) where i only test if flag == 1;. flag is my global variable that i set to 1 in void adc1Group1Interrupt(void) that is part of HL_adc.h library. When debugging, i have found out that program never go into that handler ... why? 

Am I missing something? I have allowed IRQ globally in init part of main. Do i have to allow that specific IRQ "locally" ?

Thanks a lot for your answer
regards

Jan Slavotínek

Honeywell aerospace technical support


void main(void)
{
/* USER CODE BEGIN (3) */
	sciInit();      	/* initialize sci/sci-lin    */
						/* even parity , 2 stop bits */
	adcInit();
	_enable_IRQ_interrupt_();
	/*_enable_interrupt_();*/
	while(true)
	{
		adcStartConversion(adcREG1, adcGROUP1);
		/*
		while((adcIsConversionComplete(adcREG1,adcGROUP1))==0);
		adcGetData(adcREG1, adcGROUP1,&adc_data);
		ConvertSendValue(adc_data.value);
		*/
		i = 10000000;
		while(i--)
		{
			switch(flag)
			{
			case 1:
				flag = 0;
				adcGetData(adcREG1, adcGROUP1,&adc_data);
				ConvertSendValue(adc_data.value);
				break;
			default:
				break;
			}

		}
	}
/* USER CODE END */
}