Sponsored Links .......................................................................................................................................................
 
................................................................................................................................................................................................
Experiment 1. Test Port A Bit 0 ON LED
First Experiment we will test Port RA by on RA0 that connect to LED the schematic for Experiment 1is shown below in Figure 1

Figure 1.1 schematic for Experiment 1Test ON LED ON Port A Bit 0
Assemble circuit as figure 1.1 and load Programming to PIC16F628 after that on power supply you will see result it
 
Source Code For Experiment 1
list p=16f628 ; list directive to define processor
#include <p16f628.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _XT_OSC & _MCLRE_ON & _LVP_OFF
 
org 0x000
clrf PORTA ; Initial PORT A
; output data latches
movlw 0x07 ; Turn Comparator off and
movwf CMCON ; Enable pins for I/O
bsf STATUS,RP0 ; Select Bank 1
movlw b'11111110' ; All PORTA = Input
movwf PORTA ; RA0 = Output
bcf STATUS,RP0 ; Return to Bank 0
bcf PORTA,0 ; RA0 = 0 LED "ON"
goto $
END ; end of program'
Tools & Components
Name List
Quantity
MPLAB
-
PIC16F628
1
4 MHz Crystal
1
LED
1
33 pF Capacitors
2
1K Resistors
1
4.7K Resistors
1
Push Button Switch
1

 

Resources ,Tools & Related
 
Download Source Code Ex1
Download Source Code of Experiment 1. Test Port A Bit 0 ON LED
Download Hardware of PIC16F628
FLASH-Based 8-Bit CMOS Microcontroller
Download MPLAB IDE Version 6.61

Simulation Program of PIC Microchip

 
ICProg Version 1.05F

This software package allows you to program all types of serial programmable Integrated Circuits using Windows 95/98/NT/2000/ME/XP

www.ic-prog.com
Microcontroller Tools
................................................................................................................................................................................................

Copyright 2008-2011 www.electronics-microcontroller.com