how to connect sram to mcs9d64

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to connect sram to mcs9d64

2,135 Views
emilian
Contributor I
Hello I have the problem to connect SRAM memory to uC mcs9d64. I read datasheet of this uC and saw that he has external multiplexed bus. I think that I know how to connect that SRAM. But I programed only 8051 where there are two areas of memory: data and program memory. And when I wanted to write or read data to/From external memory I used command 'movx' . But this uC has one area for program and data memory so I don't know how to write code which will read/write the data from/to external SRAM. This SRAM is only for data and the program memory must be in internal FLASH. Anyone has experience in that case I would help me? I'm sorry for my English but this is not my native language.

Message Edited by emilian on 2006-11-0209:02 AM

Labels (1)
0 Kudos
4 Replies

509 Views
emilian
Contributor I
Hello I read that two aplication notes and I drawed the conclusion that I can't connect SRAM to the mcs9d64 throw the external multiplexed bus because I want at least 2 MB. So I decided that I connect it to the I/O port and write a functions which will be able to read and write a data to/from SRAM. That functions will only set or clr proper I/O pins. Maybe I'am wrong?

Message Edited by emilian on 2006-11-0304:27 AM

0 Kudos

509 Views
Steve
NXP Employee
NXP Employee
For 2MB access you certainly need to extend the expanded mode operation of the S12 and you can do this by manipulating I/O. That will be a slow way of implementing the interface but if speed is not important then that may be fine.
Alternatively you could use the expanded bus and add extra memory lines from I/O so for example you connect the hardware as described in the app note and the upper address lines are connected to extra I/O. Then to read from external memory you have to select the correct S12 memory address (page and address location) and select the correct I/O configuration. That will be much faster to read and write memory but you will need to write special software to convert the 21 address lines to S12 address + I/O values
0 Kudos

509 Views
emilian
Contributor I
Thanks for advise. I decided that I connect memory to I/O pins uC. I think that it will be the easiest way. I know that this solusion causes stretching access to the memory but I need access max about 8 us so I think that it will be ok. Sorry for my English
0 Kudos

509 Views
Steve
NXP Employee
NXP Employee
In general you should have a look at AN2408 and AN2287 which have detailed descriptions of the expanded bus and how to use it.
For your specific question the answer is very simple. You can access the SRAM using any opcode that loads or stores data to memory. The opcode must contain an address in the RAM.
For example, to read a value from a table in flash you might use the opcode: LDAA 0xD000.
To read a value from a table in SRAM you use the same opcode and change the memory location. If the SRAM is at address 0x4000 to 0x7FFF then you could read a value using LDAA 0x4010.
If you program in C then the only thing you need to do is place your variables in the correct memory range and the linker will take care of creating the correct opcode.
The most important consideration is how you map the SRAM into the memory map of the S12 and this subject is discussed in the application notes.
0 Kudos