Other Parts Discussed in Thread: HALCOGEN
Hi,
I'm trying to read TMS570LS20216ASPGE USB Stick Kit's light sensor with ADC. I generated my code with HalCoGen with this steps:
1 - Enable ADC driver
2- Enable MIBADC1 Group1 IRQ (number 15) in VIM channel
3- in "ADC1 Group1 " panel set FIFO size to 1, SW as trigger and Enable continuous conversation mode.
In sys_main.c main function i have added this lines:
adcInit(); // ADC module init
adcEnableNotification(adcREG1, adcGROUP1);
_enable_IRQ();
adcStartConversion(adcREG1, adcGROUP1); // ADC Conversation Start
while(1);
In adcNotification function i have added this lines:
adcGetData(adcREG1, adcGROUP1, adc_data_ptr); // Store conversion into ADC pointer
value = (unsigned int)adc_data_ptr->value;
Of course i define as a global variable adc_data_ptr and value.
Here is my problem. I'm watching ADC1 group1 buffer from register windows of CCS and it seemed ADC interrupt called only once so i could not read continuosly. value variable changed once at the start of my program.
I guess my mistake is about triggering ADC interrupt. I could read ADC continuosly even at single mode conversation mode with starting adc conversation again and again in a while statement.
