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 Projects Page. All schematics are subsections of the schematics of the whole development board.


 

EXAMPLE 1: Basic LCD test
 
- Schematics: view

 
- The photo of the program execution: view

 
- Basic source program:


 
 
 

EXAMPLE 2: Reading analog input
 
- Schematics: view

 
- The photo of the program execution: view

 
- Basic source program:


 
 
 

EXAMPLE 3: Playing with LEDs
 
- Schematics: view

 
- The photo of the program execution: view

 
- Basic source program:


 
 
 

EXAMPLE 4: 7-segment displays
 
- Schematics: view

 
- The photo of the program execution: view

 
- Basic source program:


 
 
 

EXAMPLE 5: 4x4 matrix keypad
 
- Schematics: view

 
- Basic source program:


 
 
 

EXAMPLE 6: PWM regulation of LED light intensity
 
- Schematics: view

 
- Basic source program:


 
 
 

EXAMPLE 7: RS-232 communication with PC
 
- Schematics: view

 
- The photo of the program execution: view

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

 
- Basic source program:


 
 
 

EXAMPLE 8: I2C communication with 24c256 eeprom
 
- Schematics: view

 
- The photo of the program execution: view

 
- Basic source program:


 
 
 

EXAMPLE 9: I2C communication with PCF8583 real time clock
 
- Schematics: view

 
- The photo of the program execution: view

 
- Basic source program:


 
 
 

EXAMPLE 10: Measuring temperature with DS18S20
 
- Schematics: view

 
- The photo of the program execution: view

 
- Basic source program:


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