I2C_LCD.c:56:1: error: (192) undefined identifier “SSPADD” I2C_LCD.c:55:1: error: (192) undefined identifier “SSPCON”
#Mplab xc8 downlaod zip file#
Can you please post the entire ZIP file of a working project? Text = (i / 10) % 10 + '0' // store tensĬannot get the project to build. store 'i' into 'text' ( '0' for ASCII format ) LCD_Begin(0x4E) // Initialize LCD module with I2C address = 0x4E I2C_Init(100000) // initialize I2C bus with clock frequency of 100kHz OSCCON = 0x70 // set internal oscillator to 8MHz
#Mplab xc8 downlaod driver#
#include "I2C_LCD.c" // include I2C LCD driver source file
#Mplab xc8 downlaod software#
* This is a free software with NO WARRANTY * Interfacing PIC12F1822 microcontroller with I2C LCD screen The I2C LCD is initialized with an I2C address of 0x4E: The hardware I2C module of the PIC12F1822 is initialized with a clock frequency of 100KHz (100000Hz): The I2C LCD driver file is included with the line: The C code below is for MPLAB XC8 compiler, it was tested with version 2.00 installed on MPLAB X IDE version 5.05.
Interfacing I2C LCD with PIC microcontroller C code: In this project the PIC12F1822 microcontroller runs with its internal oscillator 8 MHz, MCLR pin is configured as an input pin. PCF8574A can be used instead of the PCF8574, the I2C address becomes: 0x7E. The 10k ohm resistors for A2, A1 and A0 are optional and each pin can be connected directly to +5V. SDA and SCL pins of the PIC12F1822 MCU are connected to SDA (#15) and SCL (#14) pins of the PCF8574 I/O expander respectively.Ī2, A1 and A0 pins of the PCF8574 are connected to +5V (each one through 10k resistor) which means the I2C address of the PCF8574 (therefor the I2C LCD) is: 0 1 0 0 A2 A1 A0 0 = 0 1 0 0 1 1 1 0 = 0x4E. The PIC12F1822 microcontroller has one hardware I2C module with SDA on pin RA2 (#5) and SCL on pin RA1 (#6). (All grounded terminals are connected together) Project circuit schematic diagram is shown below. Interfacing I2C LCD with PIC microcontroller circuit: