Electronics

Microcontroller PIC16F628A I/P

AED 19.95

1

Description

PIC microcontrollers are very useful Devices and you can make a very complex electronic project with it. They are very inexpensive and easy to find. PICs are also easy to program.
And This powerful (200 nanosecond instruction execution) yet easy-to-program (only 35 single word instructions) CMOS FLASH-based 8-bit microcontroller packs Microchip's powerful PIC® architecture into an 18-pin package and is upwards compatible with the PIC16F628, PIC16C62XA, PIC16C5X, and PIC12CXXX devices. The PIC16F628A features 4MHz internal oscillator, 128 bytes of EEPROM data memory, a capture/compare/PWM, a USART, 2 Comparators, and a programmable voltage reference that make it ideal for analog/integrated level applications in automotive, industrial, appliances and consumer applications.


Additional Features
Low voltage programming
Low-speed Clock mode
Programmable BOR
4MHz internal oscillator
Programmable VREF
128 bytes of EEPROM
Data Memory:ICD
Program Memory Type: Flash
Program Memory Size (KB): 3.5
CPU Speed (MIPS/DMIPS): 5
SRAM (B): 224
Data EEPROM/HEF (bytes): 128
Digital Communication Peripherals: 1-UART,
Capture/Compare/PWM Peripherals: 1 Input Capture, 1 CCP,
Timers: 2 x 8-bit, 1 x 16-bit
Number of Comparators: 2
Temperature Range (°C): -40 to 125
Operating Voltage Range (V): 2 to 5.5
Pin Count: 18


Getting the project set up can some times be tricky. Here we will walk through the process of setting up the software, creating a new project, and programming some very simple functions to test the configuration and ensure everything is working. 

The PIC microcontrollers are programmed by the embedded C language or assembly language by using appropriate dedicated software. Before going to build a PIC microcontroller project

The  PIC microcontrollers are programmed by the embedded C language or assembly language by using appropriate dedicated software. Before going to build a PIC microcontroller project


First Circuit using  PIC Microcontroller:

this is a basic circuit for Pic microcontroller contains all the component necessary for working like Crystal and capacitor and reset resistor look at the Pic Bellow:



How to Write the Program of the PIC Microcontroller:

The PIC microcontroller programming is performed through the ‘MP-Lab’ software. First, install the MP-Lab software, then select and install the compiler like CCS, GCC compiler, etc. Here ‘CCS C compiler’ is used for building the program.

  • First, open the MPLAB software. This shows the menu bar with the file, edit, view, project, and tools option.
  • Select the project option and select the ‘project wired option’ from the drop-down menu. This will show the project wired window.
  • Select a microcontroller for your project. Here ‘PIC16F628A ’  microcontroller is selected.
  • Select the compiler and path location for your project. Here  ‘CCS C compiler’ is selected for the PIC microcontroller, then select the ‘browse’ option from the project wired window to select the ‘CSS loader’ in the PICC  folder from the program files.  A folder with the name ‘source group’ is created in the ‘target’ folder.
  • Give a name to the project and click on the ‘NEXT’ button to save the project. A folder with the name ‘source group’ is created in the ‘target’ folder. Click on the ‘File’ menu on the menu bar. Select ‘new file’ from the drop-down menu.

#include
void delay(int);
sbit a=PB^2;
sbit b=PB^3;
sbit c=PB^4;
sbit d=PB^5;
void main()
{

TRISB=0x00;
a=b=c=d=0x00;
delay(10);
a=b=c=d=0xFF;
}
void delay(int a )
{
unsigned char c;
for(c=0;cfor(c=0;c<250;c++);
}


How to Upload the Code to PIC Microcontroller:

The code loading process of the microcontroller is called dumping. The microcontrollers understand only the machine level language, which contains ‘0 or 1s’. So we need to load the hex code into the microcontroller. There is much software available in the market for loading the code to the microcontroller. Here we have used ‘PICFLSH’ programmer software to dump the code to the PIC microcontroller. The programmer kit comes with the hardware kit along with the software.

This software needs to be installed on the computer. The microcontroller placed in the hardware kit, which comes with the socket. Here are the steps to load the code onto the microcontroller.(you can buy your Pic Programmer from Here)


  • Interface the hardware (programmer kit) to the computer through a serial cable
  • Place the microcontroller in the socket of the hardware kit. Press the lock button to ensure the microcontroller is connected to the board.
  • Open the software installed on the computer. This shows the menu bar with file, functions, open, save, and setting options.
  • Select the ‘open’ option from the drop-down menu and select the ‘load file’.
  • Click on the ‘load’ button so that the hex file is loaded into the microcontroller.