Not applicable
Apr 12, 2012
03:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 12, 2012
03:15 AM
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?
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?
2 Replies
Apr 12, 2012
06:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 12, 2012
06:56 AM
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
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
Not applicable
Apr 12, 2012
07:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 12, 2012
07:23 AM
Dear Georg,
Thanks a lot - it works now
Thanks a lot - it works now