: This example demonstrates low-level I2C initialization and control, providing a template for developers working with 8-bit PIC families.
I2C simulation can be intensive. Ensure your computer isn't overloaded.
while True: pass
The JHD-2x16-I2C display module, when used in conjunction with Proteus simulation software, provides a powerful platform for designing, testing, and optimizing electronic circuits. By leveraging the strengths of both tools, engineers and hobbyists can accelerate their development process, reduce costs, and achieve more accurate and reliable results. Whether you're working on a simple project or a complex embedded system, the combination of JHD-2x16-I2C and Proteus is an excellent choice for bringing your ideas to life.
// Set the LCD I2C address to 0x7C for Proteus simulation. // For 16x2 LCD, set columns to 16 and rows to 2. LiquidCrystal_I2C lcd(0x7C, 16, 2); jhd-2x16-i2c proteus
Once your schematic is wired and your firmware is compiled, you are ready to configure the Proteus simulation execution. Loading the Hex File
Within the Proteus component library, the part value "JHD-2X16-I2C" refers to an I²C-enabled alphanumeric LCD. It is a simulation model of a standard 16-character, 2-line LCD (based on the HD44780 controller) that integrates a PCF8574 I/O expander to enable I²C communication. This is not a physical component you would buy, but a virtual model that mimics the behavior of popular "I2C LCD Backpack" modules in a simulation environment. : This example demonstrates low-level I2C initialization and
Click on and drop it onto your schematic workspace.
#define I2C_ADDRESS 0x27
// Initialize LCD uint8_t init_sequence[] = 0x33, // Function set: 8-bit interface, 2 lines, 5x8 dots 0x32, // Function set: 4-bit interface, 2 lines, 5x8 dots 0x28, // Function set: 4-bit interface, 2 lines, 5x8 dots 0x0C, // Display control: Display on, cursor off, blink off 0x01 // Clear display ; for (uint8_t i = 0; i < sizeof(init_sequence); i++) (1 << TWEN); while (!(TWCR & (1 << TWINT))); TWDR = data; TWCR = (1 << TWINT)