Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[51] Single master multiple slave implentation using 8051 microcontroller

Status
Not open for further replies.

Help

Advanced Member level 2
Joined
Feb 15, 2005
Messages
617
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
7,065
I2C, Single master multiple slave implentation using 8051 microcontroller

Hello All,

I would like to use AT89C52 as a master to interface few AT89LP4052 (slave) with using I2C. This two MCU doesn't have build in I2C feature.

This few day i have do some research and can't find any useful information and sample code for 8051 I2C slave. But i do found this "Implementation of MCU Invariant I2C Slave Driver Using Bit Banging" for TI MSP430 controller. I'm not familiar with TI controller plus the sample code given is not complete. So it is difficult for me to modify the code and adapt to 8051.

Anyone can help me on this?

Thank you,.
 
Last edited:

Re: I2C, Single master multiple slave implentation using 8051 microcontroller

hello jayanth,

Thanks for your reply.

I have check the link. The sample tutorial given is for Master mode. How bout Slave mode?
 

Re: I2C, Single master multiple slave implentation using 8051 microcontroller

You have to use external interrupt detection at slave side. Better use software SPI. It will be easy.
 

Re: I2C, Single master multiple slave implentation using 8051 microcontroller

Ya, i have reserved the external interrupt pin at slave side. I would like to try I2C communicate among the MCU and the main board with C52 no reserve SPI port. :-(

From the article i found the code is really complicated but i think the code is able to fix in AT89LP4052 which is 4K ROM.
 

Re: I2C, Single master multiple slave implentation using 8051 microcontroller

SPI is easy to implement and SPI code will fit in you micro but you need 1 pin extra for each slave for slave selection.

In software I2C slave has to monitor the SCL on every clock maybe with toggling the edge detect and data line is read on every rising edge of SCL. I have not done software I2C so I can't tell you much about it.
 

Re: I2C, Single master multiple slave implentation using 8051 microcontroller

Ya i think SPI is easy to control but i need more pin SCL, MOSI, MISO, CE1, CE2, CE3,...and so on..Currently the main board just have SCL and SDA two pin to each board and my C52 have no many extra pin for SPI slave select have reserved for other other peripheral. :(
 

for spi you will need only one chip select pin if your slave is only one. chip select pins number increases as slave number increases.
and need only 4 pins SCL, MOSI, MISO, CS. and spi is faster then i2c.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top