You are on page 1of 13

EAB 2604

AUTOMATION IN AGRICULTURE
TITLE : 8-bit LED MODULE

DATE OF EXPERIMENT : 15th July 2017


DATE OF SUBMISSION : 21st July 2017
GROUP : 6
LECTURER : MDM FAIZATUL AZWA BINTI
ZAMRI

NAME MATRIC NO. SIGNA


TURE
NUR FIRDEANNA BINTI S22304
SUHAIK
SUMAIYAH BINTI S22413
BAHARUZAMAN
MOHD AIDIL YAAKOB BIN S22507
ISHAK
SUHASTUTI BINTI S22649
DERMAWAN
AMIRUL SYAFIQ BIN S22673
ZAIDUN
ASRINAH BINTI DATU S23302
ROBINSON
OBJECTIVES

1. To insert the right code of LED pattern into the PICKIT2 program.
2. To identify each of the component on training kit and adapter.
3. To develop student's own LED pattern.
PROCEDURES

1. Program 1 was type and saved using PCW C-Compiler.

2. Program 1 was compiled and no error was detected.


3. Program 1. Hex file was imported into PICKit 2 and button write was click. After
that, verified download program to prevent error in the program.
4. Jumper J3 was connected.

5. PIC connected to the training kit. Then training kit was switch on.
RESULTS AND DISCUSSIONS

PROGRAM 1:

#include<16f877A.h>
#use delay(clock= 20000000 )
#fuses hs, noprotect, nowdt, nolvp
#byte PORTB=6
#byte PORTA=5

void main()
{

Set_tris_b( 0b00000000 ) ;
Set_tris_a( 0b00000000 ) ;

Do
(
portb= 0b01010101;
delay_ms( 5000);
portb= 0b00110011;
delay_ms( 5000);
portb= 0b00100111;
delay_ms( 5000);
}while ( 1);

OUTPUT 1 :
Picture of patterns Descriptions

LED 1,3,5,7 was turned on for


5 seconds.

LED 1,2,5,6 was turned on for 5


seconds.

LED 1,2,3,6 was turned on for 5


seconds.
PROGRAM 2 (Exercise No 1) :

#include<16f877A.h>
#use delay(clock= 20000000 )
#fuses hs, noprotect, nowdt, nolvp
#byte PORTB=6
#byte PORTA=5

void main()
{

Set_tris_b( 0b00000000 ) ;
Set_tris_a( 0b00000000 ) ;

Do
(
portb= 0b01111110;
delay_ms( 7000);
portb= 0b11001111;
delay_ms( 6000);
}while ( 1);

OUTPUT 2 ( Exercise No 1) :
PROGRAM 3 (Exercise No. 3)

#include<16f877A.h>
#use delay(clock= 20000000 )
#fuses hs, noprotect, nowdt, nolvp
#byte PORTB=6
#byte PORTA=5

void main()
{

Set_tris_b( 0b00000000 ) ;
Set_tris_a( 0b00000000 ) ;

Do
(
portb= 0b100001;
delay_ms( 5000);
portb= 0b100010;
delay_ms( 2000);
portb= 0b001100;
delay_ms( 5000);
portb= 0b001010;
delay_ms( 2000);

}while ( 0);

OUTPUT 3 (Exercise No. 3)


Picture of patterns Descriptions

LED 1 and 6 was turned on for 5


seconds.

LED 1 and 5 was turned on for 2


seconds.

LED 3 and 4 was turned on for 5


seconds.
LED 3 and 5 was turned on for 2
seconds.
CONCLUSIONS

As for the conclusion, student have successfully carried on the test based on the given
instruction in the lab manual. The LED on the training kit lights up according to their
subsequence because the inserted LED pattern were correct. Other than that, at the
same time, student easily handle the training kit. They had overlook the training kit
before using them for the experiment. Lastly, student have created the new pattern to
be try on the training kit.

You might also like