મુખ્ય સામગ્રી પર જાઓ
  1. સંસાધનો/
  2. અભ્યાસ સામગ્રી/
  3. ઇન્ફોર્મેશન અને કમ્યુનિકેશન ટેકનોલોજી એન્જિનિયરિંગ/
  4. આઈસીટી સેમેસ્ટર 3/
  5. માઇક્રોપ્રોસેસર અને માઇક્રોકંટ્રોલર સિસ્ટમ્સ (1333202)/

માઇક્રોપ્રોસેસર અને માઇક્રોકન્ટ્રોલર સિસ્ટમ્સ (1333202) - શિયાળો 2024 સોલ્યુશન

22 મિનિટ· ·
અભ્યાસ-સામગ્રી સોલ્યુશન માઇક્રોપ્રોસેસર માઇક્રોકન્ટ્રોલર 8085 8051 1333202 2024 શિયાળો
મિલવ ડબગર
લેખક
મિલવ ડબગર
ઇલેક્ટ્રિકલ અને ઇલેક્ટ્રોનિક મેન્યુફેક્ચરિંગ ઉદ્યોગમાં અનુભવી લેક્ચરર. એમ્બેડેડ સિસ્ટમ્સ, ઈમેજ પ્રોસેસિંગ, ડેટા સાયન્સ, મેટલેબ, પાયથન, STM32માં કુશળ. એલ.ડી. કોલેજ ઓફ એન્જિનિયરિંગ - અમદાવાદથી કમ્યુનિકેશન સિસ્ટમ્સ એન્જિનિયરિંગમાં માસ્ટર્સ ડિગ્રી ધરાવતા મજબૂત શિક્ષણ વ્યાવસાયિક.
અનુક્રમણિકા

