Keil Logo

µVISION DEBUGGER: Simulating RP0H on the C167


Information in this article applies to:

  • µVision Version 2.20

QUESTION

Is there a way to simulate the inputs to RP0H that occur during reset on the C167 devices?

ANSWER

RP0H is a read-only register that is initialized from P0H during reset. This is what the Infineon manual has to say...

"With the end of reset, the selected bus configuration will be written to the BUSCON0 register. The configuration of the high byte of PORT0 will be copied into the special register RP0H. This read-only register holds the selection for the number of chip selects and segment addresses. Software can read this register in order to react according to the selected configuration, if required.

When the reset is terminated, the internal pullup devices are switched off, and PORT0 will be switched to the appropriate operating mode."

The Keil µVision Debugger starts working after reset has occurred. Therefore, there is no way you can change or alter the contents of RP0H directly. By default, the debugger starts with RP0H set to a value of 0x007F.

You may use the EBC (external bus configuration) virtual target register to set the reset configuration for the external bus. The following values are valid:

  • 0: 8-bit data bus, non-multiplexed
  • 1: 8-bit data bus, multiplexed
  • 2: 16-bit data bus, non-multiplexed
  • 3: 16-bit data bus, multiplexed

You may use the CLKCFG virtual target register to set the reset configuration for the clock. The following values are valid:

  • 0: Fosc x 2.5
  • 1: Fosc / 2
  • 2: Fosc x 1.5
  • 3: Fosc x 1
  • 4: Fosc x 5
  • 5: Fosc x 2
  • 6: Fosc x 3
  • 7: Fosc x 4

Once you set the CLKCFG or EBC, you must reset the simulated CPU before the new values are used and placed into RP0H.

You could use the following debugger script to do that:

EBC = 2
CLKCFG = 3
RESET

Note that this is just the reset configuration. The startup code (in START167.A66) performs the REAL initialization of the microcontroller.

Last Reviewed: Monday, January 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.