You are on page 1of 7

Getting started PIC16F88 kit

+
PIC programmer
PIC16F88 - 8-bit PIC® Microcontrollers - Microchip

Low-Power Features:

 Power-Managed modes:
o Primary Run: RC oscillator, 76 A, 1 MHz, 2V
o RC_RUN: 7A, 31.25 kHz, 2V
o SEC_RUN: 9A, 32 kHz, 2V
o Sleep: 0.1A, 2V
 Timer1 Oscillator: 1.8A, 32 kHz, 2V
 Watchdog Timer: 2.2A, 2V
 Two-Speed Oscillator Start-up

Oscillators:

 Three Crystal modes:


o LP, XT, HS: up to 20 MHz
 Two External RC modes
 One External Clock mode:
o ECIO: up to 20 MHz
 Internal oscillator block:
o 8 user selectable frequencies: 31 kHz, 125 kHz, 250 kHz, 500 kHz, 1
MHz, 2 MHz, 4MHz, 8MH

Peripheral Features:

 Capture, Compare, PWM (CCP) module:


o Capture is 16-bit, max. resolution is 12.5 ns
o Compare is 16-bit, max. resolution is 200 ns
o PWM max. resolution is 10-bit
 10-bit, 7-channel Analog-to-Digital Converter
 Synchronous Serial Port (SSP) with SPI (Master/Slave) and I 2C™ (Slave)
 Addressable Universal Synchronous Asynchronous Receiver Transmitter
(AUSART/SCI) with 9-bit address detection:
o RS-232 operation using internal oscillator (no external crystal required)
 Dual Analog Comparator module:
o Programmable on-chip voltage reference
o Programmable input multiplexing from device inputs and internal voltage
reference
o Comparator outputs are externally accessible

Special Microcontroller Features:

1
 100,000 erase/write cycles Enhanced Flash program memory typical
 1,000,000 typical erase/write cycles EEPROM data memory typical
 EEPROM Data Retention: > 40 years
 In-Circuit Serial Programming™ (ICSP™)via two pins
 Processor read/write access to program memory
 Low-Voltage Programming
 In-Circuit Debugging via two pins
 Extended Watchdog Timer (WDT):
o Programmable period from 1 ms to 268s
 Wide operating voltage range: 2.0V to 5.5V

Pin Diagram

2
Description:

The purpose of this demonstration is to control a LED with a PIC16F88 microcontroller.

Once you get the Kit working, you will be able to make any project with Microchip microcontroller
very quickly and easily which seems wordily to many people at the beginning.

This kit contains a PIC 16F88 chip, programmer and all other parts necessary to make the project.

Parts Used

1x Test board
1x PIC16F88
1x LED Diode
1x JDM PIC programmer and necessary parts

You can find complete documentation in the Data sheets from the Microchip web site.
http://www.microchip.com
http://ww1.microchip.com/downloads/en/DeviceDoc/30487D.pdf

3
The Circuit

The circuit is very simple.

PIC programming

1. Insert PIC16F88 in programmer and connect to PC:

2. Write program in MPLAB IDE

4
Source code:
(Can view) http://www.files.winpicprog.co.uk/Source/16F88.asm

;***************************************************************
title "PIC Sample code: PIC16F88 program"
subtitle "Version 1.1 (c) Jay.slovak"
;Designed for 16F88 @4Mhz
;***************************************************************
list p=16F88
#include <p16F88.inc>
__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF
& _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_OFF & _INTRC_IO
ERRORLEVEL -302
;***************************************************************
z1 equ 20h
z2 equ 21h
z3 equ 22h
z4 equ 23h
;***************************************************************
org 0x0000
goto INIT
NOP
NOP
NOP
NOP
org 0x0005
INIT CLRF PORTA
CLRF PORTB
BSF STATUS,RP0 ;Select Bank 1
CLRF ANSEL ;All pins are Digital
BSF OSCCON,6 ;Set oscilator to 4Mhz
BSF OSCCON,5
MOVLW H'07'
MOVWF CMCON;Turn off comparators
CLRF TRISA ;Port A is output
CLRF TRISB ;Port B is output
BCF STATUS,RP0 ;Select Bank 0

Start MOVLW 0xFF


MOVWF PORTA
MOVWF PORTB
CALL Delay
CLRF PORTA
CLRF PORTB
CALL Delay

5
GOTO Start
;***************************************************************
subtitle "Delay subprogram"
Delay movlw D'3'
movwf z3
movlw D'137'
movwf z2
decfsz z1,f
goto $-1
decfsz z2,f
goto $-3
decfsz z3,f
goto $-5
return
END
;***************************************************************
Required configuration bits:
 Code Protection: OFF
 CCP1 Assignment: B0
 Background Debugger: OFF
 Write Protect: OFF
 Data Code Protection: OFF
 Low Voltage programming: OFF
 Brown-out Detect: OFF
 External MCLR: ON
 Power-up Timer: ON
 WatchDog Timer: OFF
 Oscilator: Internal, no clock-out mode

2.1 Generate HEX. File


(Can view) http://www.files.winpicprog.co.uk/HEX/16F88.HEX

3. Program PIC with HEX code:

6
Flashing LED ... :)

Programmer manual:
http://www.sigma-shop.com/manuals/jdm_manual.pdf

Some projects with PIC microcontrollers:


http://www.files.winpicprog.co.uk/
http://www.best-microcontroller-projects.com/pic-projects.html
http://mondo-technology.com
http://www.electronics-lab.com/blog/?tag=pic16f84

You might also like