Answers

1. Include header file using #directive.

Main program statement block enclosed in braces.

I/O functions/sec within main.

2. Create MPLAB project.

Edit program using correct syntax.

Build program and correct syntax errors.

Test program in simulator and debug.

Optional—test in cosimulation mode.

3. output_C(64);

output_high(PIN_C6);

4. The WHILE loop tests the control condition before the loop statements are executed. The DO..WHILE tests after they have been executed at least once. The FOR loop executes a loop a fixed number of times.

5. Port D bits initially go on for 1 sec. If the switch is active, the high 4 bits then go off, and the program waits until the switch goes inactive, at which point all the outputs go off. If the switch is inactive, all ...

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.