Objectives:: Pin Diagram of Pic 16F84A
Objectives:: Pin Diagram of Pic 16F84A
Micro C software,
TopWin2005+,
Microchip(16F84A),
Crystal Oscillator(8MHz),
Resistance(1k),
IC Base,
Connecting wire,
PCB Board,
Adapter.
STEP 1:
At first we select the microcontroller device by which we would like to get our output and used
in control circuit . We used MICROCHIP such as PIC16F84A.
STEP 2:
We download the datasheet’s of specific microcontroller ,from where we get the idea about the
pin description of the specific microcontroller.
STEP 3:
After that we proceed to construct the microcontroller program. This program was converted to
machine language. To do this we used micro C software .
STEP 4 :
In this step, we installed the micro C software and opened it. Here at first from project menu
we select the following part
New Project,
STEP 5:
Then click Build Project(Ctrl+F9).it convert the code to10 file.we need only HEX file. This HEX file
is loaded to the microcontroller by using Programmer.
PROCEDURE SHOWING ON MICRO C SOFTWARE:
OUR PROGRAM IN C LANGUAGE:
void main()
{
trisb=0b00000000; //defining all the pins of port B are output
pins//
while(1) // infinite loop creation //
{
portb=0b00000001; //only the zero positioned pin of port B are HIGH state//
delay_ms(1000); // holding the above states of the pins for
1 second //
portb=0b00000010; // only the one positioned pin of port B are HIGH sates //
delay_ms(1000); // holding the above states of the pins for 1Sec //
portb=0b00000100; // only the two positioned pin of port B are HIGH sates //
delay_ms(1000); // holding the above states of the pins for 1Sec //
portb=0b00001000; // only the three positioned pin of port B are HIGH sates //
delay_ms(1000); // holding the above states of the pins for 1Sec //
}
}
:020000001528C1
:0C00060083120D088A000C08820008001C
:1000120003208A110A128000840A8C0A03198D0AAD
:08002200C003031D09280800BA
:10002A00831686010130831286000B30CB002630FE
:10003A00CC005D30CD00CD0B2028CC0B2028CB0B7B
:10004A00202800000000023086000B30CB0026304A
:10005A00CC005D30CD00CD0B3028CC0B3028CB0B3B
:10006A00302800000000043086000B30CB00263018
:10007A00CC005D30CD00CD0B4028CC0B4028CB0BFB
:10008A00402800000000083086000B30CB002630E4
:10009A00CC005D30CD00CD0B5028CC0B5028CB0BBB
:0A00AA005028000000001728592814
:02400E00FA3F77
:00000001FF
PROGRAM LOADING SYSTEM IN MICROCONTROLLER:
STEP 1:
At first we Installed the programmer software such as TOPwin2005+. Opening the software
from menu (Here the USB port must be connected with CPU).
STEP 2:
STEP 3:
We ensured blank the chip by pressing Erase or blank menu. Opening the file >selecting file
type (moshiurshams.hex) and opening the hex file. Now the hex file placed on buffer zone.
STEP 4:
From clear select menu we select all options such as Erase, Blank, Write, Verify, Config etc.
then we press GO. The chip was automatically Erase,>Blank>Write the code to device>Verify>Read
.Actually here the end of loading hex file to device .
Program one:
int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x08;
Delay_ms(500);
PORTB=0x04;
Delay_ms(1000);
PORTB=0x02;
Delay_ms(2000);
PORTB=0x01;
Delay_ms(3000);
PORTB=0x02;
Delay_ms(3000);
PORTB=0x04;
Delay_ms(3000);
PORTB=0x01;
Delay_ms(3000);
PORTB=0x08;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010830831286000830FC00FF30FB00A8
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000043086001030FC00FF3026
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928023086001F30FC00FF30BE
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000013086002E307B
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B280000023086002B
:100120002E30FC00FF30FB00FF30FA00FC0B99285A
:10013000A028FB0B9C289F28FA0B9C28992896281E
:10014000E430FB00FF30FA00FB0BA728AA28FA0BCB
:10015000A728A4286F30FA00FA0BAC28000004305E
:1001600086002E30FC00FF30FB00FF30FA00FC0B55
:10017000BA28C128FB0BBD28C028FA0BBD28BA2815
:10018000B728E430FB00FF30FA00FB0BC828CB286F
:10019000FA0BC828C5286F30FA00FA0BCD280000EA
:1001A000013086002E30FC00FF30FB00FF30FA00EB
:1001B000FC0BDB28E228FB0BDE28E128FA0BDE280B
:1001C000DB28D828E430FB00FF30FA00FB0BE928DD
:1001D000EC28FA0BE928E6286F30FA00FA0BEE2833
:1001E0000000083086002E30FC00FF30FB00FF309E
:1001F000FA00FC0BFC280329FB0BFF280229FA0B51
:10020000FF28FC28F928E430FB00FF30FA00FB0B44
:100210000A290D29FA0B0A2907296F30FA00FA0B6F
:100220000F29000004281329FF3FFF3FFF3FFF3F36
:02400E00F23F7F
:00000001FF
Program two:
Int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x08;
Delay_ms(500);
PORTB=0x04;
Delay_ms(1000);
PORTB=0x02;
Delay_ms(2000);
PORTB=0x01;
Delay_ms(3000);
PORTB=0x08;
Delay_ms(3000);
PORTB=0x01;
Delay_ms(3000);
PORTB=0x04;
Delay_ms(3000);
PORTB=0x02;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010830831286000830FC00FF30FB00A8
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000043086001030FC00FF3026
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928023086001F30FC00FF30BE
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000013086002E307B
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B2800000830860025
:100120002E30FC00FF30FB00FF30FA00FC0B99285A
:10013000A028FB0B9C289F28FA0B9C28992896281E
:10014000E430FB00FF30FA00FB0BA728AA28FA0BCB
:10015000A728A4286F30FA00FA0BAC280000013061
:1001600086002E30FC00FF30FB00FF30FA00FC0B55
:10017000BA28C128FB0BBD28C028FA0BBD28BA2815
:10018000B728E430FB00FF30FA00FB0BC828CB286F
:10019000FA0BC828C5286F30FA00FA0BCD280000EA
:1001A000043086002E30FC00FF30FB00FF30FA00E8
:1001B000FC0BDB28E228FB0BDE28E128FA0BDE280B
:1001C000DB28D828E430FB00FF30FA00FB0BE928DD
:1001D000EC28FA0BE928E6286F30FA00FA0BEE2833
:1001E0000000023086002E30FC00FF30FB00FF30A4
:1001F000FA00FC0BFC280329FB0BFF280229FA0B51
:10020000FF28FC28F928E430FB00FF30FA00FB0B44
:100210000A290D29FA0B0A2907296F30FA00FA0B6F
:100220000F29000004281329FF3FFF3FFF3FFF3F36
:02400E00F23F7F
:00000001FF
Program three:
int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x04;
Delay_ms(500);
PORTB=0x01;
Delay_ms(1000);
PORTB=0x08;
Delay_ms(2000);
PORTB=0x02;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010430831286000830FC00FF30FB00AC
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000013086001030FC00FF3029
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928083086001F30FC00FF30B8
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000023086002E307A
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B28000004288F2800
:02400E00F23F7F
:00000001FF
Program four:
int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x04;
Delay_ms(500);
PORTB=0x01;
Delay_ms(1000);
PORTB=0x02;
Delay_ms(2000);
PORTB=0x08;
Delay_ms(3000);
}
return 0;
}
Program five :
int main(void)
for(;;)
{TRISB=0;
PORTB=0x02;
Delay_ms(500);
PORTB=0x08;
Delay_ms(1000);
PORTB=0x01;
Delay_ms(2000);
PORTB=0x04;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010230831286000830FC00FF30FB00AE
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000083086001030FC00FF3022
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928013086001F30FC00FF30BF
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000043086002E3078
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B28000004288F2800
:02400E00F23F7F
:00000001FF
Program six:
int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x02;
Delay_ms(500);
PORTB=0x08;
Delay_ms(1000);
PORTB=0x04;
Delay_ms(2000);
PORTB=0x01;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010230831286000830FC00FF30FB00AE
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000083086001030FC00FF3022
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928043086001F30FC00FF30BC
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000013086002E307B
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B28000004288F2800
:02400E00F23F7F
:00000001FF
Program seven:
int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x08;
Delay_ms(500);
PORTB=0x02;
Delay_ms(1000);
PORTB=0x04;
Delay_ms(2000);
PORTB=0x01;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010830831286000830FC00FF30FB00A8
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000023086001030FC00FF3028
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928043086001F30FC00FF30BC
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000013086002E307B
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B28000004288F2800
:02400E00F23F7F
:00000001FF
Program eight:
int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x01;
Delay_ms(500);
PORTB=0x04;
Delay_ms(1000);
PORTB=0x02;
Delay_ms(2000);
PORTB=0x08;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010130831286000830FC00FF30FB00AF
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000043086001030FC00FF3026
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928023086001F30FC00FF30BE
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000083086002E3074
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B28000004288F2800
:02400E00F23F7F
:00000001FF
Program nine:
int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x08;
Delay_ms(500);
PORTB=0x04;
Delay_ms(1000);
PORTB=0x02;
Delay_ms(2000);
PORTB=0x01;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010830831286000830FC00FF30FB00A8
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000043086001030FC00FF3026
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928023086001F30FC00FF30BE
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000013086002E307B
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B28000004288F2800
:02400E00F23F7F
:00000001FF
Program ten:
int main(void)
{
for(;;)
{
TRISB=0;
PORTB=0x01;
Delay_ms(500);
PORTB=0x02;
Delay_ms(1000);
PORTB=0x04;
Delay_ms(2000);
PORTB=0x08;
Delay_ms(3000);
}
return 0;
}
:100000000428FF3FFF3FFF3F0313831603138316AC
:1000100086010130831286000830FC00FF30FB00AF
:10002000FF30FA00FC0B15281C28FB0B18281B2896
:10003000FA0B182815281228A530FB00FF30FA000B
:10004000FB0B23282628FA0B23282028E730FA0068
:10005000FA0B28280000023086001030FC00FF3028
:10006000FB00FF30FA00FC0B36283D28FB0B39283B
:100070003C28FA0B3928362833284C30FB00FF3057
:10008000FA00FB0B44284728FA0B44284128CE30BD
:10009000FA00FA0B4928043086001F30FC00FF30BC
:1000A000FB00FF30FA00FC0B56285D28FB0B59289B
:1000B0005C28FA0B5928562853289830FB00FF304B
:1000C000FA00FB0B64286728FA0B642861289E302D
:1000D000FA00FA0B692800000000083086002E3074
:1000E000FC00FF30FB00FF30FA00FC0B78287F2873
:1000F000FB0B7B287E28FA0B7B2878287528E430B8
:10010000FB00FF30FA00FB0B86288928FA0B8628B3
:1001100083286F30FA00FA0B8B28000004288F2800
:02400E00F23F7F
:00000001FF
DISCUSSION:
We get a better idea about a MICRO C and TOP WIN software and these working
function. Some problem we face while doing this project. We have a TOPWIN software but we have no
loader. So the software does not work. To load the program we went another person. If there is any
problem while loading program the output will not come. If we load the program without selecting chip in
the MICRO C software the light will glow out but actual output will not show which we expect. The
soldering have to be perfect otherwise we will not find the output. We try to do this job very carefully and
perfectly. Though the work is too hard we get more interest.