Answers

1. Hysteresis means that the switching level of the input depends on the polarity of the input change. This helps overcome noise on the input, which would cause unreliable switching, by implementing an upper and lower switching levels.

2. set_adc_channel(0);

numin=read_adc();

In the read statement, the input value returned by the function has to be assigned to another variable for processing. In the channel select statement, the channel number is passed to the function as the function argument.

3. See the figure. (10 points)

4. TEMPCON

Initialize

MCU, ADC, Functions

Wait for ‘Start‘

Switch on ‘Running’

Loop

Read temperature

If too low

Switch on Heater

If too high

Switch on Fan

If OK

Switch on ‘TempOK’

Always //(10 points)

5. A data logger often needs to record analog input values from sensors. Flash ROM is nonvolatile so data are retained during power off, and the serial interface uses only two pins on the MCU. A serial link is needed to upload the acquired data to a host system.

6. In a polled system, the time between input samples may vary if the processing time changes between samples. A timer interrupt forces the execution of an ISR containing the input sampling event at fixed intervals.

7. In a system with multiple interrupts, each is assigned a numerical priority in relation to the others, such that a high-priority ISR is not interrupted by a lower-priority one, but a low-priority interrupt may be interrupted by a high-priority task.

8. The PC operating system is a priority-interrupt driven, multitasking OS optimized for file processing, so that the time response of the system to real-time events is not predictable. The real-time operating system is designed to provide a predictable response time to major system events, as required in control systems.

9. rate=how often the task will execute.

max=time allowed for this task each time it is executed.

10. The microcontroller has all essential hardware resources built into one chip: CPU, program ROM, data RAM, and peripheral interfaces. In a conventional microprocessor system, these are provided as separate chips so that the system can be tailored to the application.

11. The system on a chip allows the microcontroller hardware to be configured for a specific application then manufactured on one chip, giving the benefits of both the conventional microprocessor system and the microcontroller.

12. Familiarity, cost, complexity, range, development system, availability, features.

13. Sufficient I/O pins, peripheral support, program memory size, data memory size, speed, power consumption.

14. The prototype costs are mainly hardware and software design time. As more units are produced, the development costs are shared, so that the cost per unit falls with the volume of production (see the figure).

15. The serial alphanumeric LCD needs only a single MCU pin and can display several lines of numbers and characters. The 3.5-digit LCD is cheaper, the digit display is larger, and access is faster.

16. The size of the system and number of components largely determine the power consumption, plus the current drawn by the MCU increases with the clock speed. The component data sheets need to be consulted to predict power consumption, as this is not generally modeled in simulation systems. A prototype must be built to confirm the power supply specification.

17. C is a higher-level language than assembler, so it is easier to learn and use, as the meaning of the program statements is more obvious. The same standard C syntax is used for all processors, with the compiler converting the source code into the MCU-specific assembly language. This means that it is universal and, to some extent, portable between systems. The basic programming techniques are applicable to all embedded systems, with the main variation being in the I/O function syntax. (10 points)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.171.86