Exact GPIO pin number in HAL_ADC example

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

cross mob
bemale
Level 3
Level 3
100 sign-ins 50 sign-ins 25 sign-ins

Dear Cy,

I can read adc value via HAL_ADC example with CYW920706 board.

However, It's not clear which gpio pin is connected to adc channel corresponding.

For example, If I use "GPIO_4/LPO_IN/P6/P31 " to read some adc value, which adc channel is matched?

It seems like "ADC_INPUT_P31" is matched to the gpio according to "adc_cs.h" as below

ADC_INPUT_P31 = 0x17, // ADC CHANNEL #24 on GPIO P31

But, it shows different result as my test.

So, Please let me know matching table between GPIOs and ADC_INPUT.

Thanks,

Jace

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @bemale ,

You can find the mapping table from the ADC_INPUT_CHANNEL_SEL enum section in \mtb_shared\wiced_btsdk\dev-kit\baselib\20706A2\latest-v3.X\COMPONENT_20706A2\include\internal\adc_cs.h file.

The mapping that you have shown in the example is correct. There are no mistakes in that. P31 is mapped to channel 24.

Please note that this particular pin P31 is connected to PUART TX and it is better if you use some other pin for ADC input if you require both ADC and UART in your application.  Can you please let us know your observation.

Please check the Kit user guide for details on the usage of GPIO_4/LPO_IN/P6/P31 pin 

https://www.cypress.com/file/378381/download

Regards,
Bragadeesh

View solution in original post

1 Reply
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @bemale ,

You can find the mapping table from the ADC_INPUT_CHANNEL_SEL enum section in \mtb_shared\wiced_btsdk\dev-kit\baselib\20706A2\latest-v3.X\COMPONENT_20706A2\include\internal\adc_cs.h file.

The mapping that you have shown in the example is correct. There are no mistakes in that. P31 is mapped to channel 24.

Please note that this particular pin P31 is connected to PUART TX and it is better if you use some other pin for ADC input if you require both ADC and UART in your application.  Can you please let us know your observation.

Please check the Kit user guide for details on the usage of GPIO_4/LPO_IN/P6/P31 pin 

https://www.cypress.com/file/378381/download

Regards,
Bragadeesh