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

cross mob
chandan1995
Level 1
Level 1
First reply posted First question asked Welcome!
we are using ADC[1]_3 Pin P5.3. for adc reading . but not getting expected results. #define BB_POTI_ANALOG_MACRO PASS0_SAR0 we are using SAR0 , Is it correct ? Please share sample code for Single Channel ADC
0 Likes
1 Solution
Imam_M
Moderator
Moderator
Moderator
50 replies posted 10 likes received 10 solutions authored

Hi @chandan1995 ,

For P5.3 which is connected to ADC[1]_3, Analog Macro to PASS0_SAR0 is not correct. It should be connected to the PASS0_SAR1. Other than that, kindly check the following configuration to make sure your configuration is correct :
- select the correct PCLK source,
- select the correct logical channel,
- select the correct port and pin in adcChannelConfig struct,

To implement that, I suggest you to check the following documents for reference :
- CYT2CL Datasheet -> for checking which clock source that's connected to the ADC SAR, logical channel, and correct port/pin for adcChannelConfig,
- AN219755 Using a SAR ADC in TRAVEO T2G automotive microcontrollers -> for reference to implement this SAR ADC in T2G MCU

I hope this answers your query. Thank you.

View solution in original post

0 Likes
3 Replies
Imam_M
Moderator
Moderator
Moderator
50 replies posted 10 likes received 10 solutions authored

Hi @chandan1995,

Kindly could you confirm which MCU from T2G Family Product that you're using?
For sample code for single channel ADC, you could check on the provided Sample Driver Library (SDL) in folder related-mcu\src\examples\adc\OneChannelConversion_SwTrigger. Thank you.

0 Likes
chandan1995
Level 1
Level 1
First reply posted First question asked Welcome!

we using CYT2CL7BAAQ0AZSGS.

above example only we are using. but not able to read correct value.

0 Likes
Imam_M
Moderator
Moderator
Moderator
50 replies posted 10 likes received 10 solutions authored

Hi @chandan1995 ,

For P5.3 which is connected to ADC[1]_3, Analog Macro to PASS0_SAR0 is not correct. It should be connected to the PASS0_SAR1. Other than that, kindly check the following configuration to make sure your configuration is correct :
- select the correct PCLK source,
- select the correct logical channel,
- select the correct port and pin in adcChannelConfig struct,

To implement that, I suggest you to check the following documents for reference :
- CYT2CL Datasheet -> for checking which clock source that's connected to the ADC SAR, logical channel, and correct port/pin for adcChannelConfig,
- AN219755 Using a SAR ADC in TRAVEO T2G automotive microcontrollers -> for reference to implement this SAR ADC in T2G MCU

I hope this answers your query. Thank you.

0 Likes