## GUJARAT TECHNOLOGICAL UNIVERSITY DIPLOMA IN ENGINEERING - SEMESTER 4 - EXAMINATION - SUMMER 2026

અથવા

| Subject Code: DI04000121                                                                                                             | Subject Code: DI04000121                                                                                                             | Subject Code: DI04000121                                                                                                                                                                                                                                                                      | Date: 19/05/2026   |
|--------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| Subject Name:  Embedded System                                                                                                       | Subject Name:  Embedded System                                                                                                       | Subject Name:  Embedded System                                                                                                                                                                                                                                                                |                    |
| Time: 10:30 AM TO 01:00 PM                                                                                                           | Time: 10:30 AM TO 01:00 PM                                                                                                           | Time: 10:30 AM TO 01:00 PM                                                                                                                                                                                                                                                                    | Total Marks: 70    |
| Instructions :                                                                                                                       | Instructions :                                                                                                                       | Instructions :                                                                                                                                                                                                                                                                                |                    |
| 1. Attempt all questions. 2. MakeSuitable assumptions wherever necessary                                                             | 1. Attempt all questions. 2. MakeSuitable assumptions wherever necessary                                                             | 1. Attempt all questions. 2. MakeSuitable assumptions wherever necessary                                                                                                                                                                                                                      |                    |
| 3. Figures to the right indicate full marks. 4. Use of simple calculators and non-programmable scientific calculators are permitted. | 3. Figures to the right indicate full marks. 4. Use of simple calculators and non-programmable scientific calculators are permitted. | 3. Figures to the right indicate full marks. 4. Use of simple calculators and non-programmable scientific calculators are permitted.                                                                                                                                                          |                    |
| 5. English version is authentic.                                                                                                     | 5. English version is authentic.                                                                                                     | 5. English version is authentic.                                                                                                                                                                                                                                                              |                    |
| Q.1                                                                                                                                  | (a)                                                                                                                                  | Draw and explain simplified block diagram of AVR microcontroller.                                                                                                                                                                                                                             | 03                 |
| GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૧                                                | ( અ )                                                                                                                                | એવીઆર માઈGLYPH<c=10,font=/QTBAAA+ShrutiRegular>ોકGLYPH<c=13,font=/QTBAAA+ShrutiRegular>GLYPH<c=14,font=/QTBAAA+ShrutiRegular>ોલ ર  ન ો  સ રળ   GLYPH<c=19,font=/QTBAAA+ShrutiRegular>લ ોક  ડા ય ાGLYPH<c=22,font=/QTBAAA+ShrutiRegular> ા મ   દ ોરો  અ ન ે  સ મ GLYPH<c=26,font=/QTBAAA+ShrutiRegular> વ ો | ૦૩                 |
|                                                                                                                                      | (b)                                                                                                                                  | State the features of ATMega32 microcontroller.                                                                                                                                                                                                                                               | 04                 |
|                                                                                                                                      | ( બ )                                                                                                                                | ATMega32 માઇGLYPH<c=10,font=/QTBAAA+ShrutiRegular>ોકGLYPH<c=13,font=/QTBAAA+ShrutiRegular>GLYPH<c=14,font=/QTBAAA+ShrutiRegular>ોલ રન ા ં   %ુણધમ) દશા+વો.                                                                                                                                            | ૦૪                 |
|                                                                                                                                      | (c)                                                                                                                                  | Define Embedded System. Draw and explain the block diagram of an Embedded system.                                                                                                                                                                                                             | 07                 |
|                                                                                                                                      | ( ક )                                                                                                                                | એ-બેડ/ડ િસ1ટમ 3યા4યાિયત કરો. એ-બેડ/ડ િસ1ટમનો GLYPH<c=19,font=/QTBAAA+ShrutiRegular>લોક ડાયાGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ દોરો અને સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular>વો.                                                                                                                       | ૦૭                 |
| અથવા OR                                                                                                                               | અથવા OR                                                                                                                               | અથવા OR                                                                                                                                                                                                                                                                                        |                    |
|                                                                                                                                      | (c)                                                                                                                                  | Which type of operating system is required in Embedded system? List and explain the characteristics of the operating system used in Embedded system.                                                                                                                                          | 07                 |
|                                                                                                                                      | ( ક )                                                                                                                                | એ-બેડ/ડ િસ1ટમમાં કયા 6કારની ઓપર/9ટ:ગ િસ1ટમ જ=ર> છે? એ-બેડ/ડ િસ1ટમમાં વપરાતી ઓપર/9ટ:ગ િસ1ટમની લાABણકતાઓની યાદ> બનાવો અને સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular>વો.                                                                                                                                                    | ૦૭                 |
| Q.2                                                                                                                                  | (a)                                                                                                                                  | Write steps to store data in EEPROM of ATMega32.                                                                                                                                                                                                                                              | 03                 |
| GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૨                                                | ( અ )                                                                                                                                | ATMega32 ના EEPROM માં ડ/ટા 1ટોર કરવા માટ/ પગલાં લખો.                                                                                                                                                                                                                                                   | ૦૩                 |
|                                                                                                                                      | (b)                                                                                                                                  | List the data types used in embedded C.                                                                                                                                                                                                                                                       | 04                 |
|                                                                                                                                      | ( બ )                                                                                                                                | ઇ-બેડ/ડ C માં ઉપયોગ થતા ડ/ટા ટાઇKસની L ૂBચ બનાવો.                                                                                                                                                                                                                                                        | ૦૪                 |
|                                                                                                                                      | (c)                                                                                                                                  | Describe the configuration of I/O port as input or output with proper diagrams and table.[4] Also give example for I/O port configuration as input and output.[3]                                                                                                                             | 07                 |
|                                                                                                                                      | ( ક )                                                                                                                                | યોOય આPિતઓ તથા ટ/બલ સાથે I/O port Wુ ઈનXુટ તથા આઉYXુટ કં9ફગર/શન વણ+વો.[4] તેમજ I/O port ના ઈનXુટ તથા આઉYXુટ કં9ફગર/શનના ઉદાહરણ આપો. [3]                                                                                                                                                                           | ૦૭                 |

