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 ...

Get Programming 8-bit PIC Microcontrollers in C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.