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

external memory interface

hello everyone,
i am using 89c51 interfacing with 6264

in 89c51 we have ram = 4Kbyte i.e for the further size i need to switch to 6264

total address line on 6264= 12
so A15=/CS1=0
A14=CS2=1
A13= gnd=0
A0-A7 = P0.0 to P0.7 of 89c51 trough latch
A8-A12 = P2.0 to P2.4 of 89c51
D0-D7=P1 for data
/WE = /we of 89c51
/RD = /Rd of 89c51
ALE connected to clk of latch
this is my hardware

now i have sstarted programming in c
i am using _at_ for the address
what all care i should take to select 6264
i have taken care of A15,A14,A13 and ALE
can u show me sample code for it
4000 is intermal ram and for external it is 4001 address
what if i select 4000 for external ram, does it conflict with internal ram
as soon as i transfer address does data is passed immediately?
thank u in advance
for further inputs from me pls let me konw

  • If the internal ram is 0x4000 large, then it isn't likely to end at address 0x4000, but at address 0x3fff, i.e. leaving address 0x4000 as the first free address.

    But the data sheet for your processor should normally tell you these kind of things.

  • hello,
    thank you for reply
    i am going through datasheet
    can you give me any link for c program of external ram interface
    because i am confused with memory access code
    pls suggest me
    thank you

  • It is irrelevant to the 'C' program!

    As far as the 'C' program is concerned, it's all just XDATA - it's up to your hardware to make the interface.

    You just need to tell the Linker what memory address ranges your target hardware has available - see: www.keil.com/.../uv3_ca_ovwconfigdialogs.htm

    Your Startup code might need to do some things to correctly configure your hardware: http://www.keil.com/support/man/docs/c51/c51_ap_startup.htm

    Have you actually worked through (not just read) the basic examples: http://www.keil.com/support/man/docs/uv3/uv3_examples.htm ?

  • hello;
    thanx for replay
    i tried small program in c
    can you tell me how to differentiate between on-chip ram and off-chip external ram
    i.e if int ram address is =0000 to 3fff then for address 4000 will be diverted to external off-chip ram
    does this happen automatically? or we have to write code for it?
    what is differnce between:
    volatile unsigned char xdata ADD1 _at_ 0x4000
    and unsigned char xdata ADD2 _at_ 0x4000
    i tried this and i got warning as xdata space memory overlap
    is there any conflict if we enter same address for both on-chip and off-chip external ram
    please,correct me if i am wrong
    thank you all

  • You will have to study the Datasheet to answer that!

    It depends on the chip, and how you configure it!

    what is differnce between:

    volatile unsigned char xdata ADD1 _at_ 0x4000
    

    and

             unsigned char xdata ADD2 _at_ 0x4000
    


    The difference is, obviously, that one contains 'volatile' and the other doesn't!

    'volatile' is a standard 'C' keyword - so you can look it up in any 'C' textbook.

    "i tried this and i got warning as xdata space memory overlap"

    Of course you did!
    If you define two things at the same address then they will, by definition, overlap - won't they?!