Let’s see in detail about working of MSSP module of PIC Microcontroller in I☬ mode. You can easily convert it for other microcontrollers if you understand it clearly. For demonstration we are using PIC 16F877A microcontroller. In this tutorial we will learn how to operate MSSP module of PIC Microcontroller as I 2C master or slave. Inter-Integrated Circuit (I 2C) – Slave, Master & Multi-master modes.Most of the PIC microcontrollers have built in Master Synchronous Serial Port (MSSP) module which can be configured to operate in following modes. R/W bit indicates whether the master wants to read data from or write data to the slave. For example, we can have a microcontroller or host device which is connected to different slave devices like I/O Port Expanders, LED/ LCD Drivers, ADCs, DACs, EEPROMs, Real Time Clock (RTC) etc. So the slave with that particular address will be activated at that moment. The master will send address of slave + R/W bit first, then followed by other data. Each slaves are identified or addressed by a unique address. But commonly we are using single master and multiple slaves. An I 2C bus can have multiple masters and multiple slaves. Slaves are the devices which responds to master and it cannot initiate a communication. The master is the device which initiate communication and it drives clock (SCL) line. It means that devices connected to I 2C bus will be either master or slave. Unlike UART, you can connect and communicate to multiple devices using the same I2C bus. It is a very popular multi-master, multi-slave serial communication interface developed by Philips. I 2C uses two bidirectional open drain data lines, Serial Data (SDA) and Serial Clock (SCL) with pull up resistors as shown below. I 2C or IIC or I2C stands for Inter-Integrated Circuit. 1.3.3 SSPCON2 – MSSP Control Register 2.1.3.2 SSPCON1 – MSSP Control Register 1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |