You are on page 1of 9

Gift University Gujranwala Electrical Engineering

Prepared By:

Engr. Umair Ahsan

Updated on: November 06, 2019

Introduction to Embedded System


Gift University Gujranwala Electrical Engineering

Name: ____________________________________________

Registration No: ____________________________________

Roll No: ___________________________________________

Semester: _________________________________________

Batch: ____________________________________________

Introduction to Embedded System Page 1


Gift University Gujranwala Electrical Engineering

Introduction to PIC18F458/452, Trainer board,


PCB Designing and Fabrication

EXPERIMENT NO. 01

Name Report Marks Lab Viva Marks Total


(5) Performance (5) (15)
(5)

Introduction to Embedded System Page 2


Gift University Gujranwala Electrical Engineering

LABORATORY REGULATIONS AND SAFETY RULES

The following Regulations and Safety Rules must be observed in all concerned
laboratory location.

1. It is the duty of all concerned who use any electrical laboratory to take all reasonable steps to
safeguard the HEALTH and SAFETY of themselves and all other users and visitors.
2. Be sure that all equipment is properly working before using them for laboratory exercises.
Any defective equipment must be reported immediately to the Lab. Instructors or Lab.
Technical Staff.
3. Students are allowed to use only the equipment provided in the experiment manual or
equipment used for senior project laboratory.
4. Power supply terminals connected to any circuit are only energized with the presence of the
Instructor or Lab. Staff.
5. Students should keep a safe distance from the circuit breakers, electric circuits or any moving
parts during the experiment.
6. Avoid any part of your body to be connected to the energized circuit and ground.
7. Switch off the equipment and disconnect the power supplies from the circuit before leaving
the laboratory.
8. Observe cleanliness and proper laboratory housekeeping of the equipment and other related
accessories.
9. Wear proper clothes and safety gloves or goggles required in working areas that involves
fabrications of printed circuit boards, chemicals process control system, antenna
communication equipment and laser facility laboratories.
10. Double check your circuit connections specifically in handling electrical power machines, AC
motors and generators before switching “ON” the power supply.
11. Make sure that the last connection to be made in your circuit is the power supply and first
thing to be disconnected is also the power supply.
12. Equipment should not be removed, transferred to any location without permission from the
laboratory staff.
13. Software installation in any computer laboratory is not allowed without the permission from
the Laboratory Staff.
14. Computer games are strictly prohibited in the computer laboratory.
15. Students are not allowed to use any equipment without proper orientation and actual hands
on equipment operation.
16. Smoking and drinking in the laboratory are not permitted.
17. All these rules and regulations are necessary precaution in Electrical Laboratory to safeguard
the students, laboratory staff, the equipment and other laboratory users.

Introduction to Embedded System Page 3


Gift University Gujranwala Electrical Engineering

EXPERIMENT NO. 01
Introduction to PIC18F458/452, Trainer board, PCB Designing and
Fabrication
Objective:
 Basics of PIC18F458/452
 Introduction to components of trainer board IT-4310
 Designing of development board

Introduction to PIC 18F458:

Download the datasheet and go through the basics and working of PIC18

Features of the PIC18 microcontroller

• 8-bit CPU
• 2 MB program memory space
• 256 bytes to 1KB of data EEPROM
• Up to 3968 bytes of on-chip SRAM
• 4 KB to 128KB flash program memory
• Sophisticated timer functions that include:
• input capture, output compare, PWM, real-time interrupt, and watchdog timer
• Serial communication interfaces:
• SCI SPI I2C
• CAN Serial communication interfaces:
• SCI, SPI, I2C
• CAN –Background debug mode (BDM)
• 10-bit A/D converter
• Memory protection capability
• Instruction pipelining
• Operates at up to 40 MHz crystal oscillator

The PIC18F458 implement 77 instructions with 73 instructions in 16 bits, and the remaining four
are in 32 bits. The device has a 21-bit program counter that is divided into three registers: PCU,
PCH, PCL and is capable of addressing a 2-Mbyte program memory space. The Reset vector
address is at 0000h and the interrupt vector addresses are at 0008h and 0018h. The data memory
is implemented as SRAM where each location in the data memory is also referred as a register
or file register. The PIC18 supports 4096 bytes of data memory and requires a 12-bit address to
select one of the data registers. However, only eight bits of the PIC18 instruction are used to
specify the file register to be operated on due to the limited length of the PIC18 instruction.
Therefore, the 4096 file registers are divided into 16 banks EEEB371 E1- 3 and only one bank
of 256 file registers is active at any one time. An additional four bits are placed in a special
register called bank select register (BSR) and to select the bank to be active, the user needs to
change the contents of the BSR. There are two types of registers: general purpose registers
(GPRs) and special-function registers (SFRs).

Introduction to Embedded System Page 4


Gift University Gujranwala Electrical Engineering

GPRs are used to hold dynamic data while the SFRs are used by the CPU and peripheral
modules for controlling the desired MCU operations.

Introduction to Trainer Board IT-4310


Following peripherals are available on trainer board and their use and
corresponding functionality will be discussed during lab session.

• Graphical LCD
• Character LCD
• Seven Segment Display
• LED’s and Switch’s array
• Keypad
• Programmable Peripheral Interface (PPI)
• Serial I2C EEPROM
• A/D and D/A converters
• DC, Stepper, Servo motors
• Computer Serial Port interface
• Target Devices
• Mountable MCU card

Instruction cycle:
Each instruction takes ¼th of clock frequency i.e., 4 Oscillator Periods. If PIC is
operated by an external oscillator of 4MHz, then 1 instruction cycle takes 1 μsec as
calculated below

PCB Designing and fabrication

Design PCB layout on proteous, implement on hardware for testing your code on hardware
Use exact values of non-polar capacitor and crystal.
Follow the same pin configuration for accurate working of microcontroller

Introduction to Embedded System Page 5


Gift University Gujranwala Electrical Engineering

Pin Diagram

Introduction to Embedded System Page 6


Gift University Gujranwala Electrical Engineering

Observations: (2 Marks)
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
_________________________________________________________

Introduction to Embedded System


Gift University Gujranwala Electrical Engineering

Review Questions

1. Differentiate between PIC 18f452 and 8051 (1 Marks)

___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
______________________________________________________

2. What are the advantages of PIC over 8051 (1 Marks)

___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
______________________________________________________

3. Why we use PIC instead of Arduino board? (1 Marks)

___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
______________________________________________________

Introduction to Embedded System Page 1

You might also like