You are on page 1of 2
PDPM Indian Institute of Information Technology Design and Manufacturing Jabalpur ([Bater 26.02.2004 Subject (IoT & Embedded System CS2009) Time: 2 hour ‘Mid Semester Eramination Maximum Marks: 30 ed 1, Write a embedded C code for designing the control loop system for glowing the LED (Red, Green, Blue) using the user switch (SW). When the SWI is closed, the Green LED stay on and the RED will blink. When SW1 is open, the Green LED will blink and the Red stay on While writing the program make sure you should follow given points: 1. Specific bit addressing must be needed 2. For set and clear use bitwise and shift operator (&, —) For the above problem following register addresses (base and offset) with specific bit to be set, as show below: 1. Clock Gating register Base: 0x400FE000 offset: 608 bit to set is 5 for PORT F 2. PORT F Direction register address: 040025400 3, PORT F Digital Enable register address: 0x4002551C 4, GPIODATAF Register set the particular pin Base: 0x40025000 ut eee sede 2 ft Gale (7 2. Show the each step change in the register value of the following assembly code AND R3, R1, R2 ORR R4, Ri, R2 EOR R5, Ri, R2 BIC R6, R1, R2 MVN R7, R2 (5) Source registers R1 [01000110] 1010 0001 | 1111 0001] 1011 0111 R2| 1111 11114 | 1111 1111 | 0000 0000 | 0000 0000 3, The counter and comparator are the two basic circuit component that generate PWM signal, Consider the system clock frequency is 16MHz and required PWM frequency is 2KHz, then ; calculate the load value of the comparator for the duty cycle of 25 %, 50%, 75% and 100%. 3 Scanned with CamScanner 4. Design a d-bit Digital to analog converter using R-2R (Re1.5 Ohm and 2R=3 Ohm) ladder circuit, and draw a graph 4 bit digital versus analog graph, [5] 5. Consider the following S-bit subtraction (assume 4 fers are 8 bits wide) 1, Lond 0x32 into RA Load 0x9C into R2 &. Subtract RB = RIRD What will be the 8-bit result in Register R3, What will be the value of the overflow (V) bit?, What will be the value of the cary (C) bit? 5) 6. Assume the stack pointer (SP) is initialized to 0x2000.0408. Registers RO, R1, R2 and R12 are initialized to 12, 3, § and 5 respectively. Answer the following: 1. Show is the content of the stack and the SP after the following sequence of operations: PUSH RO PUSH R1-R2 PUSH R12 2, Given the state of the stack after part a), show the content of the stack, the SP and registers R3, RA after the following operation: POP R3-R4 3. Given the state of the stack after part b), show the content of the stack, the SP and registers RO- R3 after the following operation: PUSH RO-RI POP RO-R3 (5) Page 2 Scanned with CamScanner

You might also like