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 RAM access via 16-bit multiplexed bus

Hello! I have problem with external memory access on XC167CI. The external RAM is organized on PLD. Need about 1 KB (64 kb non segment memory). I use 2-byte variables (unsigned int) to store on external RAM and 16-bit multiplexed bus. The address of one variable is 0x0400 - this is 16-bit address. In start_v2.a66 i check CS1 for start address is 0x000000. I use unsigned int near pointers. What settings i must do in CS1? And what types of variables and pointers to use for it?

Parents
  • I cant understand one thing. If i use 16 bit multiplexed bus, only 16-bit address must be used? 16-bit address points to 64KB. But in start_v2.a66 there is start address is absolute - 0x000000, more than 16 bit. PLD have address 0x0100. What types of variables and pointers to access it?

Reply
  • I cant understand one thing. If i use 16 bit multiplexed bus, only 16-bit address must be used? 16-bit address points to 64KB. But in start_v2.a66 there is start address is absolute - 0x000000, more than 16 bit. PLD have address 0x0100. What types of variables and pointers to access it?

Children
  • That depends on the memory model you use.
    If I use an external RAM e.g. start from 0x10000 and use small model, than I can access the RAM as an array variable.

    unsigned int xhuge arrRAM[0x20000];
    ...
    for(i=0;i<0x20000;i++)
    {
      if(read_RAM(i)=='0')
         {
         continue;
         }
      else
         {
         printf("\r\nError at %05d",i);
         break;
         }
    }
    
    .

    A memory window has to start at a certain
    address described in the manual.
    The EBC you have to tell, which CS it has to use to access the address range.
    Than the EBC will compare the memory addresses against these settings and activate the CS.
    All ranges not specially given are handled per default by CS0.
    Adressing more than 64kB you need to configure extra address lines (segment address lines SALSEL), which are derived at XC167 from port P0H.

    I strongly recommend you to use DAvE for
    the setup, if you get some difficulties.

    Stefan