Tips of the day: XMC4500, VADC Result register for debugging

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

cross mob
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
143.attach

Each result register has an individual data valid flag (VF) associated with it. This flag indicates when “new” valid data has been stored in the corresponding result register and can be read out.


if (G0RES1.VF) // Check if there is a valid result in ADC_Ch1
{
Buffer = G0RES1.RESULT; // Read ADC_Ch1 result and VF flag is cleared after read
}

When a result register is read via the application view, the corresponding valid flag is automatically cleared when the result is read. This also happened when you are montitoring the ADC result register which will affect the flow of your software (Buffer will never gets updated).

Thus to prevent such misunderstanding during software debugging, it is most advisable to use the "VADC Group Result register, debug" (GxRESDy) when you are monitoring the ADC results.
0 Likes
0 Replies