પ્રશ્ન 1(અ) [3 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલરના ફીચર્સની યાદી બનાવો.

જવાબ:

8051 માઇક્રોકન્ટ્રોલરમાં કેટલાક મહત્વના ફીચર્સ છે:

ફીચરવર્ણન
CPUControl applications માટે optimized 8-bit CPU
Memory4KB internal ROM, 128 bytes internal RAM
I/O Ports4 bidirectional 8-bit I/O ports (P0-P3)
Timersબે 16-bit timer/counters (Timer 0 & Timer 1)
Interrupts2 priority levels સાથે 5 interrupt sources
Serial PortSerial communication માટે full duplex UART

મેમરી ટ્રીક: “CPU Memory Input-Output Timers Interrupts Serial” (C-MIT-IS)

પ્રશ્ન 1(બ) [4 ગુણ]
#

વ્યાખ્યા આપો: Opcode, Operand, Instruction cycle, Machine cycle

જવાબ:

શબ્દવ્યાખ્યા
OpcodeOperation code જે કરવાનું operation specify કરે છે
OperandData અથવા address જેના પર operation કરવામાં આવે છે
Instruction CycleInstruction ને fetch, decode અને execute કરવાની સંપૂર્ણ પ્રક્રિયા
Machine CycleMemory અથવા I/O device ને access કરવા માટે જરૂરી સમય

ડાયાગ્રામ:

graph LR
    A[Fetch] --> B[Decode] --> C[Execute]
    C --> A
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#e8f5e8

મેમરી ટ્રીક: “OOID” - Opcode Operand Instruction-cycle Data-cycle

પ્રશ્ન 1(ક) [7 ગુણ]
#

Von Neumann અને Harvard Architecture ની સરખામણી કરો.

જવાબ:

ParameterVon NeumannHarvard
Memory StructureProgram અને data માટે single memoryProgram અને data માટે separate memory
Bus SystemSingle bus systemProgram અને data માટે separate bus
SpeedBus conflicts થી slowerSimultaneous access થી faster
CostLower costHigher cost
ComplexitySimple designComplex design
Examples8085, x86 processors8051, DSP processors

ડાયાગ્રામ:

graph TB
    subgraph "Von Neumann"
        A[CPU] --- B[Single Bus]
        B --- C[Memory<br/>Program + Data]
    end
    
    subgraph "Harvard" 
        D[CPU] --- E[Program Bus]
        D --- F[Data Bus]
        E --- G[Program Memory]
        F --- H[Data Memory]
    end

મેમરી ટ્રીક: “VSBSC vs HSDFC” (Von-Single-Bus-Simple-Cheap vs Harvard-Separate-Dual-Fast-Complex)

પ્રશ્ન 1(ક) OR [7 ગુણ]
#

RISC અને CISC ની સરખામણી કરો.

જવાબ:

ParameterRISCCISC
Instruction SetReduced, simple instructionsComplex instruction set
Instruction SizeFixed size instructionsVariable size instructions
Execution TimeSingle clock cycle per instructionMultiple clock cycles
Memory AccessLoad/Store architectureMemory-to-memory operations
CompilerComplex compiler જરૂરીSimple compiler
ExamplesARM, MIPS8085, x86

ડાયાગ્રામ:

graph LR
    subgraph "RISC"
        A[Simple Instructions] --> B[Fast Execution]
        B --> C[Complex Compiler]
    end
    
    subgraph "CISC"
        D[Complex Instructions] --> E[Slow Execution]
        E --> F[Simple Compiler]
    end

મેમરી ટ્રીક: “RISC-SFS vs CISC-CSS” (Simple-Fast-Complex vs Complex-Slow-Simple)

પ્રશ્ન 2(અ) [3 ગુણ]
#

8085 માં ઉપલબ્ધ 16-bit Registers ની યાદી બનાવો અને તેનું કાર્ય સમજાવો.

જવાબ:

Registerકાર્ય
PC (Program Counter)Next instruction address નો pointer
SP (Stack Pointer)Memory માં stack ના top નો pointer
BC, DE, HLData storage માટે general purpose register pairs
  • PC: દરેક instruction fetch પછી automatically increment થાય છે
  • SP: PUSH operations દરમિયાન decrement, POP દરમિયાન increment થાય છે
  • Register Pairs: 16-bit addresses અથવા data store કરી શકે છે

મેમરી ટ્રીક: “PC SP BDH” (Program-Counter Stack-Pointer BC-DE-HL)

પ્રશ્ન 2(બ) [4 ગુણ]
#

8085 માં Address અને Data Bus ડી-મલ્ટિપ્લેક્સિંગ સમજાવો.

જવાબ:

De-multiplexing AD0-AD7 pins માંથી address અને data signals ને અલગ કરે છે.

પ્રક્રિયા:

  • ALE (Address Latch Enable) signal આ પ્રક્રિયાને control કરે છે
  • T1 state દરમિયાન: AD0-AD7 માં lower 8-bit address હોય છે
  • ALE HIGH જાય છે: Address external latch (74LS373) માં latch થાય છે
  • T2-T3 દરમિયાન: AD0-AD7 data bus બને છે

ડાયાગ્રામ:

AD0-78085D0-ADL7E(Data7L4aBLtuScs3h)73A0-A7

મેમરી ટ્રીક: “ALE Latches Address Low”

પ્રશ્ન 2(ક) [7 ગુણ]
#

આકૃતિની મદદથી 8085 નો Pin Diagram સમજાવો.

જવાબ:

8085 એ 40-pin microprocessor છે જેમાં નીચેનું pin configuration છે:

Pin Groupકાર્ય
AD0-AD7Multiplexed Address/Data bus (Lower 8-bit)
A8-A15Higher order Address bus
ALEAddress Latch Enable signal
RD, WRRead અને Write control signals
IO/MI/O અથવા Memory operation indicator
S0, S1Status signals

Pin Diagram:

RRRRETSSSIISSSRTTTNNAAAAAAAAVXXEOIA765TTDDDDDDDDs12TDDP...RA01234567s555------123456789111111111120123456789080854333333333322222222209876543210987654321VHHCRRISRWASAAAAAAAAcOLLEEO1DRL011111198cLDKSA/E543210DAEDMTYIN

મુખ્ય વિશેષતાઓ:

  • 40-pin DIP package
  • Multiplexed bus pin count ઘટાડે છે
  • Control signals timing અને operation માટે
  • Interrupt pins external device communication માટે

મેમરી ટ્રીક: “Address Data Control Power Interrupt” (ADCPI)

પ્રશ્ન 2(અ) OR [3 ગુણ]
#

8085 માં Instruction Fetching Operation સમજાવો.

જવાબ:

Instruction fetching એ instruction cycle નું પહેલું પગલું છે:

પગલાં:

  1. PC contents address bus (A0-A15) પર મૂકવામાં આવે છે
  2. ALE signal high જાય છે address latch કરવા માટે
  3. RD signal low જાય છે memory read કરવા માટે
  4. Instruction memory માંથી data bus પર fetch થાય છે
  5. PC increment થાય છે next instruction માટે

Timing:

  • Machine cycle ના T1 અને T2 states દરમિયાન થાય છે
  • Simple instructions માટે 4 clock cycles લે છે

મેમરી ટ્રીક: “PC ALE RD Fetch Increment” (PARFI)

પ્રશ્ન 2(બ) OR [4 ગુણ]
#

8085 નો Flag Register સમજાવો.

જવાબ:

Flag Register arithmetic/logical operations પછી status information store કરે છે:

BitFlagકાર્ય
D7S (Sign)Result negative હોય તો set થાય છે
D6Z (Zero)Result zero હોય તો set થાય છે
D5-Use થતું નથી
D4AC (Auxiliary Carry)Bit 3 થી 4 માં carry હોય તો set
D3-Use થતું નથી
D2P (Parity)Result માં even parity હોય તો set
D1-Use થતું નથી
D0CY (Carry)Carry/borrow generate થાય તો set

ડાયાગ્રામ:

D7SD6ZD5XD4ACD3XD2PD1XD0CY

મેમરી ટ્રીક: “S-Z-X-AC-X-P-X-CY”

પ્રશ્ન 2(ક) OR [7 ગુણ]
#

આકૃતિની મદદથી 8085 નું Architecture સમજાવો.

જવાબ:

8085 architecture માં કેટલાક functional blocks છે:

મુખ્ય Components:

  • ALU (Arithmetic Logic Unit): Arithmetic અને logical operations કરે છે
  • Registers: Data અને addresses temporarily store કરે છે
  • Control Unit: Operation માટે control signals generate કરે છે
  • Address/Data Bus: External devices સાથે communicate કરે છે

Block Diagram:

graph TB
    subgraph "8085 Architecture"
        A[Accumulator<br/>A] 
        B[Registers<br/>B,C,D,E,H,L]
        C[ALU]
        D[Flags]
        E[PC]
        F[SP]
        G[Control Unit]
        H[Address Bus<br/>A0-A15]
        I[Data Bus<br/>AD0-AD7]
        
        A <--> C
        B <--> C
        C --> D
        G --> H
        G <--> I
        E --> H
        F --> H
    end

મુખ્ય વિશેષતાઓ:

  • 8-bit microprocessor 16-bit address bus સાથે
  • Von Neumann architecture shared bus સાથે
  • Register-based operations faster execution માટે
  • Interrupt capability real-time applications માટે

મેમરી ટ્રીક: “ALU Registers Control Address Data” (ARCAD)

પ્રશ્ન 3(અ) [3 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલરની Internal RAM Organization સમજાવો.

જવાબ:

8051 માં 128 bytes નું internal RAM આ પ્રમાણે organized છે:

Address Rangeહેતુ
00H-1FHRegister Banks (4 banks, દરેકમાં 8 registers)
20H-2FHBit Addressable Area (16 bytes)
30H-7FHGeneral Purpose RAM (80 bytes)

Organization:

  • Bank 0: 00H-07H (Default register bank)
  • Bank 1: 08H-0FH
  • Bank 2: 10H-17H
  • Bank 3: 18H-1FH

ડાયાગ્રામ:

7320F000HHHHGBeiRnteBegarAAinaRdrsklAdetsMraePerusrspaobslee

મેમરી ટ્રીક: “Register Bit General” (RBG)

પ્રશ્ન 3(બ) [4 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલરના TMOD SFR ના દરેક bit નું કાર્ય સમજાવો.

જવાબ:

TMOD (Timer Mode) register Timer 0 અને Timer 1 ના operation ને control કરે છે:

Bitનામકાર્ય
D7GATE1Timer 1 gate control
D6C/T1Timer 1 માટે Timer/Counter select
D5M11Timer 1 માટે Mode bit 1
D4M01Timer 1 માટે Mode bit 0
D3GATE0Timer 0 gate control
D2C/T0Timer 0 માટે Timer/Counter select
D1M10Timer 0 માટે Mode bit 1
D0M00Timer 0 માટે Mode bit 0

Bit કાર્યો:

  • GATE: 1 = External gate control, 0 = Internal control
  • C/T: 1 = Counter mode, 0 = Timer mode
  • M1,M0: Timer operating modes (00=Mode0, 01=Mode1, 10=Mode2, 11=Mode3)

મેમરી ટ્રીક: “GATE C/T Mode1 Mode0” દરેક timer માટે

પ્રશ્ન 3(ક) [7 ગુણ]
#

આકૃતિની મદદથી 8051 નું Architecture સમજાવો.

જવાબ:

8051 microcontroller માં separate program અને data memory સાથે Harvard architecture છે:

મુખ્ય Components:

  • 8-bit CPU Boolean processor સાથે
  • Internal ROM: 4KB program memory
  • Internal RAM: 128 bytes data memory
  • ચાર I/O Ports: P0, P1, P2, P3 (દરેક 8-bit)
  • બે Timers: 16-bit Timer/Counter 0 અને 1
  • Serial Port: Full duplex UART

Architecture Diagram:

graph TB
    subgraph "8051 Architecture"
        A[CPU<br/>8-bit]
        B[Internal ROM<br/>4KB]
        C[Internal RAM<br/>128 bytes]
        D[Port 0<br/>P0.0-P0.7]
        E[Port 1<br/>P1.0-P1.7]
        F[Port 2<br/>P2.0-P2.7]
        G[Port 3<br/>P3.0-P3.7]
        H[Timer 0]
        I[Timer 1]
        J[Serial Port]
        K[Interrupt<br/>Controller]
        
        A --- B
        A --- C
        A --- D
        A --- E
        A --- F
        A --- G
        A --- H
        A --- I
        A --- J
        A --- K
    end

વિશેષ વિશેષતાઓ:

  • Harvard Architecture: Program અને data માટે separate buses
  • SFR (Special Function Registers): વિવિધ peripherals ને control કરે છે
  • Interrupt System: 5 interrupt sources
  • Power Saving Modes: Idle અને Power-down modes

મેમરી ટ્રીક: “CPU ROM RAM Ports Timers Serial Interrupts” (CRRRPTI)

પ્રશ્ન 3(અ) OR [3 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલરનો PSW SFR સમજાવો.

જવાબ:

PSW (Program Status Word) માં status flags અને register bank selection છે:

BitFlagકાર્ય
D7CYCarry flag
D6ACAuxiliary carry flag
D5F0Flag 0 (user defined)
D4RS1Register bank select bit 1
D3RS0Register bank select bit 0
D2OVOverflow flag
D1-Reserved
D0PParity flag

Register Bank Selection:

  • RS1=0, RS0=0: Bank 0 (00H-07H)
  • RS1=0, RS0=1: Bank 1 (08H-0FH)
  • RS1=1, RS0=0: Bank 2 (10H-17H)
  • RS1=1, RS0=1: Bank 3 (18H-1FH)

મેમરી ટ્રીક: “CY AC F0 RS1 RS0 OV - P”

પ્રશ્ન 3(બ) OR [4 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલરના SCON SFR ના દરેક bit નું કાર્ય સમજાવો.

જવાબ:

SCON (Serial Control) register serial port operation ને control કરે છે:

Bitનામકાર્ય
D7SM0Serial mode bit 0
D6SM1Serial mode bit 1
D5SM2Multiprocessor communication
D4RENReceive enable
D3TB8Transmit કરવાનો 9th bit
D2RB8Receive થયેલો 9th bit
D1TITransmit interrupt flag
D0RIReceive interrupt flag

Serial Modes:

  • Mode 0: Shift register, fixed baud rate
  • Mode 1: 8-bit UART, variable baud rate
  • Mode 2: 9-bit UART, fixed baud rate
  • Mode 3: 9-bit UART, variable baud rate

Control કાર્યો:

  • REN: Reception enable કરવા માટે set કરવું જરૂરી
  • TI/RI: Hardware દ્વારા set, software દ્વારા clear

મેમરી ટ્રીક: “SM0 SM1 SM2 REN TB8 RB8 TI RI”

પ્રશ્ન 3(ક) OR [7 ગુણ]
#

આકૃતિની મદદથી 8051 નો Pin Diagram સમજાવો.

જવાબ:

8051 એ 40-pin DIP package માં available છે:

Pin Groups:

  • Ports 0-3: Dual functions સાથે I/O pins
  • Power: VCC, VSS pins
  • Crystal: Clock માટે XTAL1, XTAL2
  • Control: RST, EA, ALE, PSEN

Pin Diagram:

PPPPPPPP33333333XXPPPPPPPP........TT11111111R01234567AAV........S////////LLs01234567TRTIITTWR21sXXNN01RDDDTT01----123456789111111111120123456789080514333333333322222222209876543210987654321VPPPPPPPPEAPPPPPPPPPc00000000ALS22222222c......../EE........01234567V/N76543210////////PP////////AAAAAAAAPRAAAAAAAADDDDDDDDO1111119801234567G543210

Port કાર્યો:

  • Port 0: Multiplexed address/data bus
  • Port 1: General purpose I/O
  • Port 2: Higher order address bus
  • Port 3: Alternate functions (UART, interrupts, timers)

મેમરી ટ્રીક: “Port Power Crystal Control” (PPCC)

પ્રશ્ન 4(અ) [3 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલરની કોઇપણ ત્રણ Data Transfer Instructions લખો અને સમજાવો.

જવાબ:

Data transfer instructions registers, memory અને I/O વચ્ચે data move કરે છે:

Instructionકાર્ય
MOV A,R0R0 ના contents Accumulator માં move કરે છે
MOV R1,#50HImmediate data 50H ને R1 માં move કરે છે
MOV 30H,AAccumulator ના contents address 30H પર move કરે છે

Code Examples:

MOV A,R0        ; A = R0
MOV R1,#50H     ; R1 = 50H  
MOV 30H,A       ; [30H] = A

મુખ્ય વિશેષતાઓ:

  • કોઇ flags પ્રભાવિત નથી data transfer દરમિયાન
  • વિવિધ addressing modes supported
  • Single cycle execution મોટાભાગની instructions માટે

મેમરી ટ્રીક: “MOV Between Register Immediate Direct” (MBRID)

પ્રશ્ન 4(બ) [4 ગુણ]
#

રજિસ્ટર R0 અને R1 માં રહેલ ડેટાનો ગુણાકાર કરી જવાબ R5(લોઅર બાઇટ) અને R6(હાયર બાઇટ) માં સ્ટોર કરવા માટે 8051 નો એસેમ્બલી પ્રોગ્રામ લખો.

જવાબ:

ORG 0000H           ; Origin at 0000H

START:
    MOV A,R0        ; R0 ને Accumulator માં load કરો
    MOV B,R1        ; R1 ને B register માં load કરો
    MUL AB          ; A અને B નો ગુણાકાર કરો
    MOV R5,A        ; Lower byte R5 માં store કરો
    MOV R6,B        ; Higher byte R6 માં store કરો
    
    SJMP $          ; Program stop કરો

END                 ; Program નો અંત

Program Flow:

  1. Multiplicand load કરો R0 થી A માં
  2. Multiplier load કરો R1 થી B માં
  3. Multiplication execute કરો MUL AB use કરીને
  4. Lower byte store કરો result નો R5 માં
  5. Higher byte store કરો result નો R6 માં

નોંધ: MUL AB instruction automatically 16-bit result store કરે છે lower byte A માં અને higher byte B માં.

પ્રશ્ન 4(ક) [7 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલરના Addressing Modes ની યાદી બનાવો અને દરેકને ઉદાહરણ સાથે સમજાવો.

જવાબ:

8051 કેટલાક addressing modes support કરે છે:

Modeવર્ણનExample
ImmediateInstruction માં data specify કરાયો છેMOV A,#50H
RegisterRegister માં data છેMOV A,R0
DirectMemory address specify કરાયો છેMOV A,30H
IndirectRegister માં address છેMOV A,@R0
IndexedBase + offset addressingMOVC A,@A+DPTR
RelativePC + offsetSJMP LABEL
BitBit-specific operationsSETB P1.0

વિગતવાર Examples:

1. Immediate Addressing:

MOV A,#25H      ; A = 25H (immediate data)

2. Register Addressing:

MOV A,R1        ; A = R1 ના contents

3. Direct Addressing:

MOV A,40H       ; A = memory location 40H ના contents

4. Indirect Addressing:

MOV R0,#40H     ; R0 = 40H (address)
MOV A,@R0       ; A = R0 દ્વારા point કરાયેલ location ના contents

મેમરી ટ્રીક: “I-R-D-I-I-R-B” (Immediate Register Direct Indirect Indexed Relative Bit)

પ્રશ્ન 4(અ) OR [3 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલર માટેની કોઇપણ ત્રણ Logical Instructions લખો અને સમજાવો.

જવાબ:

Logical instructions bitwise operations કરે છે:

Instructionકાર્ય
ANL A,R0Accumulator અને R0 નું AND કરે છે
ORL A,#0FHAccumulator અને immediate data 0FH નું OR કરે છે
XRL A,30HAccumulator અને address 30H ના contents નું XOR કરે છે

Code Examples:

ANL A,R0        ; A = A AND R0
ORL A,#0FH      ; A = A OR 0FH
XRL A,30H       ; A = A XOR [30H]

Applications:

  • ANL: Specific bits masking (unwanted bits clear કરવા)
  • ORL: Specific bits setting
  • XRL: Bits toggling, checksum calculations

મેમરી ટ્રીક: “AND OR XOR” logical operations

પ્રશ્ન 4(બ) OR [4 ગુણ]
#

2000h મેમરી લોકેશન માં સ્ટોર કરેલ સંખ્યા માંથી 2001h મેમરી લોકેશન માં સ્ટોર કરેલ સંખ્યા બાદ કરી 2002h મેમરી લોકેશનમાં જવાબ સ્ટોર કરવા માટે 8051 નો એસેમ્બલી પ્રોગ્રામ લખો. અહીં આપેલા તમામ મેમરી લોકેશન બાહ્ય મેમરી ના છે.

જવાબ:

ORG 0000H           ; Origin at 0000H

START:
    MOV DPTR,#2001H ; Minuend address પર point કરો
    MOVX A,@DPTR    ; External memory માંથી minuend load કરો
    MOV R0,A        ; Minuend ને R0 માં store કરો
    
    MOV DPTR,#2000H ; Subtrahend address પર point કરો  
    MOVX A,@DPTR    ; External memory માંથી subtrahend load કરો
    MOV R1,A        ; Subtrahend ને R1 માં store કરો
    
    MOV A,R0        ; Minuend ને A માં load કરો
    CLR C           ; Carry flag clear કરો
    SUBB A,R1       ; Subtraction: A = R0 - R1
    
    MOV DPTR,#2002H ; Result address પર point કરો
    MOVX @DPTR,A    ; Result ને external memory માં store કરો
    
    SJMP $          ; Program stop કરો

END                 ; Program નો અંત

Program પગલાં:

  1. Minuend load કરો external memory 2001H માંથી
  2. Subtrahend load કરો external memory 2000H માંથી
  3. Subtraction કરો SUBB instruction use કરીને
  4. Result store કરો external memory location 2002H માં

નોંધ: External memory access માટે MOVX instruction નો use થાય છે.

પ્રશ્ન 4(ક) OR [7 ગુણ]
#

Instructions સમજાવો: (i) RET (ii) PUSH (iii) CLR PSW.0 (iv) RLC A (v) CJNE A,#DATA,LABEL (vi) NOP (vii) ANL A,#DATA

જવાબ:

Instructionકાર્યવર્ણન
RETSubroutine માંથી returnStack માંથી PC pop કરે છે અને control return કરે છે
PUSH 30HStack પર push કરે છેAddress 30H ના contents stack પર push કરે છે
CLR PSW.0Carry flag clear કરે છેPSW નો bit 0 (Carry flag) clear કરે છે
RLC ACarry થકી left rotateA ને carry flag થકી left rotate કરે છે
CJNE A,#50H,NEXTCompare અને jumpA ≠ 50H હોય તો NEXT પર jump કરે છે
NOPકંઇ operation નહીંકંઇ કરતું નથી, એક cycle consume કરે છે
ANL A,#0FHImmediate સાથે ANDA = A AND 0FH

વિગતવાર સમજાવટ:

RET: Subroutine calls માંથી return કરવા માટે

CALL SUB1       ; Subroutine call કરો
...
SUB1: 
    MOV A,#10H
    RET         ; Caller ને return કરો

PUSH: Stack પર data save કરે છે

PUSH ACC        ; Accumulator ને stack પર save કરો

RLC A: Carry સાથે bit rotation

CYA7A6A5A4A3A2A1A0CY

CJNE: Conditional branching

CJNE A,#50H,NOT_EQUAL   ; A≠50H હોય તો NOT_EQUAL પર jump
; A equals 50H
NOT_EQUAL:
; A not equal to 50H

મેમરી ટ્રીક: “Return Push Clear Rotate Compare No-op AND” (RPCRNA)

પ્રશ્ન 5(અ) [3 ગુણ]
#

માઇક્રોકન્ટ્રોલરની વિવિધ ક્ષેત્રે ઉપયોગોની સૂચી બનાવો.

જવાબ:

માઇક્રોકન્ટ્રોલર વિવિધ ક્ષેત્રોમાં અસંખ્ય applications માં use થાય છે:

ક્ષેત્રApplications
Consumer ElectronicsTV remotes, washing machines, microwaves
AutomotiveEngine control, ABS, airbag systems
IndustrialProcess control, robotics, automation
MedicalPacemakers, blood glucose meters, ventilators
CommunicationMobile phones, modems, routers
Home AutomationSmart thermostats, security systems, lighting

મુખ્ય ફાયદા:

  • ઓછી કિંમત અને compact size
  • ઓછી power consumption
  • Real-time operation
  • Sensors અને actuators સાથે સરળ interfacing

મેમરી ટ્રીક: “Consumer Automotive Industrial Medical Communication Home” (CAIMCH)

પ્રશ્ન 5(બ) [4 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલર સાથે સ્ટેપર મોટર ઇન્ટરફેસ કરો અને ટૂંકમાં સમજાવો.

જવાબ:

Stepper motor interfacing માટે current requirements ને કારણે driver circuit જરૂરી છે:

Interface Circuit:

PPPP1111....01238051GNDIIIInnnnppppUuuuuLttttN12342003CCCCooooiiiillllSABCDtepperMotor

Control Sequence (Half-Step):

StepP1.3P1.2P1.1P1.0Binary
1000101H
2001103H
3001002H
4011006H
5010004H
611000CH
7100008H
8100109H

Driver Circuit:

  • ULN2003: Darlington driver IC current amplification provide કરે છે
  • Protection diodes: Back EMF સામે protect કરે છે
  • Common ground: 8051 અને motor supply વચ્ચે

મેમરી ટ્રીક: “Step Sequence Driver Protection” (SSDP)

પ્રશ્ન 5(ક) [7 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલરના પોર્ટ 2.0 થી 2.3 પર ચાર LED ઇન્ટરફેસ કરો અને તેને ચાલુ-બંધ કરવા માટેનો એસેમ્બલી પ્રોગ્રામ લખો.

જવાબ:

Interface Circuit:

8PPPP022225....10123PinR3333e3333s0000iΩΩΩΩstorLLLLLEEEEEDDDDD1234GGGGNNNNDDDD

Assembly Program:

ORG 0000H               ; Start address

MAIN:
    MOV P2,#0FH         ; બધા LEDs ON કરો (P2.0-P2.3)
    CALL DELAY          ; Delay subroutine call કરો
    MOV P2,#00H         ; બધા LEDs OFF કરો
    CALL DELAY          ; Delay subroutine call કરો
    SJMP MAIN           ; Flashing repeat કરો

DELAY:
    MOV R0,#255         ; Outer loop counter
LOOP1:
    MOV R1,#255         ; Inner loop counter  
LOOP2:
    DJNZ R1,LOOP2       ; Zero નહીં હોય તો decrement અને jump
    DJNZ R0,LOOP1       ; Outer counter decrement કરો
    RET                 ; Delay માંથી return કરો

END                     ; Program નો અંત

Circuit Components:

  • Current limiting resistors: LED current limit કરવા માટે 330Ω
  • LEDs: Active HIGH configuration માં connected
  • Common ground: બધા LED cathodes ground સાથે connected

Program Operation:

  1. LEDs ON કરો: P2.0-P2.3 high set કરો
  2. Delay: Visible flash duration માટે wait કરો
  3. LEDs OFF કરો: P2.0-P2.3 clear કરો
  4. Repeat: Continuous flashing loop

મેમરી ટ્રીક: “Resistor LED Ground Program” (RLGP)

પ્રશ્ન 5(અ) OR [3 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલર સાથે પુશ બટન સ્વીચ અને LED નું ઇન્ટરફેસિંગ દોરો.

જવાબ:

Interface Circuit:

P1.1S+wG5iNVtDc3h301Ω0KΩGND(LOEuDtPp1u.t0)(IGnNpDut)

Circuit વર્ણન:

  • Push Button: Pull-up resistor સાથે P1.0 સાથે connected
  • Pull-up Resistor: Switch open હોય ત્યારે logic HIGH ensure કરવા માટે 10KΩ
  • LED: Current limiting resistor દ્વારા P1.1 સાથે connected
  • Current Limiting: LED ને protect કરવા માટે 330Ω resistor

Operation:

  • Switch Open: P1.0 = 1 (HIGH)
  • Switch Pressed: P1.0 = 0 (LOW)
  • LED Control: P1.1 pin દ્વારા

મેમરી ટ્રીક: “Pull-up Switch LED Current-limit” (PSLC)

પ્રશ્ન 5(બ) OR [4 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલર સાથે રીલે ઇન્ટરફેસ કરો અને ટૂંકમાં સમજાવો.

જવાબ:

Interface Circuit:

8P015.10GNTDra1nKsΩF(il1syNtBEb4oama0rsic0etk7t)eDB(riRCNoe5Pdl4Nea7)yCGlNLlDoeacdtRoerlayCoilLoNaOd+/1ND2CeVvice

Components:

  • Transistor BC547: Relay coil માટે switching element
  • Base Resistor: Base current limit કરવા માટે 1KΩ
  • Flyback Diode: Back EMF સામે protect કરવા માટે 1N4007
  • Relay: NO/NC contacts સાથે 12V DC relay

Operation:

  1. P1.0 પર Logic HIGH → Transistor ON → Relay energized
  2. P1.0 પર Logic LOW → Transistor OFF → Relay de-energized
  3. Relay contacts load circuit ને switch કરે છે

Protection:

  • Flyback diode relay coil ના back EMF થી damage prevent કરે છે
  • Base resistor દ્વારા Current limiting

મેમરી ટ્રીક: “Transistor Resistor Diode Relay” (TRDR)

પ્રશ્ન 5(ક) OR [7 ગુણ]
#

8051 માઇક્રોકન્ટ્રોલર સાથે 7 સેગ્મેન્ટ LED ઇન્ટરફેસ કરો અને 0 પ્રિન્ટ કરવા માટે એસેમ્બલી પ્રોગ્રામ લખો.

જવાબ:

Interface Circuit:

fe8PPPPPPPPC011111111o5........m101234567moCnoagdnCnaetc33333333ht33333333oi00000000doΩΩΩΩΩΩΩΩebcn:s:abcdefgdcpasssssssteeeeeee(hgggggggdommmmmmmedeeeeeeecennnnnnnistttttttmaGlNDpoint)

7-Segment Code Table:

DigitDisplaygfedcbaHex Code
0Display 001111113FH
1Display 1000011006H
2Display 210110115BH

‘0’ Display કરવા માટે Assembly Program:

ORG 0000H               ; Start address

MAIN:
    MOV P1,#3FH         ; 7-segment પર '0' display કરો
                        ; a,b,c,d,e,f ON, g OFF
    SJMP MAIN           ; Display કરતા રહો

END                     ; Program નો અંત

‘0’ માટે Segment Pattern:

  • Segments ON: a, b, c, d, e, f (bits 0-5 = 1)
  • Segment OFF: g (bit 6 = 0)
  • Binary: 00111111 = 3FH

Circuit વિશેષતાઓ:

  • Common Cathode: બધા segment cathodes ground સાથે connected
  • Current Limiting: દરેક segment માટે 330Ω resistors
  • Active HIGH: Logic 1 segment ON કરે છે

અન્ય Patterns:

; અન્ય digits display કરવા માટે:
MOV P1,#06H         ; '1' Display કરવા માટે
MOV P1,#5BH         ; '2' Display કરવા માટે

મેમરી ટ્રીક: “Seven Segments Common Cathode Current-limit” (SSCCC)

સંબંધિત

માઇક્રોપ્રોસેસર અને માઇક્રોકંટ્રોલર સિસ્ટમ્સ (1333202) - સમર 2024 સોલ્યુશન
24 મિનિટ
અભ્યાસ-સાહિત્ય સોલ્યુશન માઇક્રોપ્રોસેસર માઇક્રોકંટ્રોલર 8085 8051 1333202 2024 સમર
મશીન લર્નિંગના મૂળભૂત સિદ્ધાંતો (4341603) - શિયાળો 2024 સોલ્યુશન
અભ્યાસ-સામગ્રી સોલ્યુશન મશીન-લર્નિંગ 4341603 2024 શિયાળો
ડિજિટલ માર્કેટિંગની મૂળભૂત બાબતો (4341601) - શિયાળો 2024 સોલ્યુશન
અભ્યાસ-સામગ્રી સોલ્યુશન ડિજિટલ-માર્કેટિંગ 4341601 2024 શિયાળો
એમ્બેડેડ સિસ્ટમ (4343204) - વિન્ટર 2024 સોલ્યુશન
25 મિનિટ
અભ્યાસ-સામગ્રી સોલ્યુશન એમ્બેડેડ-સિસ્ટમ 4343204 2024 વિન્ટર
સાયબર સિક્યુરિટી (4353204) - વિન્ટર 2024 શોર્ટ સોલ્યુશન
11 મિનિટ
અભ્યાસ-સામગ્રી સોલ્યુશન સાયબર-સિક્યુરિટી 4353204 2024 વિન્ટર
એમ્બેડેડ સિસ્ટમ (4343204) - સમર 2024 સોલ્યુશન
17 મિનિટ
અભ્યાસ-સામગ્રી સોલ્યુશન એમ્બેડેડ-સિસ્ટમ 4343204 2024 સમર