ADC001 Channel Events

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello im trying to do ADC conversions on 2 channels continuously. After a conversion is finished i want to read out the results. It works fine if i map the signal "Global Result Event" to a NVIC002.

Then i wanted to split it to 2 different interrupts (one for channel AA and one for channel BA) and mapped "channel AA event" and "channel BA event" to a NVIC002 interrupt node and its not working anymore because there are no channel events generated. When i set a channel event by software (ADC001_SetChannelEvtFlag (&ADC001_Handle0, &ADC001_ChannelAAHandle)) it directly jumps to the interrupt routine.


my Program is more or less like this:
int main(void)
{
DAVE_Init(); // IO004_Init() is called within DAVE_Init()
ADC001_GenerateLoadEvent((ADC001_HandleType*)&ADC001_Handle0);
ADC001_SetChannelEventMode((ADC001_HandleType*)&ADC001_Handle0, &ADC001_ChannelAAHandle,
ADC001_CHANNEL_EVENT_ALWAYS);
ADC001_SetChannelEventMode((ADC001_HandleType*)&ADC001_Handle0, &ADC001_ChannelBAHandle,
ADC001_CHANNEL_EVENT_ALWAYS);


while(1){
//With this line it works, therefore no events are generated?
//ADC001_SetChannelEvtFlag (&ADC001_Handle0, &ADC001_ChannelAAHandle);
}
}

//Interrupt Routine
void myADCInterrupt0(void){
while(1);
}

Thanks for your help
Werner
0 Likes
5 Replies
Mike1
Employee
Employee
5 sign-ins First question asked 10 replies posted
Hi Werner,

You must enable the particular channel event that you want to cause the interrupt. This is done in the ACDCH001 GUI in the "Advanced Channel Configurations" tab by selecting the "Channnel Event Mode". I believe in your case, you are not using the limit checker, so you would select "Always" in this box.

Best regards,
Mike
0 Likes
Not applicable
Thanks for your answer Mike. But this will not work with ADC001 app or? I got it to work with the ADC003 (There you have a ADCCH001 app included).
0 Likes
Mike1
Employee
Employee
5 sign-ins First question asked 10 replies posted
Sorry for the misuderstanding. Have you tried using an NVIC001 App instead?
0 Likes
Not applicable
Hi Werner,
I'm experiencing the same problem using 2 ADC's. Did you manage to solve the problem?
I'm trying to read multiple ADC and use the values to set a PWM but I could only get it work with 1 ADC.

Best Regards.
0 Likes
Not applicable
Sounds like you are looking for ADC002 functionality.
You can setup two channels with the start mode of cancel inject repeat and in the queue configuration check the source interrupt and refill boxes.
After this you will be able to connect interrupt signals from the ADC002 app to an NVIC002 apps to connect to your interrupt handlers.
0 Likes