Home
Downloads
Licenses Contact

OshonSoft

25th Anniversary - 25+ years of results to be continued

2026 - 25th Anniversary of the
OSHONSOFT PROJECT
OshonSoft © 2001 - 2026

PIC Basic Compiler Examples

This page contains several complete examples where PIC Simulator IDE integrated PIC Basic compiler is used to get the HEX file ready to be programmed into a real PIC chip.

All examples presented on this page were tested on the development board for PIC16F877A microcontroller that is documented on the Hardware Projects page. All schematics are subsections of the schematics of the whole development board.


Example 1: Basic LCD test
Example 2: Reading analog input
Example 3: Playing with LEDs
Example 4: 7-segment displays
Example 5: 4x4 matrix keypad
Example 6: PWM regulation of LED light intensity
Example 7: RS-232 communication with PC
Example 8: I2C communication with 24C256 eeprom
Example 9: I2C communication with PCF8583 real time clock
Example 10: Measuring temperature with DS18S20


Example 1: Basic LCD test

Schematics: view
Basic LCD test schematics

The photo of the program execution: view
Basic LCD test program execution

Basic source program:


Example 2: Reading analog input

Schematics: view
Analog input test schematics

The photo of the program execution: view
Analog input test program execution

Basic source program:


Example 3: Playing with LEDs

Schematics: view
LED test schematics

The photo of the program execution: view
LED test program execution

Basic source program:


Example 4: 7-segment displays

Schematics: view
7-segment display test schematics

The photo of the program execution: view
7-segment display test program execution

Basic source program:


Example 5: 4x4 matrix keypad

Schematics: view
4x4 matrix keypad test schematics

Basic source program:


Example 6: PWM regulation of LED light intensity

Schematics: view
PWM LED light intensity control schematics

Basic source program:


Example 7: RS-232 communication with PC

Schematics: view
RS-232 communication with a PC schematics

The photo of the program execution: view
RS-232 communication test program execution

The screenshot of the PIC Simulator IDE serial port terminal: view
PIC Simulator IDE serial port terminal

Basic source program:


Example 8: I2C communication with 24C256 eeprom

Schematics: view
I2C communication with a 24C256 EEPROM schematics

The photo of the program execution: view
24C256 EEPROM communication test program execution

Basic source program:


Example 9: I2C communication with PCF8583 real time clock

Schematics: view
I2C communication with a PCF8583 real-time clock schematics

The photo of the program execution: view
PCF8583 real-time clock test program execution

Basic source program:


Example 10: Measuring temperature with DS18S20

Schematics: view
DS18S20 temperature measurement schematics

The photo of the program execution: view
DS18S20 temperature measurement program execution

Basic source program:
Basic source program (low level 1-wire):