Hi I want to connect many devices like Serial EEPROM, ADC,DAC,RTC and many other I/O devices to 8051.
My question is how address mapping can be done ? How to address them??
Please reply i am in need.
"How to address them??"
That bit is simple - you just use MOVX or MOVC, as approprate. These cause the appropriate address to be presented on the address bus.
Is your question really how to decode the addresses, so that each peripheral "knows" when it is being addressed? If so, the principle is exactly the same as for any other bus-based system.
You need to start by uderstanding how the 8051 external address/data bus works - see the so-called "bible" for the 8051:
Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
Thank you for immediate responce. i need more clarification
In normal way of addressing we may have Decoder / mux to select the particular peripheral
But if we use I2C protocol , we will have only two line SCL and SDA. We will use serial communition., In this case how to connect and address them?? Is there any limitation that some peripherals which are compaitable to I2C only can be connected??
If you use a I2C interface, then you should note that I2C is also a bus. You will issue serial data that represents the address of the chip to talk to. Then you will issue serial data to write to the addressed chip.
"But if we use I2C protocol , we will have only two line SCL and SDA. We will use serial communition., In this case how to connect and address them??"
The way I2C addressing works is defined by the I2C protocol. The I2C protocol is defined here: www.nxp.com/.../39340011.pdf
For general information, including the spec, application notes and NXP prducts see: www.nxp.com/.../i2c
For TI, see: http://www.ti.com/i2c
etc.
For specific details of particular chips, see the appropriate Datasheet
"Is there any limitation that some peripherals which are compaitable to I2C only can be connected??"
Yes, of course - only I2C-compatible devices can be connected to an I2C bus! Again, check the Datasheet to see if a particular chip is I2C-compatible.
There's a tutorial and examples here: www.robot-electronics.co.uk/.../Examples.htm
Of course, it can all be greatly simplified if you use a processor with built-in I2C support...
"I2C - So why didn't you mention that in the first place?!"
Oops - you did!
Sorry, with such a long title it had gone off the right of my window!
Thank you very much Mr Andy Neil. One more doubt.
Is SPI communication also requires comptible devices??? Which one is Better SPI/ I2C?? What are differences between them??
"Is SPI communication also requires comptible devices???"
Yes, of course it does!
"Which one is Better SPI/ I2C??"
There is no answer to that! If there was one clear, universal answer, why would the other even exist?!
It all depends on your specific requirements.
"What are differences between them??"
There's some comparisons here: www.maxim-ic.com/.../ www.maxim-ic.com/.../3967 www.8052.com/.../read.phtml
Thank you very much for sharing very useful information. I will get back if i have any clarification.
"Thank you very much for sharing very useful information"
No problem. Its all freely available on the net - you can find plenty more with a little searching...
View all questions in Keil forum