Hi,
I am trying to interface an 8051 microcontroller with an external EEPROM and SRAM, I am not very sure how to go about doing it. Could someone please give some inputs or are there any books or websites, i could refer to. Thank you.
Have a look at this project: https://www.pjrc.com/tech/8051/dev-board-desc.html
It incudes basic description of the 8051's multiplexed external bus and schematic of the development board with external memories and I/Os ..
Regards,
IanP
Connecting external code and data memories to 8051-core microcontroller via 8051's multiplexed bus is a hardware issue and has hardly anything to do with programming language ..
If EA pin is connected to 0V 8051 executes codes from external code memory starting from address 0000h; if EA is connected to +5V or left unconnected, 8051 executes codes from internal program memory, and above this address area, executes codes from external program memory ..
Here are examples on how to use assembly within C (address=xxxxH, data=xxH):
- data read from SRAM:
#asem
MOV DPTR, #address
MOVX A, @DPTR
#endasm
- data write to SRAM:
#asm
MOV A, #data
MOV DPTR, #address
MOVX @DPTR, A
#endasm