+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Newbie level 5
    Points: 901, Level: 6

    Join Date
    Apr 2008
    Posts
    10
    Helped
    0 / 0
    Points
    901
    Level
    6

    How to read / write from External memory

    I want to store some variable in RAM which is outside the microcontroller , can you suggest me how to read and write in RAM and How to use xdata ...........
    Thankyou

    •   Alt4th December 2008, 07:39

      advertising

        
       

  2. #2
    Full Member level 2
    Points: 2,306, Level: 11

    Join Date
    Aug 2008
    Posts
    128
    Helped
    42 / 42
    Points
    2,306
    Level
    11

    Re: How to read / write from External memory

    Hi,

    If you are using Keil for the microcontroller programming, you can use MOVX instruction to write in the external memory.

    Check it out. It may help u.

    Thanks..

    HAK..

    Added after 3 minutes:

    Hi,

    this is the command description:

    Operation: MOVX
    Function: Move Data To/From External Memory (XRAM)
    Syntax: MOVX operand1,operand2

    Instructions OpCode Bytes Cycles Flags
    MOVX @DPTR,A 0xF0 1 2 None
    MOVX @R0,A 0xF2 1 2 None
    MOVX @R1,A 0xF3 1 2 None
    MOVX A,@DPTR 0xE0 1 2 None
    MOVX A,@R0 0xE2 1 2 None
    MOVX A,@R1 0xE3 1 2 None

    Description: MOVX moves a byte to or from External Memory into or from the Accumulator.

    If operand1 is @DPTR, the Accumulator is moved to the 16-bit External Memory address indicated by DPTR. This instruction uses both P0 (port 0) and P2 (port 2) to output the 16-bit address and data. If operand2 is DPTR then the byte is moved from External Memory into the Accumulator.

    If operand1 is @R0 or @R1, the Accumulator is moved to the 8-bit External Memory address indicated by the specified Register. This instruction uses only P0 (port 0) to output the 8-bit address and data. P2 (port 2) is not affected. If operand2 is @R0 or @R1 then the byte is moved from External Memory into the Accumulator.

    Thanks..

    HAK..



    •   Alt5th December 2008, 09:14

      advertising

        
       

  3. #3
    Newbie level 5
    Points: 901, Level: 6

    Join Date
    Apr 2008
    Posts
    10
    Helped
    0 / 0
    Points
    901
    Level
    6

    Re: How to read / write from External memory

    Hi

    I am using Keil and programming language is "C" ...

    can you answer some question...

    1. What is diffrence b/w Flash memory and programme memory
    2. has size of hex file include both memory..
    3. how many memory microcontroller have



    •   Alt5th December 2008, 10:24

      advertising

        
       

  4. #4
    Full Member level 2
    Points: 2,306, Level: 11

    Join Date
    Aug 2008
    Posts
    128
    Helped
    42 / 42
    Points
    2,306
    Level
    11

    Re: How to read / write from External memory

    Hi,

    The programme memory can be ROM, EEPROM or flash which can store the code whn the power is switched off. The data memory can be volatile i.e. RAM for which data is available only whn the power is on.

    For available controller memory and location pls visit the site:
    http://www.esacademy.com/faq/docs/51memmodel/

    It may help you..

    Thanks..

    HAK..



  5. #5
    Full Member level 5
    Points: 3,185, Level: 13

    Join Date
    Feb 2007
    Location
    USA
    Posts
    260
    Helped
    35 / 35
    Points
    3,185
    Level
    13

    Re: How to read / write from External memory

    How is your memory connected ?



--[[ ]]--