Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
28 views
19 pages
MCA
Papers
Uploaded by
Dedsec
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
Download
Save
Save MCA For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
28 views
19 pages
MCA
Papers
Uploaded by
Dedsec
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
Carousel Previous
Carousel Next
Download
Save
Save MCA For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save MCA For Later
You are on page 1
/ 19
Search
Fullscreen
Wier sstictmetibenesecraon | SERS begin from the highest address (as shown ) and go downward, whereas GPRS must be used © and go upward. The first 96 bytes (i.e in 000H to OSFH) of the GPRs and the last 160 bytes ‘bank 15, FEOH to FFFH) of the SFRs are grouped into ‘a special bank called access bank ‘The PICI8 also has a 1KB of data EEPROM, which is Feadable and writable during normal operation with no ‘extra power supply. The data EEPROM memory is not directly mapped in the 4096 bytes of register file space; instead, it is indirectly addressed through a special function register. ‘A MOVLB instruction hat been instruction set to assist In selecting, ‘currently selected bank is not sand all writes are witl-return all status register bits will be set/cleared ay {for the instruction performed. 4.11.1(B) Special Function Registers @. Explain @. Explain the special function ‘with PICT8F microcontroller. (May 18, 6 1.11.1(A) Bank Select Register (BSR) — The need for a large general purpose memory space dictates a RAM banking scheme. The data memory is Partitioned into sixteen banks. When using direct addressing, the BSR should be configured for the desired bank. = BSR<3:0> holds the upper 4 bits of the 12-bit RAM address, The BSR<7:4> bits will always read ‘0's and writes will have no effect. aes, — The SFRs begin from the highest address (as Fig. 1.11.2) and go downward, whereas GPRs used from address 0 and go upward, The first 96 (ie. in bank 0, O00H to OSFH) of the GPRs and the) 160 bytes (i.e. in bank 15, F6OH to FFFH) of the: are grouped into a special bank called access bank = The special function registers are basicaly the: includes modules like, reset control, timer serial port communication, parallel ‘communication etc. ~ Fig. 1.11.3 shows the detailed structure of $1 PIC18F458 microcontroller ‘Address | Name Address | Name | Address | Name Freh _| TOsU FoFh _| INDF2@) Ferh | CcPRIH Forh | IPRA ren | TOsH FoEh__| Postinc2”) | Feeh CoPRIL Foth | PIRL FoDh__| Postoec2"2) FBDh | ccPicon | F9ph_—| PIED PREINC22) FBCh | eccpriH) | roch | — Puusw2”) Fash | eccpru® | ropn | — FBah | EccPicon’s)SA difference between interrupt and polling. 6, Dec. 16, May 18, May 19, 05 Marks) are two methods to achieve this synchronization, polling method and interrupt-driven method. When a data is to be read from an input device the interface chip has to latch the data from the input device. While reading from the input devices using these methods are explained as follows 1, The polling method: In this case the interface chip uses a status flag to indicate whether it has read a data from the //O device and is ready for the processor to access it. Whenever the processor wants to access this device, it checks this flag to decide if new data has been received from the input device. The microprocessor may check this status flag continuously or periodically 2. Interrupt-driven method: In this case, the interface chip generates an interrupt signal to the microprocessor whenever it has received new data from the input device. The interrupt service routine is then executed which makes the microprocessor to read the input data. Similarly while writing data to the output device, the microprocessor has to make sure that the output ‘device is not busy. The two synchronization methods implement this as explained follows: methods directly in the hardware. If the user: can add an external parallel interface chip, such a5 ay Intel 8255, to the PIC18 microcontroller, to implement either of the two methods. Interrupt Service Routine (ISR) interrupt occurs and hence explain the ir vector. ee a. What are the different interrupt sot (May 19, 05 Marks) When an interrupt occurs, the processor services the same by executing a small program called a5 Interupt Service Routine (ISR). This ISR is stored in the memory, The address where the ISR is stored is called as an ISR. The interrupt vector addresses for PIC microcontol are as given in the Table 7.2.1 Table 7.2.1 : Interrupt vector table (IVT) forthe PICI Interrupt Power-on Reset [High priority interrupt Low priority interrupt Interrupt sources of PIC 18F listed as follows: me - 2PIC microcontroller can also be directly used as USART (Universal Synchronous or Asynchronous Receiver Transmitter). The different modes permit PIC microcontroller to be used in either of the modes. We need to understand the different registers before interfacing serial port of PIC microcontroller. ‘supports both the Asynd Te ones motes of the USAR. lg ‘bit Baud Rate Generator. SPORG regist rols the period of fer cont co ‘B-bit timer. In Asynchronous mode, bit (TXSTA register) also controls the baud ratg. Synchronous mode, bit BRGH is ignored. for Table 8.4.1 shows the formula ot maa rate for different USART modes which ony apply in Master Mode (internal clock). Given the desired baud rate and Fosc, the near integer value for the SPBRG register can be caleulateg using the formula in Table 8.4.1. From this, the emg in baud rate can be determined. Ex. 8.4.1 shows the calculation of the baud rate error for the following conditions Desired baud BRGH=0 SYNC=0 it may be advantageous to use the high baud rate (BRGH =1) even fo slower baud clocks. This is Because the Foxc/(16(X + 1)) equation can reduce the baud rate error in some cases Wrking a new value to the SPERG register causes ths ERG timer to be reset (or cleared). This ensures te SRG does not wait for a timer overflow before ‘outputting the new baud rate, 842 Sampling "= RC7/RX/DT pin is sampled three times Circuit to Setermine if a high or alow J[_smmc | snow=ous Olt h hero (Asynchronous)Baud rate=Fge/(64(X#1)) | Baud Rate=F/(16(X+2)) : Be | [synchronous)Baud rate= Fox /(4(X+1)) d: X=Value in SPBRG(0 to 255) Table 6.4.2 Value on all other resets (0000-010 0000 - 010 Pome [ome | con R/W-0 - 35 ona umeee patege) Te 5O=tow speed ‘Synchronous mode : ‘Unused in this mode. (bled [RMIT] : Transmit Shift Register Status bit L=TsRempty O=TSRfull ‘bit [Tx9D}: 8" bit of Transmit Data . Can be address/data bit ora parity bit. s Table 8.4.3 : Register associated with asynchronous transmission : 2. | ko [value on POR, BOR Value on al other resets i 0 (0000 000% (0000 000u PIR "| PSPIFE aa 0000 0000 (0000 0000 (EE as 0000 0000 0000 0000 1PR1_| PSPIPC mar 41.1111 qua ReSEEN. 0000 000x 0000 000u ae oe 0000 000 0 0000 0000 ™» TXEN | SYNC 0000-010 coon att ite generator register maaan sama STA (Receive Status and Control Register) a acer iia Sit eee ieee eis ae among other things: SL memeFraming error bit 1 = Framing error O= No Framing error TOERR] D1 = Overrun error bit 1= Overrun error = No overrun error [X09 DO: 9" bit of receive data (Because we use the 8.bit option, we make DO = 0) Can be used as an address/data or a parity bitin some applications. Table 8.4.4 : Registers associated with asynchronous reception 0000 000u 0000 0000 (0000 0000 ‘0000 0000 (0000 0000 q1a41111 1111 1111 ‘0000 000x_ (0000 000u 0000 000 0000 000 (0000 - 010 0000-010 ‘0000 0000 0000 0000 = The most common data format is & bits. An on-chip dedicated 8-bit Baud Rate Generator can be used to ive standard baud rate frequencies from the oscillator.x Transmit shift Rog, Gransmit shift 23 eee Fig. 8.6.2 : Asynchronous transmission Write to TXREG BRG output (Bhift clock) Word 1 Word 2 reg. flag) Word 1 —* Transmit shift ro9. TAMT bit (Transmit shit > __ See e e tog. empty fag) transmission (back to back) Fig. 8.6.3 : Asynchronous chronous Transmission ronous transmission baud rate. If g up Asyn: ow when setting up an async eed baud rates desired, set bit BRGH os . :IF Invorrupt Be Data bus ACIE Fig. 8.7.1 : USART receive block diagram The receiver block diagram is'shown in Fig. 8.7.1. The | 3. Ifinterrupts are desired, set enable bit RCI. Hata Is recelved on the RC7/RX/DT pin and drives the data | 4. 19-bit reception is desired, set bit RX, : recovery block. The data recovery block is actually a high- | 5. Enable the reception by setting bit CREN. ‘speed shifter, cece the a ee where | 6. Flag bit RCIF will be set when reception is cor ‘ receive s rates at the bit rate or Ah eas pe cereenteets “rl Be an interrupt wil be generated if enable systems, 2. Read the RCSTA register to get the ninth | 87.1 Setting up Asynchronous Reception enabled) and determine if any error occurred e reception. swhhow 8 Read the 8-bit received data by reading = Steps to follow when setting up an asynchronous register. aha SM any error occurred, for the appropriate baud fable ie cen “MT “8m baud rate is desired, set bithe BHVACHTONOUS Nevin OM by ce pit and wetting the SPLW ton _— pis are required, vet the Ic desired priory level woth the Rc oe “are she RX bit to enable 9.it reception the ADDEN bit S guate reception by setting the CREN bit Shia RCIF bit will be set when reception is complete the imerrupt will be acknowledged if the RCIE and “BEDI are set feat the RCSTA register to determine if any error © eoourred during reception, as well as read bit 9 of data if applicable) Read RCREG to determine if the device is being addressed, Wiany error occurred, clear the CREN bit. ‘ithe device has been addressed, clear the ADDEN bit tballow all received data into the receive buffer and Interrupt the CPU, enable address detect Programming the PIC18 to Transfer Data Serially ps that must be taken in programming oller to transfer character bytes: gram PIC18 serial port to transfer serial data, Ing steps are to be carried out: : (RCE) should be programmed as output pin bit of RCSTA register should be set to enable ES must be loaded with the count for required be loaded with 20H for asynchronous ud rate and transmission enable- ‘be loaded with the characte to be eanitee aie 6 ws te comet, me ‘ Pm Mi yrrpons se rhino em Stew Sat a oF AIRY Amr nt em FO a Program 8.8.2 : Write a PIC18 program to transter the letter ‘A’ serially at 9600 baud continuously. Let XTAL = 10 MM. Soln. : BCF TRISC,TX, Set TX pin as output pin BCFTRISGTX. ; Setserial portenable MOVLW D’'15’ ; Load the value of SPBRG in 3 Wreg for 9600 baud rate MOVWF SPBRG ; Load into SPBRG “MOVLW‘A’ —;_Load the value in W reg. OVW 'TXSTA ; Load into TXSTA Program 8.8.3: Write a program for PIC18 microcontroller to transfer a letter ‘T’ serially and continuously at a baud rate of 9600. Use BRGH = 0. Assume crystal frequency = 10 MHz Soln. :89 Programming the PIC18 to Receive Data Serially To program PIC18 serial port to receive serial data, the following steps are to be carried out » 1. RX pin (RCT) should be programmed as input pin. 2. RCSTA register should be set to 90H to enable serial _ reception. _ SBREG must be loaded with the count for required ‘baud rate. TA should be loaded with OOH for low baud rate. CIF bit is set, copy the contents of RCREG er Is to be received, goto step 5. ‘program to receive a character and ort D. Assume crystal frequency of 8.10 SPI (Serial Peripheral Interface) [Wii a hor nts on Serprocat — The SPI bus was developed by Motorola and is a, Synchronous bus 2. Full duplex, Bidirectional bus 3, Four wire bus Le. it uses 4 wires. It has @ single master with may be single or mul slave system which is commonly used for high speed serial communication between microcontroller and peripheral devices, such as EEPROMs, data convertors and display drivers. Although we may also have a system with multiple masters in the SPI system, but one of these works as @ master at any given time. As discussed earlier, there are SPI uses four signal lines for communication. They are: Master Out Slave In (MOS!) ; As the name says this signal carries the data from the master to the slave. In some cases this pin is also referred to as Slave Input/Slave Data In (SI/SDI). ‘ Master In Slave Out (MISO) : Similarly this pin is used to carry data from the slave to the master. In some cases this pin is also referred to as Slave Outpl Data Out (SO/SDO). Serial Clock (SCLK) : This is the synchronizing p the clock signal for synchronizing.:18 program: ee ine aia cg (0) Geer a inputs for the PICISF2X8 devices and eight for thePiciaraxa devices. This module has the ADCONOand ADCONI register definitions that are compatible with the PIC micro* midrange A/p module The A/D allows conversion of an analog input signal to a corresponding 10-bit digital number. The A/D module has four registers. These registers 1. A/D Result High Register (ADRESH) 2. A/D Result Low Register (ADRESL) 3. A/D Control Register 0 (ADCONO) 4. A/D Control Register 1 (ADCON1) The ADCONO register, shown in Fig. 9.8.1, controls the operation of the A/D module. The ADCON1 register, shown in Fig. 9.8.2, configures the functions of the port pins. 1 ADCONO Register | Explain in detail ADCON 0. Explain in detail the functions ¢ R/W-0 R/W-0 R/W-O R/W-OR/W-0 R/W-0 U-O R/WO jaDcs1)ADcso| cHs2 | cHs1 | cHSO GO/ Done | = |A20N bit7 bit 7-6 [ADCs1 : ADCSO} bito Fig.9.8.1 : ADCONO :A/ D Control Register 2 A/D Conversion Clock SelectFrc (Clock derived from the internal A/D RC oscillator) Channel 1 (AN1) = Channel 2 (AN2) = Channel 3 (AN3) = Channel 4 (AN4) = Channel 5 (ANS) = Channel 6 (AN6) Channel 7 (AN7) GO/DONE : A/D Conversion Status bit |ADON =1: 7 1=A/D conversion in progress (setting this bit starts the A/D conversion which is automatically cleared by hardware when the A/D conversion is R/W-0 R/W-0 U-O U-OR/W-0 R/W-0 R/W-O R/W-O ADCS2 ae] PCrG3 |rcraz crea] perso] bit7 bit6 bits bita bits bit2 biti bitO ‘ADFM Fig. 982 : ADCONI : A/D Control register bit 7 ADFM : A/D Result Format Select bit 1 Right justified. Six(6) Most Significant bits of ADRESH are readas‘0’. 0 = Left justified. six (6) Least Significant bits of ADRESL are readas‘0’. bit 6 ADCS2 : A/D Conversion Clock Select bit (ADCON1 bits) rs ae
You might also like
Unit Vi
PDF
No ratings yet
Unit Vi
33 pages
Pic MC - Unit-5 (Part-2)
PDF
No ratings yet
Pic MC - Unit-5 (Part-2)
7 pages
T8 Serie
PDF
No ratings yet
T8 Serie
64 pages
UNIT VI - Uart - Adc - Spi
PDF
No ratings yet
UNIT VI - Uart - Adc - Spi
55 pages
Pic Microcontroller 2.1 Pic It Is A Family of Modified Harvard Architecture Microcontrollers Made
PDF
100% (1)
Pic Microcontroller 2.1 Pic It Is A Family of Modified Harvard Architecture Microcontrollers Made
16 pages
Lecture 21-23 - EUSART
PDF
No ratings yet
Lecture 21-23 - EUSART
28 pages
1171564351
PDF
No ratings yet
1171564351
37 pages
Exp 7
PDF
No ratings yet
Exp 7
5 pages
Ec6504 MPMC Unit 3
PDF
No ratings yet
Ec6504 MPMC Unit 3
337 pages
Serial Communications Interface
PDF
No ratings yet
Serial Communications Interface
37 pages
Embedded Systems Lab
PDF
100% (2)
Embedded Systems Lab
60 pages
How To Communicate With PC Using RS232 Protocol: Embedded Systems
PDF
No ratings yet
How To Communicate With PC Using RS232 Protocol: Embedded Systems
10 pages
UART
PDF
No ratings yet
UART
37 pages
Serial Port of 8051
PDF
No ratings yet
Serial Port of 8051
53 pages
09 Communication Modules
PDF
No ratings yet
09 Communication Modules
13 pages
Serial Communications 8051 Serial I/O: One Subroutine For Two Conditions
PDF
No ratings yet
Serial Communications 8051 Serial I/O: One Subroutine For Two Conditions
4 pages
For Unit 3,4,5
PDF
No ratings yet
For Unit 3,4,5
304 pages
MPU Renesas Elenota - PL
PDF
No ratings yet
MPU Renesas Elenota - PL
26 pages
Lecture 3 - Serial Communication
PDF
No ratings yet
Lecture 3 - Serial Communication
37 pages
Part 1
PDF
100% (2)
Part 1
30 pages
Course: Microprocessor B Tech Ece: Date Nov 2020
PDF
No ratings yet
Course: Microprocessor B Tech Ece: Date Nov 2020
77 pages
Eightyfiftyone 3
PDF
No ratings yet
Eightyfiftyone 3
10 pages
Chapter 7 Programmable Interface and Application
PDF
No ratings yet
Chapter 7 Programmable Interface and Application
79 pages
KBS SerialPort
PDF
No ratings yet
KBS SerialPort
58 pages
Usart Coding Method
PDF
No ratings yet
Usart Coding Method
22 pages
Unit III
PDF
No ratings yet
Unit III
42 pages
Unit 5
PDF
No ratings yet
Unit 5
83 pages
UART Architecture
PDF
100% (4)
UART Architecture
23 pages
Section 7.2 - I2CNewMarch27
PDF
100% (1)
Section 7.2 - I2CNewMarch27
32 pages
PIC18F4550 USART - PIC Controllers
PDF
100% (1)
PIC18F4550 USART - PIC Controllers
8 pages
AMP Module I & II
PDF
No ratings yet
AMP Module I & II
69 pages
8155 I/O + Timer 8155 I/O + Timer 8255 I/O 8255 I/O 8253/54 Timer 8253/54 Timer
PDF
No ratings yet
8155 I/O + Timer 8155 I/O + Timer 8255 I/O 8255 I/O 8253/54 Timer 8253/54 Timer
24 pages
Section 18. USART: Highlights
PDF
No ratings yet
Section 18. USART: Highlights
24 pages
SERIAL - PORT
PDF
No ratings yet
SERIAL - PORT
17 pages
Synchronize Communication Interface: 清华 Freescale MCU/DSP 应用开发研究中心
PDF
No ratings yet
Synchronize Communication Interface: 清华 Freescale MCU/DSP 应用开发研究中心
35 pages
Part 1 PIC Microcontroller Systems
PDF
No ratings yet
Part 1 PIC Microcontroller Systems
30 pages
02 The PIC16F877 Memory Map and Programing
PDF
No ratings yet
02 The PIC16F877 Memory Map and Programing
15 pages
MPMC U3 PDF
PDF
No ratings yet
MPMC U3 PDF
178 pages
Pic18 Serial Communication
PDF
100% (4)
Pic18 Serial Communication
25 pages
Project Objective:: Universal Asynchronous Receiver and Transmitter
PDF
No ratings yet
Project Objective:: Universal Asynchronous Receiver and Transmitter
16 pages
ARM Experiment Programms
PDF
No ratings yet
ARM Experiment Programms
52 pages
Unit 5
PDF
No ratings yet
Unit 5
96 pages
Microprocessor Unit 5
PDF
No ratings yet
Microprocessor Unit 5
39 pages
Day 3 PM Serial Com
PDF
100% (1)
Day 3 PM Serial Com
16 pages
SerialCommunications Ar
PDF
No ratings yet
SerialCommunications Ar
49 pages
Proc Embarqué - Ch5
PDF
No ratings yet
Proc Embarqué - Ch5
47 pages
UART
PDF
100% (1)
UART
27 pages
Serial Communication With 8051
PDF
No ratings yet
Serial Communication With 8051
25 pages
MC Module 4 Serial Communication
PDF
No ratings yet
MC Module 4 Serial Communication
44 pages
End Focus
PDF
No ratings yet
End Focus
38 pages
MC Module 3
PDF
No ratings yet
MC Module 3
108 pages
8255 Ppi
PDF
No ratings yet
8255 Ppi
28 pages
Embedded Systems: 1. CD/DCD (Carrier Detect/ Data Carrier Detect) 2. RXD (Receiver Pin) 3. TXD (Transmission Pin)
PDF
No ratings yet
Embedded Systems: 1. CD/DCD (Carrier Detect/ Data Carrier Detect) 2. RXD (Receiver Pin) 3. TXD (Transmission Pin)
6 pages
Embedded Processer - Merged PDF
PDF
No ratings yet
Embedded Processer - Merged PDF
29 pages
S9 Processeurs MSP 432 UART
PDF
No ratings yet
S9 Processeurs MSP 432 UART
13 pages
21cs1302-Camp-Unit 5 - Notes
PDF
No ratings yet
21cs1302-Camp-Unit 5 - Notes
27 pages
Microprocessor 8085
PDF
No ratings yet
Microprocessor 8085
63 pages
Unit 5
PDF
No ratings yet
Unit 5
59 pages
EACM Last Year Transformer
PDF
No ratings yet
EACM Last Year Transformer
4 pages
Assignment No 7
PDF
80% (5)
Assignment No 7
3 pages
Irjet V7i1161
PDF
No ratings yet
Irjet V7i1161
6 pages
Blank Hall Tickets
PDF
No ratings yet
Blank Hall Tickets
1 page
Assignmentno 2
PDF
100% (1)
Assignmentno 2
3 pages
(H) Bootstrap Component Selection For IR2184 Half - 230913 - 151348
PDF
No ratings yet
(H) Bootstrap Component Selection For IR2184 Half - 230913 - 151348
9 pages
Assignment No.3
PDF
No ratings yet
Assignment No.3
5 pages
Omron Automation SEMINAR Report
PDF
No ratings yet
Omron Automation SEMINAR Report
3 pages
List of Experiment & Co's (Theory & Lab) - MCA
PDF
No ratings yet
List of Experiment & Co's (Theory & Lab) - MCA
2 pages
Final Eps 3 Questions
PDF
No ratings yet
Final Eps 3 Questions
3 pages
CSD QP
PDF
No ratings yet
CSD QP
21 pages
Assignment No. 2 - MCA
PDF
No ratings yet
Assignment No. 2 - MCA
1 page