0 ratings0% found this document useful (0 votes) 132 views6 pagesPIC Architecture
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
UNIT
PIC ARCHITECTURE
PART-A
‘SHORT QUESTIONS WITH SOLUTIONS
Q1. List few members of PIC 18 microcontroller family.
Ans:
Few members of PIC 18 microcontroller family are as follows, “ote
1. PICISF1220
2. PICI8F2420
3. PICI8F2220
4. PICISE4!
S$. PICI8F4520
6.
7
8.
PICISFaSS.
PICISFass
PICISFS
Q2. Mention the file register size for PIC chips.
Ans:
The file register size for various PIC microcontroller chips are as follows,
Picisrias0 | picisrsa | Piciema0 | Picnics | PIClere7aa
[Microcontroller Chip
File register (Bytes) 512 1792 768 1792, 4096.
SFR (Bytes) 256 286 256 158
GPR (Bytes) Bred 1536 512 1536 3938
Differentiate 8051 microcontroller from PIC18F458 microcontrollers.
PICI8F458 Microcontroller
it microcontroller.
It is an 8-bit microcontroller.
[thas 2MB of program ROM.
Ithas 4 kB of data RAM.
has 4-imers.
thas 33 VO pins
It has 64 kB of program ROM.
Ithas 256 bytes of data RAM.
Ithas 3 timers.
It has 32 Y/O pins.
7
SPECTRUM ALL-IN-ONE JOURNAL FOR ENGINEERING STUDENTS5.2________MICROPROCESSORS AND MICROCONTROLLERS [JNTU-KAKINADAI
7 about ‘Program ROM.
ans : Model Papert, ai(6)
ROM stores the programs (code)
Itis also known as programer code ROM,
“The sizeof program ROM is2 Mi and varie fom 4 Kt F284 respective ofthe family member while writing into it
itis availabe in sever memory ype ies, One-Time Program (OTP) and asked wit separate part number
‘5. _ List out the VO ports of PIC1EF458 microcontroller.
‘The PIC18F458 microcontroller has five ports namely
PotA
Port B
PortD
Port E
{@6. . Mention the special function registers used by VO ports in PIC18F458 microcontroller.
1
2
3. Potc
4
5.
‘The special faction reper sed by LO pons in PICIBE4S8 mirocontolr are as fllows,
1 PORTX
2 TRISX
3. LATX
Look for the SIA GROUP LoGo {i on the TITLE COVER before you buySy a eR A SE SR PSS
UNIT-5_(PIC Architecture)
PART-B
ESSAY QUESTIONS WITH SOLUTIONS
5.1 BLOCK DIAGRAM OF BASIC PIC1s MICRO CONTROLLER:
Q7. List the features of PIC18xxx microcontroller family, Model Papen g
Ans: The festures of PICISaxx microcontroller family are as follows,
1. They are S-bvt microcontrollers and contain RISC architecture
2. They support 16-bit wide instructions.
3. They are available in 18 to 80 pin package.
4. ‘They have 2MR of program ROM space and varies from 4 KB to 128 kB with respeet to the family member,
5. They contain 4 KB of data RAM space and varies from 256 bytes to 4096 bytes.
6 They allot 16 1 72 pins for VO pons,
family is superior to other 8-bit microcontroller,
include an On-chip program ROM, data RAM, data EEPROM, timers, ADC and USART.
Ga. Compare the various members of PIC18 microcontroller family.
Ans:
7 This
The comparison of various members of PICIS microcontroller family is mentioned below,
Microcontralier
Features
Number of Pins 1 2 8 0 40 40
or or oP or oP oP Dr
16 6 Fy 4 38 4 36
16Ke ane swe | sone | 32ke 32kB
Data RAM Sp TeBBytes | Si2Byies | 1596Bytes | 1596 Bytes’ | 1596 Bytes | 1596 Bytes
ra EEPROM o 256 Bytes | 255Byee | 256Bytes | 256 Bytes | 256 Bytes
4 4 4 4 4 4
rowit obit roi Toit obit rosit
Memory Flash Flash ash Flash Flash Flash
Explain the functional description of PIC18 microcontroller.
The function
.gram of PICLX microcontroller is as shown in figure,
Los | ae =| | :
Tnterraph Other
ae Timers Pons
Gee ose peripherals
Gi
SPECTRUM ALL-IN-ONE JOURNAL FOR ENGINEERING STUDENTS
Si5.4
Program Roy
Data RAM and EEPROM
2,
3
4,
"The sie of data RAM is 4B and varies fom 236 Bytes 4096 bytes with respect to the family member
PICI8 microcontroller family allots 16 to 72 pins for VO.
8 ll
cRoPRocessons [AND MICROCONTROLLERS [JNTU-KAKINADA]
functig
Mal de;
Sepap
aha
ontolerisas follows,
ROM stores
© Pro,
5a. knowing nn ose
* ROM or code ROM,
as
The size stim es
ROn t
1S2 and varie fom 44 o 12840 respective ofthe family member while wring nto
loping PIC my
IF eg the ROM eee with UV-EPROM a PROM bumer is tequied and UVEPROM eroscr necessary
-ontens,
itrequires more time (20 minutes) to erase the contents before reprogramming.
jerocontroller has introduced.
This m gs
a SmOtY EFS he contents of ROM quickly compared to UVEPROM.
developin,
: oping a PIC microcontroller ‘with flash ROM, it requires a ROM burner which supports flash memory.
It does i
TOUreie separate eratr to erage the contents since it is performed by ROM programmer
‘The Contents oF ROM in fash memory must bo erased to reprogram it 4
RAM stores data,
Data RAM space consists of wo elements namely general purpose RAM (GRR) and Special Funston Registers (SFRS).
EEPROM stores critical data that cannot be changed frequently.
2. VO pins rely upon the number of pins in the package.
3. For PICL8 package, the VO pins vary from 18 to 80.
Peripherals
1. PICLS family se standard peripherals such as ADC, timers and USART.
2. PIC microcontoller uses 10 bit ADC and its channel vary from 5 to 16 accordance’ with number of pins in package.
3.° PIC microcontroller has 4 timers along with a watchdog timer. « .
4. USART connects PIC-18 based systems to serial port,
Look for the SIA GROUP LOGO {J on the TITLE COVER before you buy
oo!PALS TES SS BEL CS SRS EB RA
UNIT-5_(PIC Architecture)
5.2 REGISTERS ‘e
Q10. Explain about WREG register in PIC microcontroller.
Ans:
PIC microcontrollers contain several registers to perform arithmetic and logical operations, Out of those registers.
register (WREG) #6 widely used
g register is a S-bit wide register used to store the information temporarily-Sinee, itis an 8-bit wide,
more than S-bits is initially divided into one-byte chunks and proceeds the operation. Its operation is similar to an aceury
use of WREG register can be described withthe two instructions, MOVE and ADD,
in microprocessors. For instance, th
MOVL WK ; Moves the literal value k (S-bits) into WREG register.
‘The syntax for ADD instruction is,
ADD__LWk: Adds the literal value k to WREG «
11. Explain about PIC file register.
et and stores the result in WREG register.
Ans:
lata, Scratch pad and other registers forit
ns cam be performed on various RAM locations of file
Special Function Registers
Those are b-but wade registers specially alloted wo particulor function like ALU status ier, serial commuica
ters are fixed by the CPU designers while manufacturing they control the pe
ster and rely on the pin numbers and peripheral
SPR locations in file register may differ from one ehip to ether and within the same family member.
ports. ADC ete, The function of these r
and microcos
The number
Geners
Purpose Registers
General purpose registers are also known as gencral purpose RAM.
cach of S-bits wide in file register for storing data and scratch pu. The RAM locations of these registers are preser
6 land may differ {rom one chip to other and also. within the same fa
SPs 1s PIC microcontroller ean be used by the purpose registers.
5.3 0 PORTS
the UO ports of PIC 18F458 microconwoller.
012. Expla
Ans:
The 40 pin PICIAP4S® microcontroller has five ports namely, Po
ichon registers, PORTS, TRISX and LATS. By setting the bits in TRISx register to *11* (or) ‘0
‘or output port
correspe PORTS acts as snput po
Porta
ins. RAO 10 RAG. Among these 7 pins, RAG pin is used for OSC2.
inpuvoutput port of 7
“cng ats bits externally tthe pin and setting TRISA register bits:
11s a bidirecuon
utput port by co
Ifthe bus an “TRISA’ sets to PORTA aets as input port
tthe basin “TRISAT
The PICs microcontroller muluplener is an analog to digital converter Via PORT A to save 1/0 pins, The pins Off
wn an figure (1)
sets 10 “0°, PORTA acts as output port
Abas alternate {unctian
RAB RRS naa | a3 Raa RAT RAO
OSC2ICiKO ANAISSILVDIN TOCL ANSIVREF+ ANZIVREF. ANI ANOICVREF
mh
Figure (1: Alternate Functions of
SPECTRUM ALLAN-ONE JOURNAL FOR ENGINEERING STUDENTSMICROPROCESSORS AND MICROCONTROLLERS [JNTU-KAKINADA]
etional in
comeing sg Pe tf pin. RB to RRT These is ener 8 nt porto ouput por by
© ifthe bits in TRisp, 'Y to the pin 2 setting the TRISB register bi
sets 0),
Ue bitin Tagg ne Pet B At input port
ISB resets to ;
The PICI8 mi Pom B acts as output pot
35 chown in figure a) Miblenes with other functions to save VO pins. The pins of Port B his alternate functions.
fer} nee | es | moa | nea naz nor | Reo
roo Po Few CANE INTICANT INT INTO
Figure 2: Alternate Funetions of Port B 7
ee igure (2
Ts bidirectional inpuvouput port of 8 pins, RCO to RCT. These pins can either act as input pért or output port by
‘ing its bits externally tothe pin and setting the TRISC register bits.
# Ifthe bits in TRISC sets to 1, Pot C acts as input pot.
Ifthe bits in TRISC resets to ‘0° Port C acts as output port.
‘The pins of port C has alternate functions as shown in figure (3)-
Rey | ace | cs | ace Rea Roz RCI Reo
Axor Txtk “s00—“SONSDA—«SCKISCL «COPY. THOS! = THOSO/TICKI
Figure (3: Alternate Functions of Port ©
PotD | i :
It is a bidirectional inpuvoutput port of 8 pins, RDO to RDT: These pins can either acts as input port or output port by
connecting its bits extemally tothe pin ad setting the TRISD register bits,
% Ifthe bits in TRISD sets to “1", port D acis as input port. E
% Ifthe bits in TRISD resets to'0, port D acts as output port.
‘The pins of port D has alternate functions as shown in figure (4). : f
07 |. nos | nos ADs 03 R02 ROI ROO :
PSP7IPID PSPGPIC PSPSIPIB PSPHECCPIIPTA PSPSIGZIN- PSPZICZIN+ PSPIICIIN- _PSPOICIIN
Figura (4: Alternate Functions of Port D i
Port E
Itis a bidirectional inputfoutput port of 3 pins, REO to RE2. This port is used for simple /O operations ie., ANS, ANG
and AN7 or additional analog inputs.
Look for the SIA GROUP LOGO {J on the TITLE COVER before you buy