We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Keil compiler has the provision of type specifier 'pdata' which can be used to declare variables in external memory. For SRAM kind of memory devices we can keep the chip enable signal low and use facility provided by 'pdata'. But for FRAM kind of chips (eg FM1608), CE signal has to have a logic low transition after address is placed then only a valid read/write operation can be performed. But the code generated by keil dosn't give any option to modify the pdata to insert this CE logic on a port pin. Is it possible to do anything in code to generate CE signal while accessing pdata type variables. Thanks in advance...
Thanks you Neil, You are correct, if hardware is in place it will work without any problem. Its not at all a Keil issue. Easiest method is to take ALE of 8051 to CE of FRAM. But, as i said our hardware already exists with a port pin connected to CE of FRAM. So we need to strobe that port pin each time a variable in FRAM is accessed. To tell you more, original design was with 8051 interfaced to SRAM. In a recent modification SRAM got replaced with FRAM without changing any logic. So the pdata varaiables which already exist in code can no longer be accessed properly. Ideal solution is to change the hardware. As an alternate solution, is it possible to modify the assembly level code for pdata. Compiler generates MOVX instructions for pdata type variables. If we can gain control over this assembly code generation, we can put port chaning logic there to accomplish memory read/write without changing hardware.
Compile through assembly, filter the assembler output and then assemble the patched assembler source.