??? 10/23/07 18:41 Read: times |
#146098 - answer Responding to: ???'s previous message |
now a ram has been integrated the requirement is the anticipated ability of reading hex code from mmc and then writi ng that hex file to the External RAM. this will require the RAM to be used using as data memory. now the need is to switch control to the hex code that has been written to the RAM. for doing this the External Ram that was being used as data memory will now need to be treated as code memory. i hope i have made my point. i thank you all for taking time out to help me. i am trully indebted and encouraged to find such a helpful lot. :) I don't know about MMC, so I can't comment on that, but with regards to your RAM and ROM, if they use a parallel interface (where there are 8 data lines, and several address lines), then take the highest address pin on your 8052 compatible chip (I think it is A15) and use that as a chip select pin. Tie A15 to CE' (an active low chip enable) on your ROM, and tie A15 to CE' on your RAM through an inverter, so that one chip (RAM or ROM) can be active at a time. Next, connect the RD and PSEN lines (on the micro) to each input of a 2-input AND gate. Connect the output of this gate to the RD' on the RAM and the ROM. Connect the WR (on the micro) to the WR' on the RAM and the ROM. Make sure you use at least a 32KB ROM. Connect the address lines on the rom to the remaining address lines for the micro. Do the same with the data lines. When you run the program, if it was running with no loops, the code will execute from address 0 to almost the highest address. Once you get to address 8000h then code is executed from the RAM, because the RAM uses addresses 8000h to 8000h + the number of bytes your RAM can hold. You can also jump to the address 8000h if you want to execute code from RAM. You can use MOVX or MOVC to read code using the hardware configuration that I described. You can use MOVX to write code to the EEPROM or RAM. |