Operating XMC1300 ADC in slow standby mode

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

cross mob
User8683
Level 4
Level 4
First like received
Hello,

I have been fighting to get the ADC to operate in "slow standby" mode on an XMC1300 as defined in section 16.5.1 of the reference manual because I am taking infrequent measurements and would like to save power.

Can someone please provide some low level code indicating the steps in order? The reference manual is proving insufficient detail to do this.

What I am finding is that using this code results in zero value measurements:


// Converter is running
WR_REG( VADC_G0->ARBCFG, VADC_G_ARBCFG_ANONC_Msk, VADC_G_ARBCFG_ANONC_Pos, 3 );

// Start calibration
SET_BIT( VADC_G0->GLOBCFG, VADC_GLOBCFG_SUCAL_Pos );

// Await completion of calibration
while (RD_REG( VADC_G0->ARBCFG, VADC_G_ARBCFG_CAL_Msk, VADC_G_ARBCFG_CAL_Pos ) == 1) {};

// Converter is running only when requested
WR_REG( VADC_G0->ARBCFG, VADC_G_ARBCFG_ANONC_Msk, VADC_G_ARBCFG_ANONC_Pos, 1 ); //Both 2 and 1 have been tried without luck, 3 works without savings

// Enable conversion based on ANONC settings
WR_REG( SHS0->SHSCFG, SHS_SHSCFG_SCWC_Msk | SHS_SHSCFG_ANOFF_Msk, SHS_SHSCFG_ANOFF_Pos, 8 );


Thanks,

Jason
0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
Eric1
Employee
Employee
Dear Jason,

I assume the reason is the wake up time for the analog part of the ADC.
The wake up time is approximately 15us.
To compensate the wake up time you can extend the sampling time.

Atached a project to do so:

* This example shows the use case of Slow Standby mode (ANONS = 01B).
* The converter enters a power save mode while no activity is required. It automatically
* returns to normal operation if a conversion is requested.
* The wake up time is approximately 15μs.
* (With the APP the sampling time is set to ~15us.)
*
* The PWM_CCU4_0 is gating the ADC measurement with 1 Hz and 50% DC. So the project is sampling 500ms and 500ms in power down.
* In the picture output.jpg you can see that the ADC resultA is not changed in the first half and permanently updated in the second half.
*
* The CCU4_1 is capturing the Timer value and the ADC resultA in a 1kHz time frame. Also the uC Probe update is handled in this ISR.
*
* As input the Potentiometer at P2.5 at the BootKitXMC1300 is used.

Best Regards
Eric
0 Likes