TLE9879 Evaluation Kit

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

cross mob
User16615
Level 1
Level 1
Hi,
I am trying to read ADC1 port P2.4. I went to IFXConfigWizard and select Sequence 1 - 6 and select channel 4 (P2.4). If want want to read the ADC only when require how do I do that. Currently I am able to read from the interrupt when I enable Interrupt Channel 4 (P2.4) like the example with Function name called Poti_Handler.
If I use the interrupt enable when I run the motor the motor not able to run properly. Is there any other around this. I do not need to read ADC while I am running the motor.

Thank you,
Eugene
0 Likes
2 Replies
User16615
Level 1
Level 1
Finally I managed to get the ADC working. Below is the code I used

value_valid = ADC1_GetChResult_mV(&mV, ADC1_CH4);

if (value_valid == true)
{
_ADC1 = mV;
}

if (_ADC1 > 3000)
{
PORT_ChangePin(LED7, PORT_ACTION_SET);
}
else
{
PORT_ChangePin(LED7, PORT_ACTION_CLEAR);
}

I configured all the sequencer 1 to Sequencer 6 with Channel 4(P2.4) check. After compiled I am able to read the ADC P2.4.

Do I need to configure sequencer 1 to Sequencer 6 for P2.4?

4892.attach

Thanks,
Eugene Ho
0 Likes
User21498
Level 1
Level 1
Can you help me a bit more? I am trying to repeat the code but with no success. So I need somebody to help me identify where I make a mistake. I am from https://worldpostalcode.com/canada/ontario/. If you are from my time zone and have enough skills to help me, I will appreciate it a lot. So waiting for volunteers who could solve my helpless situation. Many thanks
0 Likes