Hi,
I´m facing a problem while using both, the ADC and the COMPB, in my Sensor Controller tasks.
For better understanding, here a brief description of my setup:
Like you see in the picture, i have 2 tasks on my sensor controller, one does some pressure measurement (DIO 23&24) and the other only measures the input of one analog pin (DIO30) with the COMPB and compares it eith an internal voltage. The pressure sensors are, at this time, replaced with potentiometers for testing purpose.
Now to my problem:
When I only run the comparator task, everything works as expected, the DIO30 gets measured, is compared with an intern voltage and i can read the comparator output via scifTaskData.comparator.output.charging in the main program.
When both tasks are activated, it seems like positive input of the comparator is using the value of the ADC, so it doesn´t compare DIO30, but it compares DIO24 (i first measure DIO23 and then DIO24 in the measurement task) with the reference. I think it has something to do with the shared input of the adc and the comparator. It also makes no difference, which task is the first to run.
Is there a way to fix this problem, or do I have to use the COMPA, when using the adc on the Sensor Controller?