I want to simulate an I2C slave device using a generic 8051 MPU which doesn't have hardware I2C(not like 80C552). I know it is easy to implement software simulated I2C in master mode, but I want to turn my 8051 MPU to be a slave device. How can?
I have done that. My 89C2051 was running at 24MHz. I used EXT1 interrupt to trigger on hi to low transition of SDA line. This was an I2C start event trigger. Then actual I2C traffic was checked in polling mode inside EXT0 interrupt routine which exits when the stop condition is met. I was 'listening' to the SatReceiver I2C bus to extract channel number for addon Sat Dish positioning system.
Hi Archie, yes it's only for slave communication, sorry. Michael
Thanks Michael, I've already known your simulation DLL. You did a great job. Yes, your I2C simulation works in slave mode, but your I2c_lib only works in master mode, right? What I want is to let my 8051 MPU work in slave mode, so that other MPU, or PC can send data to it via I2C. Anyway, it is not critical, I can use another I2C device like I2C memory to store the intermedial data, or use UART to transfer data. But I'm interested in finding a way that costs little. That's why I don't want to use on-chip I2C controller or UART or third I2C device.
Hi, you can check your code with my I²C simulation (works with µVision2) (http://www.c51.de/c51.de/Dateien/uVision2DLLs.php3?Spr=EN). You can find also a I²C library http://www.c51.de/c51.de/Dateien/Liste.php3?Edit=0&showHerst=1&showArt=1&RubrikID=15 and search I2c_lib (suchen == search) Michael
Thanks Eric, I know how to deal with slave I2C with the on-chip I2C controller. But if there is no on-chip I2C controller, how can? It seems difficult to implement. First the 8051 speed must be high (> 30M), and the I2C speed shall be slowed down so that software can simulate the I2C. Anyone has experience on it?
Philips has 2 appnotes (433 and 463) on this, they can be found <a href="" target="_blank">http://www.semiconductors.philips.com/products/standard/microcontrollers/products/index.html">here</a> Erik Ps do not ignore because it states specific derivatives such as 751, they ARE '51 processors.
View all questions in Keil forum