Jan 13, 2021
12:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 13, 2021
12:30 PM
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
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
Labels
2 Replies
Jan 18, 2021
12:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 18, 2021
12:44 PM
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?
Thanks,
Eugene Ho
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?
Thanks,
Eugene Ho
Mar 28, 2021
11:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 28, 2021
11:26 PM
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