This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use w78e58b's xram?

I am using the w78e58b,but after selecting this device in keil7.06,there are no "use on-chip rom" and "use on-chip xram" in the "target" .why?

In my program, I want to put some variables into the on-chip xram as following:
unsigned char pdata string[];
How to use the xram of w78e58b?

Parents
  • Hi Peng,

    I don't think the Keil will add the setup code for you automaticlly. You can simply add your own setup code in startup.a51.
    Just to remind you, on ICE you have to use the ICE XRAM or Taget XRAM to simulate the AUX-RAM.

    PPAGEENABLE	EQU	1	; set to 1 if pdata object are used.
    ; After AUX-RAM enabled, the instructions of "MOVX @Ri" will always access on-chip AUX-RAM.
    ; when burning the code into a chip, P2's page number doesn't matter.
    PPAGE		EQU	00H	; define PPAGE number.
    
    ; Standard SFR Symbols required in AUX-RAM Init
    P2	DATA	0A0H
    CHPENR	DATA	0F6H
    CHPCON	DATA	0BFH
    
    IF PPAGEENABLE <> 0
    		MOV	P2,#PPAGE
    		MOV	CHPENR,#87H
    		MOV	CHPENR,#59H
    		ORL	CHPCON,#00010000B	; enable AUX-RAM
    		MOV	CHPENR,#00H
    ENDIF
    

    Enjoy it.
    Frank Hu

Reply
  • Hi Peng,

    I don't think the Keil will add the setup code for you automaticlly. You can simply add your own setup code in startup.a51.
    Just to remind you, on ICE you have to use the ICE XRAM or Taget XRAM to simulate the AUX-RAM.

    PPAGEENABLE	EQU	1	; set to 1 if pdata object are used.
    ; After AUX-RAM enabled, the instructions of "MOVX @Ri" will always access on-chip AUX-RAM.
    ; when burning the code into a chip, P2's page number doesn't matter.
    PPAGE		EQU	00H	; define PPAGE number.
    
    ; Standard SFR Symbols required in AUX-RAM Init
    P2	DATA	0A0H
    CHPENR	DATA	0F6H
    CHPCON	DATA	0BFH
    
    IF PPAGEENABLE <> 0
    		MOV	P2,#PPAGE
    		MOV	CHPENR,#87H
    		MOV	CHPENR,#59H
    		ORL	CHPCON,#00010000B	; enable AUX-RAM
    		MOV	CHPENR,#00H
    ENDIF
    

    Enjoy it.
    Frank Hu

Children