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

Issue regarding accessing XRAM in DS89C430

I have problem accessing XRAM in DS89C430. I have included startup.A51 file and followed the instruction under forum "http://www.keil.com/support/docs/3345.htm". The issue is when i debug the code all work fine, but when it comes to hardware, i wont get desired data i wrote into XRAM.
The code working well with P89V51RD2, but it is required to have faster processing. Please help.

Parents Reply Children
  • I did not made correction in startup.a51....!!!!
    Shell i include the code "ORL PMR,#1". Will try this....

  • I did not made correction in startup.a51....!!!!
    Shell i include the code "ORL PMR,#1".

    GENERAL for ALL chips with internal XRAM etc:
    ALSO: for chips with external XRAM where the timings must be changed.

    Unless the defaults ("reset states") of the SFR(s) as stated in the datasheet, are what you want you MUST make a local, renamed copy of startup.a51 and include it in your build. In that copy you must at the beginning set all SFRs that affect XRAM addressing.

    Not mandatory, but I prefer to, in the same place, to include, if applicable, port configuration, oscillator configuration and other configuration bits affecting the actual functionality if the chip.

    Erik

  • I did not made correction in startup.a51....!!!!

    So you lied to all of us when earlier you claimed you had followed the instructions from that Keil app note.

    From where I sit, the frustration you had from not getting that thing to work is insufficient penance for that lie.

  • Shall you include that line of code?

    But _you_ linked to a document that did say:

    Add STARTUP.A51 to your project. To do this, copy the file \C51\LIB\STARTUP.A51 to your project
    folder and add it to the project. Then, in the STARTUP.A51 file, enable the on-chip SRAM by
    setting bit 0 (DME0) in the PMR SFR. The following lines in STARTUP.A51 will do this:
    ...
    

    So the document _you_ said you had followed did say what steps you should do. And you don't get it to work and ask us if you should have followed the steps in the linked document. How where you thinking?

  • "make a local, renamed copy of startup.a51"

    Renaming it is a preference - not mandatory.

    Having it local is also a preference (and one that I'd share) - not mandatory.

    "at the beginning set all SFRs that affect XRAM addressing"

    It doesn't have to be at the beginning - it just needs to be before any XRAM reference that requires it.

    Of course, having it at the beginning does guarantee that - but it is not mandatory.