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

LPC3250 EMC interfacing with SRAM

hi,
We are trying to use LPC3250 EMC for interfacing SRAM ,when we are writing a single value we are seeing2 chip select, 2 write pulses.

what can be the problem

Regards and Thanks
Sumit

Parents
  • First - is there a reason why you avoid formatting your code as code? Do you feel that it gets too easy to read with proper formatting?

    Secondly:

    #define CS0_read_16 (*(volatile unsigned short *)(0xE0000000))
    
    void main () {
        emc_init();
        emc0_init();
        while (1) {
            CS0_read_16=0x5555;
        }
    }
    


    will expand into:

    void main () {
        emc_init();
        emc0_init();
        while (1) {
            (*(volatile unsigned short*)(0xE0000000)) = 0x5555;
        }
    }
    


    Exactly how much do you think that looks like a read? Doesn't it look like a write of the value 0x5555 to you?

    The following have a slightly larger chance of actually performing a memory read:

    my_var = CS0_read_16;
    

    By the way - what is the meaning of the "read" part of the name of your #define? Is it to inform that you may only read - not write - using the pointer? Sometimes "const" can be a nice keyword to have the compiler verify that attemts are not made to write to read-only variables.

Reply
  • First - is there a reason why you avoid formatting your code as code? Do you feel that it gets too easy to read with proper formatting?

    Secondly:

    #define CS0_read_16 (*(volatile unsigned short *)(0xE0000000))
    
    void main () {
        emc_init();
        emc0_init();
        while (1) {
            CS0_read_16=0x5555;
        }
    }
    


    will expand into:

    void main () {
        emc_init();
        emc0_init();
        while (1) {
            (*(volatile unsigned short*)(0xE0000000)) = 0x5555;
        }
    }
    


    Exactly how much do you think that looks like a read? Doesn't it look like a write of the value 0x5555 to you?

    The following have a slightly larger chance of actually performing a memory read:

    my_var = CS0_read_16;
    

    By the way - what is the meaning of the "read" part of the name of your #define? Is it to inform that you may only read - not write - using the pointer? Sometimes "const" can be a nice keyword to have the compiler verify that attemts are not made to write to read-only variables.

Children
No data