Keil Logo

PDATA in Simulator V7.08

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Tim Dahlin
Posted
13-Jul-2004 14:59 GMT
Toolset
C51
New! PDATA in Simulator V7.08
When using PDATA, the memory viewer, watchpoint tabs, and command window contain zeros for the PDATA I'm using. When I step through the disassembled output, the Register window in the Project Workspace gets the correct non-zero values. The PDATA symbol (32 byte array) in question is getting placed at 0x40. I look up this symbol in the memory window by doing a x:symbol_name, symbol_name, or x:0x40. In the command window, I do a "d symbol_name".

Any ideas?
Read-Only
Author
Keil Software Support Intl.
Posted
13-Jul-2004 15:11 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
See: http://www.keil.com/support/docs/2394.htm. Maybe this answers your question.
Read-Only
Author
Timothy Dahlin
Posted
13-Jul-2004 16:05 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
Thanks but still no luck...

I checked this link too
http://www.keil.com/support/docs/1848.htm

Snippets from my Start_ad.a51 file
;		; the absolute start-address of IDATA memory is always 0
IDATALEN	EQU	100H	; the length of IDATA memory in bytes. Tim Dahlin Changed from 80
;
XDATASTART	EQU	100H ; the absolute start-address of XDATA memory
XDATALEN	EQU	700H ; the length of XDATA memory in bytes. Tim Dahlin Changed from 0
;
PDATASTART	EQU	0H   ; the absolute start-address of PDATA memory.
PDATALEN	EQU	0ffH ; the length of PDATA memory in bytes.
;+++++
PPAGEENABLE	EQU	0	; set to 1 if pdata object are used.
PPAGE		EQU	0	; define PPAGE number.

I should have noted that I'm using the lower 256 byte block of an ADI ADUC831's XRAM.

The VTREG PPAGE is equal to 0xffffffff
Read-Only
Author
Keil Software Support Intl.
Posted
13-Jul-2004 16:20 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
Is the behaviour of MOVX @Ri specified for the ADuC83x devices? Where is it documented?

On standard 8051 the P2 value is used to provide the high byte for MOVX @Ri. In case that the ADuC83x always uses 0 as high-byte you need to initialize the PPAGE VTREG in teh simulator to 0.
Read-Only
Author
Timothy Dahlin
Posted
13-Jul-2004 16:38 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
Is what behavior specifed? I've been referencing old atmel/intel 8051 manuals.

Is there a way to have the VTREG PPAGE default to 0x00? I thought the startup file set the default.

This statement
PPAGE=0xFFFFFFF  // Use default behavior for MOVX @Rx
from
http://www.keil.com/support/docs/2394.htm
confuses me.
Read-Only
Author
Timothy Dahlin
Posted
13-Jul-2004 16:40 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
Okay it assumes your using external XRAM.
Read-Only
Author
Jon Ward
Posted
13-Jul-2004 16:57 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
Is what behavior specifed? I've been referencing old atmel/intel 8051 manuals.

That's not good. If you're using an Analog Devices part, you should start looking at the manual for that device.

PDATA is accessed using MOVX A,@R0/R1 and MOVX @R0/R1, A. R0/R1 contains the lower 8-bits of the XDATA address. The upper 8-bits have to come from somewhere else. On older devices, this was always Port 2. However, newer devices have on-chip XDATA which frees up Port 2 for general I/O. So, P2 is not used (on some devices with on-chip XDATA) for the upper address byte. The following knoweldgebase article provides more info on that.

http://www.keil.com/support/docs/1848.htm


This statement ...

PPAGE=0xFFFFFFF // Use default behavior for MOVX @Rx

... confuses me.


This statement tells the simulator that PDATA is accessed using P2 as the upper address byte and R0/R1 as the lower address byte. It's important to set this correctly because your device may not actually work that way.

Jon



Jon
Read-Only
Author
Keil Software Support Intl.
Posted
13-Jul-2004 16:58 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
We tried to find out the behaviour of MOVX @Ri on Analog Devices parts with on-chip XRAM, but we had no luck. We will contact them again.
Read-Only
Author
Timothy Dahlin
Posted
13-Jul-2004 20:31 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
Is there anyway to set the PPAGE VTREG to default to the base of XRAM?

From support doc 1848.htm
Most devices allow PDATA access (MOVX @Rx)
to only the first 256 bytes of XDATA (0x0000-
0x00FF). On such devices, there is nothing
to configure. You don't need to enable the
PPAGEENABLE setting in the startup code
since the PPAGE is fixed by the chip to 0.

This is how I am using the Analog Devices '831 part works. I have 5 different '831 boards that run a windowed averaging routine which use R0 and R1 for indirect addressing. I'm using P2 for non-addressing uses.

From ADI's ADuC831 datasheet (P2 behavior)
As shown in Figure 38, the output drivers of Ports 2 are switchable
to an internal ADDR and ADDR/DATA bus by an internal
CONTROL signal for use in external memory accesses (as for
Port 0). In external memory addressing mode (CONTROL = 1)
the port pins feature push-pull operation controlled by the internal
address bus (ADDR line). However, unlike the P0 SFR
during external memory accesses, the P2 SFR remains unchanged.
Read-Only
Author
Jon Ward
Posted
14-Jul-2004 02:03 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
Is there anyway to set the PPAGE VTREG to default to the base of XRAM?

Yep. I meant to include the following link earlier:

http://www.keil.com/support/docs/2394.htm

Jon
Read-Only
Author
Keil Software Support Intl.
Posted
14-Jul-2004 10:42 GMT
Toolset
C51
New! RE: PDATA in Simulator V7.08
We have got a clearification from Analog Devices:

All ADuC83x and ADuC84x parts operate in the same manner as Philips parts. When on-chip XRAM is enabled the MOVX @Ri always address the first 256 bytes of XDATA space.

For correct simulation of that behaviour you need to set the uVision Debugger VTREG PPAGE to 0 (as described in http://www.keil.com/support/docs/2394.htm)

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  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.