You are on page 1of 7

Electronics, Interfacing & Programming for Design

(16DSB007)

Summer 2017 2 Hours


__________________________________________________________________________________

Answer ALL three questions


University approved calculators are permitted
Formula Sheet provided
Datasheets provided (for Q1)
Q1 carries 50 Marks, Q2 and Q3 are worth 25 Marks each

_________________________________________________________________________

1. An embedded system is to be designed using two LDRs (Datasheet attached), an 18F45K20


microcontroller and a 12v 1A dc motor, such that a roller blind is automatically lowered when it
becomes dark and raised when the sun comes up.

(i) Draw a block diagram for such a system (8 Marks)


(ii) Draw a circuit diagram for such a system using the 18F45K20 outline attached (12
Marks)
(iii) Construct a flowchart such that the required C code can be derived from it
(20 Marks)
(iv) Write the initialise C18 code (statements) required to correctly configure the inputs
and outputs. (10 Marks)

2. (a) There are 10 errors in the C18 C code file listing shown in Fig Q2a. 9 of them are syntax
errors and 1 logical error. Please circle and number the errors, describe them and explain how to
rectify each one [20 marks]

DSB007 Electronics Interfacing and Programming for Design Page 1 of 3


Name:………………………………………..

Fig Q2a

DSB007 Electronics Interfacing and Programming for Design Page 2 of 3


2 (b) What are header files within the C18 MPLAB context? Give an example of a header file and
explain what is contained within. [5 Marks]

(a) What is a Schmitt trigger and why are they are useful? With the help of a circuit diagram, explain
the operation of a non-inverting Schmitt trigger. Sketch its hysteresis curve (12 Marks)

(b) Determine the voltage output voltage Vout of the circuits in figures A and B below.

Assume Vin1 = 20mV and Vin2 = 30mV for Circuit A.

Assume Vin = 25mV [8 Marks]

Circuit A Circuit B

(c) (i) What is a transducer? [1 Mark]


(ii) List and describe two types of resistive sensors [2 Marks]
(iii) List and describe two types of capacitive sensor [2 Marks]

DSB007 Electronics Interfacing and Programming for Design Page 3 of 3

You might also like