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

XMC™ Forum Discussions

RValascho
Employee
Employee
5 questions asked First question asked 10 replies posted
I am working in Keil, I have stripped the DAVE code down to register settings for compact size. I have a XMC4400 hex board and a customer target board. The difference between the two is that the hex board has an AB step device and the customer board has an AA step device. On the hex board, the ADC runs fine. On the customer target board, we are getting hung up on the following code:

// Bring Module out of Disabled State
CLR_BIT( VADC->CLC, VADC_CLC_DISR_Pos);

// Wait till module clock is enabled
while((RD_REG(VADC->CLC, VADC_CLC_DISS_Msk, VADC_CLC_DISS_Pos))!= 0);

The "while" loop never completes. I have confirmed the HW differences between the two boards. The target board seems to be ok and other peripherals are operating fine. I'm wondering if there is something related to 'AA' step devices that could be causing an issue.

To add, when I look at the peripheral viewer in Keil debug, all of the ADC registers show up as 0xFFFFFFFF. It seems as though the debugger can't even see the reg's.

Any thoughts?

Regards,
Bob
0 Likes
2 Replies
RValascho
Employee
Employee
5 questions asked First question asked 10 replies posted
Additional Information -

It seems that when I write to PRCLR0 on the AB step, the ADC initializes to default. When I write to the AA step, ADC values remain 0xFFFFFFFF.
0 Likes
RValascho
Employee
Employee
5 questions asked First question asked 10 replies posted
I originally developed my code by extracting from an XMC4500 program. At that time, I only had an XMC4500 kit. Since then, received an XMC4400 kit.

I had to add the following line after setting up the external oscillator..before initializing the ADC:

SET_BIT(SCU_CLK->CGATCLR0, SCU_CLK_CGATCLR0_VADC_Pos);

I'm still not sure why it works on the AB step and not on AA but the problem, at least in my case, is solved.
0 Likes