modifing peripheral registers in debugger is not working

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

cross mob
Not applicable
Hi,
I tried the easy start example that blinks a LED. I played a bit with the debugger and found out that I cannot change the peripheral registers. The registers are shown in the register view but when trying to change some of them they will always keep the existing value, form what I have seen it is always 0, is this a bug?
0 Likes
2 Replies
Georg_Huba
Employee
Employee
Dear Karmann Ghia,

You probably have tried to change registers of peripherals that are not initialized yet and hence they are still hold in reset. To work with peripherals of the XMC4500 the reset clear bit of the peripheral has to be set to 1 and the clock for this peripheral has to be enabled.
The EasyStart project you mentioned is configuring the VADC Kernel 0. After the ADC0_Init function of this project is executed you can change e.g. the register VADC_G0.ARBCFG with the register view in the debugger.
If you would like to modify registers of a peripheral that is not yet used (initialized) you have to first clear the reset bit and then enable the clock.
Example, if you want to change the "Input Selector" register of a CCU4 slice, the register CCU40_CC40.INS:
1. set the clear reset bit: SCU_RESET.PRCLR0 change to 0x00000004 (write only, but SCU_RESET.PRSTAT0 changes)
2. enable the CCU clock: SCU_CLK.CLKSET change to 0x00000010 (is a write only register, but SCU_CLK.CLKSTAT changes)

Now it is possible to change the register CCU40_CC40.INS

Best regards,
Georg Huba
0 Likes
Not applicable
Dear Georg,

Thanks a lot - it works now
0 Likes