OR

| Q.2 GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૨   | (a)   | Draw TCCR register and explain the function of WGM bits.                                                                                                                                                                              | 03   |
|---------------------------------------------------------------------------------------------|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
|                                                                                             | ( અ ) | TCCR ર_1ટર દોરો અને WGM BબYસના કાય+ને સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular>વો.                                                                                                                                                            | ૦૩   |
|                                                                                             | (b)   | Develop an AVR C program to toggle all the bits of Port B 500 times.                                                                                                                                                                  | 04   |
|                                                                                             | ( બ ) | પોટ+ બી ની દર/ક બીYને 500 વાર ટૉગલ કરવા માટ/નો AVR C 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ બનાવો.                                                                                                                                              | ૦૪   |
|                                                                                             | (c)   | Draw ATMega32 status register and explain the function of each bit .                                                                                                                                                                  | 07   |
|                                                                                             | ( ક ) | ATMega32 1ટ/ટસ રfજ1ટર દોરો અને દર/ક BબટWું કાય+ સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular>વો.                                                                                                                                                  | ૦૭   |
| Q.3 GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૩   | (a)   | Write one line Embedded C code: (a) To set bit 5 of port C without disturbing other bits. (b) To reset bit 6 of port C without disturbing other bits. (c) To toggle all the bits of port C.                                           | 03   |
|                                                                                             | ( અ ) | એક લાઇનમાં એ-બેડ/ડ C કોડ લખો: (a) અGLYPH<c=13,font=/QTBAAA+ShrutiRegular>ય Bબટને અવગjયા િવના પોટ+ C નો Bબટ 5 સેટ કરવા માટ/. (b) અGLYPH<c=13,font=/QTBAAA+ShrutiRegular>ય Bબટને અવગjયા િવના પોટ+ C નો Bબટ 6 ર>સેટ કરવા માટ/. (c) પોટ+ C ના તમામ Bબટોને ટૉગલ કરવા માટ/. | ૦૩   |
|                                                                                             | (b)   | Write an AVR C program to get a byte of data from Port C. If it is less than the value read from PORTA, send it to Port B; otherwise, send it to Port D.                                                                              | 04   |
|                                                                                             | ( બ ) | Port C માંથી ડ/ટાનો બાઇટ મેળવો. જો તે PORTA માંથી વાંચવામાં આવેલ n ૂoયથી ઓpં હોય, તો તેને Port B પર મોકલો; અGLYPH<c=13,font=/QTBAAA+ShrutiRegular>યથા, તેને Port D પર મોકલો. આપેલ કાય+ કરાવવા માટ/ AVR C 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ બનાવો.                      | ૦૪   |
|                                                                                             | (c)   | Draw and explain TIFR register. [3] Develop a C program to toggle all the bits of PORTB continuously with some delay. Use Timer0, Normal mode, and no prescaler options to generate the delay.[4]                                     | 07   |
|                                                                                             | ( ક ) | TIFR રfજ1ટર દોરો અને સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular> વો. [3] PORTB ના બધા BબYસને સતત ટૉગલ કરવા માટ/ 9ડલે સાથે C 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ િવકસાવો. 9ડલે જનર/ટ કરવા માટ/ Timer0 ને નોમ+લ                                            | ૦૭   |
|                                                                                             |       | મોડ, અને કોઈ 6ી1ક/લર િવના ઉપયોગ કરો.[4]                                                                                                                                                                                                       |      |
|                                                                                             |       | અથવા OR                                                                                                                                                                                                                                |      |
| Q.3 GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૩   | (a)   | Develop an AVR C program to monitor bit 5 of port C. If it is HIGH, send 55H to Port B; otherwise, send AAH to Port B.                                                                                                                | 03   |
|                                                                                             | ( અ ) | પોટ+ C ના Bબટ 5 ને મોિનટર કર>, જો તે HIGH હોય, તો પોટ+ B પર 55H મોકલો; નહyતર, પોટ+ B પર AAH મોકલવા માટ/ AVR C 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ બનાવો.                                                                                           | ૦૩   |
|                                                                                             | (b)   | A door sensor is connected to the port B pin 2, and an LED is connected to port C pin 5. Write an AVR C program to monitor the door sensor and, when it opens, turn on the LED.                                                       | 04   |
|                                                                                             | ( બ ) | પોટ+ B િપન 2 સાથે zાર સેGLYPH<c=13,font=/QTBAAA+ShrutiRegular>સર જોડાયે{ ું  છે, અને પોટ+ C િપન 5 સાથે એક LED જોડાયેલી છે. zાર સેGLYPH<c=13,font=/QTBAAA+ShrutiRegular>સરને મોિનટર કર> અને }યાર/ તે ~ ુo{ ું  થાય યાર/ LED ચા{ ુ કરવા માટ/ AVR C 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ લખો.                                                                                                                                                                                                                                       | ૦૪   |
|                                                                                             | (c)   | Explain the steps to be followed to load a data in timer to generate a given amount of delay.                                                                                                                                         | 07   |

|                                                                                           | ( ક )   | િનધા+9રત િવલંબ ઉપ કરવા માટ/ ટાઈમરમાં ડ/ટા લોડ કરવા માટ/ અWુસરણ                                                                                                                                                                                                       | ૦૭   |
|-------------------------------------------------------------------------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
|                                                                                           |         | કરવાના પગલાંઓ સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular> વો.                                                                                                                                                 |      |
| Q.4                                                                                       | (a)     | Draw interfacing diagram of MQ-8 hydrogen gas sensor with ATMega32.                                                                                                                                   | 03   |
| GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૪     | ( અ )   | MQ-8 હાઇોજન ગેસ સેGLYPH<c=13,font=/QTBAAA+ShrutiRegular>સરને ATMega32 સાથે ઈGLYPH<c=13,font=/QTBAAA+ShrutiRegular>ટરફ/સ કરવાના ડાયGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ બનાવો.                                                                                                                                                                                                       | ૦૩   |
|                                                                                           | (b)     | Draw and explain I2C protocol in AVR with its block diagram.                                                                                                                                          | 04   |
|                                                                                           | ( બ )   | AVR ના I2C 6ોટોકોલને ૉ કરો અને તેને GLYPH<c=19,font=/QTBAAA+ShrutiRegular>લોક ડાયGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ સાથે સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular> વો.                                                                                                                                                                                                       | ૦૪   |
|                                                                                           | (c)     | Write the steps to read ADC in the polling method. Also, develop an AVR C program to read data from ADC 0 channel using the polling method.                                                           | 07   |
|                                                                                           | ( ક )   | પોBલ:ગ પિતમાં ADC વાંચવા માટ/ના પગલાં લખો. તે ઉપરાંત, પોBલ:ગ પિતનો                                                                                                                                                                                                       | ૦૭   |
|                                                                                           |         | ઉપયોગ કર>ને ADC 0 ચેનલમાંથી ડ/ટા વાંચવા માટ/ AVR C 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ િવકસાવો.                                                                                                                |      |
|                                                                                           |         | અથવા OR                                                                                                                                                                                                |      |
| Q.4 GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૪ | (a)     | Draw a neat, labeled diagram of ULN2803. Explain why UNL2803 is required to interface the relay with the AVR.                                                                                         | 03   |
|                                                                                           | ( અ )   | ULN2803 નો એક 1વછ, લેબલ સ9હતની આૃિત દોરો. સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular>વો ક/ AVR સાથે 9રલે જોડવા માટ/ ULN2803 જુર> ક/મ છે.                                                                                                                                                                                                       | ૦૩   |
|                                                                                           | (b)     | Draw interfacing diagram of MAX7221 with ATMega32.                                                                                                                                                    | 04   |
|                                                                                           | ( બ )   | ATMega32 સાથે MAX7221 Wું ઇGLYPH<c=13,font=/QTBAAA+ShrutiRegular>ટરફ/િસ:ગ ડાયGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ બનાવો.                                                                                   | ૦૪   |
|                                                                                           | (c)     | Write steps to interface MAX7221 with AVR. Develop AVR C program to display 0 on seven segment display.                                                                                               | 07   |
|                                                                                           | ( ક )   | MAX7221ને AVR સાથે ઇGLYPH<c=13,font=/QTBAAA+ShrutiRegular>ટરફ/સ કરવા માટ/ના પગલાં લખો. સેવન સેગમેGLYPH<c=13,font=/QTBAAA+ShrutiRegular>ટ 9ડ1Kલે પર 0 દશા+વવા માટ/ AVR C 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ બનાવો. | ૦૭   |
| Q.5                                                                                       | (a)     | Explain the working of SPI protocol.                                                                                                                                                                  | 03   |
| GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૫     | ( અ )   | SPI 6ોટોકોલ ક/વી ર>તે કાય+ કર/ છે તે સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular>વો.                                                                                                                               | ૦૩   |
|                                                                                           | (b)     | Consider XTAL = 8 MHz, using non-inverted mode, write a program that generates a wave with frequency of 31,250 Hz and duty cycle of 75% (8 bit PWM )                                                  | 04   |
|                                                                                           | ( બ )   | XTAL = 8 MHz માનો, નોન-ઇGLYPH<c=13,font=/QTBAAA+ShrutiRegular>વટડ મોડનો ઉપયોગ કરતા, 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ લખો  31,250 Hz 9વGLYPH<c=13,font=/QTBAAA+ShrutiRegular>સ ીન ી અને 75%  ડ ૂ ટ> સાઈકલની (8-Bબટ PWM) તરંગ ઉપ કર/.                                                                                                                                                                                                       | ૦૪   |
|                                                                                           | (c)     | Draw and explain block diagram of smart irrigation system.                                                                                                                                            | 07   |
|                                                                                           | ( ક )   | 1માટ+ િસ:ચાઈ િસ1ટમનો GLYPH<c=19,font=/QTBAAA+ShrutiRegular>લૉક ડાયGLYPH<c=22,font=/QTBAAA+ShrutiRegular>ામ દ ોરો અને સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular> વો.                                                 | ૦૭   |
|                                                                                           |         | અથવા OR                                                                                                                                                                                                |      |
| Q.5 GLYPH<c=1,font=/QEBAAA+BalooBhai2Regular> GLYPH<c=2,font=/QEBAAA+BalooBhai2Regular> ૫ | (a)     | Develop an AVR C program to transmit character  'A' in master mode using SPI protocol.                                                                                                                | 03   |

| ( અ )   | SPI 6ોટોકોલનો ઉપયોગ કર>ને મા1ટર મોડમાં અAર 'A' GLYPH<c=14,font=/QTBAAA+ShrutiRegular>ાGLYPH<c=13,font=/QTBAAA+ShrutiRegular>સિમટ કરવા માટ/ AVR C 6ોGLYPH<c=22,font=/QTBAAA+ShrutiRegular> ા મ   ડ/વ લ પ કરો.   |   ૦૩ |
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
| (b)     | Explain why L293D is useful as a motor driver in changing the direction of motor rotation with an appropriate diagram.                                                                        |   04 |
| ( બ )   | કઈ 9રતે L293D મોટરની ફરતી 9દશાને બદલવામાં મોટર ાઇવર તર>ક/ મદદ કર/ છે  તે યોOય આૃિત સાથે સમGLYPH<c=26,font=/QTBAAA+ShrutiRegular> વો.                                                                                                                                                                                               |   ૦૪ |
| (c)     | Explain hydrogen gas monitoring system using ATMega32 with diagram.                                                                                                                           |   07 |
| ( ક )   |                                                                                                                                                                                               |   ૦૭ |

ATMega32 વાપર&gt;ને હાઇોજન વાુ મોનીટ9ર:ગ િસ1ટમને ડાયGLYPH&lt;c=22,font=/QTBAAA+ShrutiRegular&gt;ામ સાથે સમGLYPH&lt;c=26,font=/QTBAAA+ShrutiRegular&gt;વો.