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.
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.
"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...
Which one is Better SPI/ I2C?? What are differences between them??
there are 3 differences that stand out, let me mention those
1) SPI require one additional wire for each device you add, IIC does not (two wirtes howebver may devices) 2) SPI is (usually) faster than IIC 3) the abbreviation 'SPI' comes naturally 'I2C' is some stupid marketeers attempt to be cute, do you remember when some tried to force T2L for TTL upon us, fortunately that one did not succeed.
one more comment; DO choose a derivative that has hardware SPI/IIC, do not even think of bit-banging.
Erik
do not even think of bit-banging.
Oh, pfffft. Where's your sense of adventure?
Next you'll be suggesting that he abondon the '51 altogether and opt for an embedded Windows CE system and where .NET can solve all problems. ;)
Bit-banging is quite ok for a master, but pure hell for a slave.
Shockingly, I'll agree with erik, even though I have a project with bit-banged I2C.
If you know at design time that I2C is important to your system, and you have a bunch of devices to run, why would you not select a part that has a built-in I2C port? Pick the right hardware for the job.
It's not that hard to bit-bang, but it's just not necessary. Save the effort for all the other problems your project will run into.
If you don't have the luxury of choosing the micro... banging it is.
(Incidentally, we had trouble pushing 100 kbps using a 62.5MHz 4-clock core (but non-standard I/O ports). So I also agree that it's only going to work well if you're the master and can control the I2C clock, unless your 8051 is really screaming along.)
Oh, pfffft. Where's your sense of adventure? my "sense of adventure" went away the day, long ago, when somone told me that code designed to be reliable is better than tested code.
Oh, yes, I bit-banged IIC in the olden days, before the chipmakers made it obsolete, but would not even dream of doing so today.
Next you'll be suggesting that he abondon the '51 altogether and opt for an embedded Windows CE system and where .NET can solve all problems. ;) chips with HW IIC (which can be had for less than $1) are not made by Microsoft.
There is a huge difference between taking advantage of hardware that makes your thingy smarter/better/faster and implementing something in the belief that a '51 can be a universal solution to everything.
"Which one is Better SPI/ I2C?? What are differences between them??"
Just stumbled across an article at www.embedded.com/.../OEG20020124S0116
It begins:
"Both SPI and I2C provide good support for communication with slow peripheral devices that are accessed intermittently. EEPROMs and real-time clocks are examples of such devices. But SPI is better suited than I2C for applications that are naturally thought of as data streams (as opposed to reading and writing addressed locations in a slave device). An example of a "stream" application is data communication between microprocessors or digital signal processors. Another is data transfer from analog-to-digital converters.
"SPI can also achieve significantly higher data rates than I2C. SPI-compatible interfaces often range into the tens of megahertz. SPI really gains efficiency in applications that take advantage of its duplex capability, such as the communication between a "codec" (coder-decoder) and a digital signal processor, which consists of simultaneously sending samples in and out.
"SPI devices communicate using a master-slave relationship. Due to its lack of built-in device addressing, SPI requires more effort and more hardware resources than I2C when more than one slave is involved. But SPI tends to be simpler and more efficient than I2C in point-to-point (single master, single slave) applications for the very same reason; the lack of device addressing means less overhead."
If you need 8 I2C (IIC) Buses that leaves Bit-Banging, or muxing. Yes, this is the exception not the rule.