Keil Logo

MON51: Configuring for Dallas DS5000


Information in this article applies to:

  • C51 Version 7.00
  • MON51

QUESTION

Can I use MON51 with the Dallas DS5000 and the on-chip RAM?

ANSWER

Yes. There are a few configuration issues you must consider.

  1. The DS5000 has on-chip RAM that can be used as CODE and XDATA.
  2. A partition in the on-chip RAM divides the CODE (below the partition) from the XDATA (above the partition).
  3. The partition is located using the MCON register.
  4. For the monitor to download your target program and set breakpoints, it must relocate the partition, write the program into the XDATA memory space, and relocate the partition.

With these in mind, first, you should modify the INSTALL.A51 monitor configuration file as follows:

  1. Add/change the following to the beginning of the INSTALL.A51 file. Locate the existing INT_ADR_OFF equate and replace with the following:

    USER_PGM_START  EQU     2000H
    USER_PGM_MCON   EQU     030H        ; 1800h
    USER_XRAM_MCON  EQU     0E0H        ; 7000h
    
    sfr MCON = 0C6h;
    sfr TA   = 0C7h;
    
    ;------------------------------------------------------------------------
    ; !!! Don't change these. !!!
    ;------------------------------------------------------------------------
    INT_ADR_OFF     EQU USER_PGM_START      ; INTERRUPT VECTOR OFFSET IF MONITOR
                                            ; IS INSTALLED AT ADDRESS 0000H
    DEF_PC_VAL      EQU USER_PGM_START      ; DEFAULT PC VALUE AFTER START UP
    
  2. Modify the InitSerial routine to include the following code which sets the correct initial value for MCON.

            MOV     TA,#0AAH
            MOV     TA,#055H
            ORL     MCON,#02h       ; Set PAA
    
            MOV     MCON,#USER_XRAM_MCON
    
            MOV     TA,#0AAH
            MOV     TA,#055H
            ANL     MCON,#0FDh      ; Clear PAA
    
  3. Modify the WR_CODE routine as follows:

    WR_CODE:
            SETB    C
            JBC     EA, C_SET
            CLR     C
    C_SET:  PUSH    PSW             ; Save Interrupts
            CLR     EA              ; Disable Interupts
    
            MOV     TA,#0AAH
            MOV     TA,#055H
            ORL     MCON,#02h       ; Set PAA
    
            MOV     MCON,#USER_PGM_MCON
            MOVX    @DPTR,A
            MOV     MCON,#USER_XRAM_MCON
    
            MOV     TA,#0AAH
            MOV     TA,#055H
            ANL     MCON,#0FDh      ; Clear PAA
    
            POP     PSW             ; Restore Interrupts
            MOV     EA,C
    
            RET
    

You may also download a working MON51 HEX File preconfigured for the DS5000.


Last Reviewed: Thursday, February 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.