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

Memory mapping an LCD

Hi,

I'm trying to memory map an LCD module to the at91m42800A's external bus interface. I currently have the 8-bit device connected to the EBI on chip select 4. I also configured it's memory space (0x50000000-0x50FFFFFF) in startup.s.

However, every time I attempt a read/write to this device, the processor aborts. I realize this is a Linker problem, but I'm not sure how to configure it. I'm using the Keil toolset, btw.

Do I need to define a new memory CLASS, like XDATA? Any input on this subject would be much appreciated.

Cheers,

Tracy

  • Hi
    How do you know it's a linker problem? Was there a linker warning during the build?
    How does the code run in the simulator, does it "abort" there?
    I can't believe that writing to the module causes the processor to cease operation, the module should be passive on the bus at that time.
    Those one and two line LCD modules are usually kind of slow, does your system need wait states?

  • Yeah,

    I figured it out finally. I was having problems trying to map the LCD to an absolute address. For example, when I attempted to read/write the LCD, the arm would throw a data abort.

    Fortunately, the CARM compiler implements an __at directive to specify where variables map to the memory space. I declared a variable

    volatile int lcd_reg __at 0x40000000;

    where 0x40000000 is the base address for the LCD memory space. This solved my problem.

  • NO, the linker did not issue any warnings when I built the file. However, the simulator complained when I read/wrote from the LCD because it didn't know that the LCD had read write permissions. I used the MAP command to set the READ WRITE permissions for the LCD, and that stopped the simulator complaints. This is more of a bandaid fix, however, because the simulator should know about the CPU's memory map, a priori, without using the MAP command.

  • Have you set correct bus size for the LCD bank?

    If you have it as 16bit and you try to access 0x400001, ARM will generate ABORT.

  • I realize the LCD bus is 8 bits and I specified that in the startup file via the EBI setup. Anyway, the problem's solved (see two or three posts ago).

    Thanks for your help

    -Tracy