Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

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

cross mob
lock attach
Attachments are accessible only for community members.
NoAr_1540581
Level 5
Level 5
Distributor - Macnica (Japan)
5 solutions authored 250 sign-ins 100 replies posted

Hello

Regarding ADC of PMG1-B1, there is the following description in Datasheet of PMG1-B1.

<Peripherals and GPIOs>

• 2x 8-bit ADCs

• 1x 12-bit ADC

Q)From the above, it is recognized that only three GPIOs with ADC functions can be used, But, Is it possible to use five ADC functions of the attached GPIO at the same time? If possible, please tell me how to set

 

Best Regards

 

0 Likes
1 Solution
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

Please refer to battery_measure.c file in the PMG1-B1 Source Code. 

get_adc_8bit() is the function to use 8bit SAR ADC. You need to provide port and pin information to this function to get the conversion.

To use 12 bit SAR ADC, the pins you had specified in your initial post can directly be used. 12 Bit ADC has total of 8 channels, please refer to Device Configurator. In Device Configurator you can find the ADC configuration, number of channels and other details. Please configure the same as per requirement. You can also refer to same battery_measure.c for usage of this ADC as well. 

Best regards,
Pranava

View solution in original post

0 Likes
5 Replies
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

It is definitely possible to measure 5 voltages using the different GPIOs one after the other. May I know if you want to measure 5 cell voltages for cell monitoring or if you require this for general-purpose measurement? Based on your response I can suggest you the configuration.

Best regards,
Pranava
0 Likes
NoAr_1540581
Level 5
Level 5
Distributor - Macnica (Japan)
5 solutions authored 250 sign-ins 100 replies posted

Hello

Thank you for your reply.

Configuration is below.

1.  Voltage monitor x1

2. Temperature moniter x3

3. Other: Communication

 

Best Regards

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

Please refer to battery_measure.c file in the PMG1-B1 Source Code. 

get_adc_8bit() is the function to use 8bit SAR ADC. You need to provide port and pin information to this function to get the conversion.

To use 12 bit SAR ADC, the pins you had specified in your initial post can directly be used. 12 Bit ADC has total of 8 channels, please refer to Device Configurator. In Device Configurator you can find the ADC configuration, number of channels and other details. Please configure the same as per requirement. You can also refer to same battery_measure.c for usage of this ADC as well. 

Best regards,
Pranava
0 Likes
NoAr_1540581
Level 5
Level 5
Distributor - Macnica (Japan)
5 solutions authored 250 sign-ins 100 replies posted

Hello

Thank you for your reply.

Could not find ”battery_measure.c”. Please tell me the direct reference link on the web

Best Regards

0 Likes

Hi,

Currently, the PMG1-B1 project is not released on the web. Please let me know the project are you using. 

Best regards,
Pranava
0 Likes