0% found this document useful (0 votes)
30 views15 pages

Lab 1 1

Uploaded by

Malak Al-Ashi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views15 pages

Lab 1 1

Uploaded by

Malak Al-Ashi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

The Islamic University of Gaza

Electrical Engineering Department


PIC Lab (EELE 4103)

Lab 1 : Introduction to
Microcontrollers
By: Eng. Malak Ehab Al-Ashi

16/02/2021
What is a pic microcontroller?
•A pic microcontroller is a small computer in a single integrated circuit
containing a processor core, memory and programmable I/O peripherals.
Program memory is also often included on chip, as well as a typical small
amount of RAM. Pic Microcontrollers are designed for embedded
applications.
• Microcontrollers are manufactured by a number of companies with varying
features. As technology is advancing, not only new features are being added
in the previous controllers’ family but new families are also being
introduced. The most common controllers used are PIC, Atmel, AVR, Intel,
ATmega etc. Even in a single family you will find a lot many variations from
number of pins of the chip to number of features provided in it.
Microcontrollers programming
• Typically
pic microcontroller programs must fit in the available on-chip
program memory, since it would be costly to provide a system with external,
expandable memory.
• Compilers and assemblers are used to convert high-level language and
assembler language codes into a compact machine code for storage in the
microcontroller’s memory.
• Depending on the device, the program memory may be permanent, read-
only memory that can only be programmed at the factory or program
memory that may be field-alterable flash or erasable read-only memory.
• PIC Microcontrollers programming in c language (embedded c).
What Functionalities are provided by a
pic Microcontroller?

• General Purpose I/O (GPIO):GPIO pins are software configurable to either an


input or an output state. When GPIO pins are configured to an input state,
they are often used to read sensors or external signals. Configured to the
output state, GPIO pins can drive external devices such as LEDs or motors.
• Analogue-to-Digital Converters (ADC).
• Timers.
• PWM.
• USART.
Compiler MikroC Pro for PIC
Microcontroller programming

• As the name suggests, the compiler is intended for writing programs for PIC
microcontrollers programming in C language. It is provided with all data on
internal architecture of these microcontrollers, operation of particular
circuits, instruction set, names of registers, their accurate addresses, pin-
outs etc.
Instructions

• Every variable must be


declared at the start of
function prior to being
used for the first time in
the program.
Instructions

• Every microcontroller
program you write should
include an infinite while
loop at the end.
Instructions

• Every microcontroller has some special function registers that can be


read and written into. These registers are automatically defined when
you create a project in MikroC. In your program you will write and read
these registers to control various features of you microcontroller.
• TRISB, this registers is define which pins of a port are to be used as inputs
and output.
• PORTB, this register is used to read the digital inputs and write digital
outputs to PORTs.
Software Tools: Proteus
• What is PROTEUS?
• Proteus contains everything you need to develop, test and virtually prototype
your embedded system designs based around the Microchip Technologies™
PIC18 series of microcontrollers.
• This design allows engineers to evolve their projects more quickly,
empowering them with the flexibility to make hardware or firmware changes
at will and reducing the time to market.
• Proteus VSM models will fundamentally work with the exact same HEX file as
you would program the physical device with, binary files (i.e. Intel or Motorola
Hex files) produced by any assembler or compiler.
Software Tools: QL-2006 programmer

• QL-2006 programmer is the high-speed programmer designed specially for


development and production programming of PIC single chip microcomputer
(SCM) by Shenzhen Qianlongsheng Electronic Technology Co., Ltd.
• The product is featured with small volume, low power consumption, high
reliability as well as easy and convenient operation. QL-2006 is applicable for
almost all PIC10/12/16/18 series SCMs except 16C5X. It also supports
memories in 24XX series and 93XX series.
Software Tools: QL-2006 programmer
• Hardware Installation There is no special requirement for installation of this
programmer. Connect programmer to PC through serial port cable or USB
cable and power up, then the programmer works. (This programmer supports
direct USB power supply. If USB cable is connected, you may not connect
external power. However, if current through USB interface is very low – less
than 200MA and insufficient to drive programmer, connection to external
power is required to enable the programmer to work regularly.)
• Software Installation Find file QL-PROGvXXen.EXE under root directory of CD,
double click this file to access installation interface of application software,
and operate according to prompts to finish the installation. Its shortcut will
appear on desktop automatically after installation.
Software Tools: QL-2006 programmer

• Running of Software After


proper installation, shortcut
of this software will appear
on desktop. We can double
click it to run the software.
HW

• Repeat the last task and take a screenshot for your work.
• (Bonus)Take a video for your practical work.

• Deadline: 24/2/2021 at 11:59 PM

You might also like