Hi,
I am using the sequence conversion sample to test HSADC on KV58F and works fine...
Then, I want to use the scan end interrupt in stead of polling. I can't make the interrupt to work.
When I use software to trigger the conversion and I can see the scanA end already generated, but no the interrupt routine is called...
Could you tell me why? How to make the interrupt to work?
Thanks,
Christie
Hi Christie,
You may need to add below codes:
void HSADC0_CCA_IRQHandler(void)
{
HSADC_ClearStatusFlags(DEMO_HSADC_BASEADDR, kHSADC_ConverterAEndOfScanFlag);
}
EnableIRQ(HSADC0_CCA_IRQn);
HSADC_EnableInterrupts(DEMO_HSADC_BASEADDR, kHSADC_ConverterAEndOfScanInterruptEnable);
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
----------------------------------------------------------------------------------------------------------------------
Hi Robin,
I did the same as what you said and can't trigger the scan end interrupt.
1) Then I add
" HSADC_EnableSampleResultReadyInterrupts(INETVU_HSADC0_BASEADDR, 0x0400, true);" for the last channel(11)
and it works.
2) If I disable "HSADC_EnableInterrupts(DEMO_HSADC_BASEADDR, SADC_ConverterAEndOfScanInterruptEnable);"
and it works as well...
I do not know if I use "scanEndInterrupt" in sequence scan? And what is your suggestion?
Thanks,
Christie
Would you please tell me which channel are you using? HSADC0A or HSADC0B
If you connect external signal to PTE3, then you may need to :
void HSADC0_CCB_IRQHandler(void)
{
HSADC_ClearStatusFlags(DEMO_HSADC_BASEADDR, kHSADC_ConverterBEndOfScanFlag);
}
EnableIRQ(HSADC0_CCB_IRQn);
HSADC_EnableInterrupts(DEMO_HSADC_BASEADDR, kHSADC_ConverterBEndOfScanInterruptEnable);
The Conversion complete interrupts and Scan interrupts are different. Please read "41.6 Interrupts" in KV5XP144M240RM.
HSADC_EnableInterrupts can be used to enable Conversion complete interrupts.
HSADC_EnableSampleResultReadyInterrupts is used to enable Scan interrupts.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Robin,
I connect as follows:
HSADC0A ch0-->Pin18
HSADC0A ch1-->Pin19
HSADC0A ch2-->Pin27
HSADC0A ch3-->Pin28
HSADC0A ch4-->Pin37
HSADC0A ch5-->Pin38
HSADC0A ch6-->Pin23
HSADC0A ch7-->Pin24
HSADC0B ch3-->Pin82
HSADC0B ch4-->Pin45
HSADC0B ch5-->Pin46
I am using the sequential scan.
If I enable "HSADC_EnableInterrupts(DEMO_HSADC_BASEADDR, SADC_ConverterAEndOfScanInterruptEnable);",
the interrupt will not be generated. But I can see there is the scan end status if I check the state register.
Only way to generate the interrupt is enable any sample interrupt by using " HSADC_EnableSampleResultReadyInterrupts(INETVU_HSADC0_BASEADDR, 0x0400, true);"
I do not know why the scan end interrupt does not work in this case?
Thanks,
Christie
Hi Robin,
Do you have any update on this?
Please let me know what you find?
Thanks,
Christie