Question: C programming using XC 8 compiler on a PIC 1 6 F 1 8 8 7 7 chip. Inputs / Outputs: - Connect two 7

C programming using XC8 compiler on a PIC16F18877 chip.
Inputs/Outputs:
- Connect two 7-segment displays via SPI.
- Connect 3 LEDs as indicators.
- Connect a potentiometer as an analog input.
- Connect a DIP switch as a digital input.
- Connect the rotary encoder to two digital inputs.
Operation:
This program will utilize the internal DAC, the ADC, an analog comparator, and SPI.
The rotary encoder should control the output level of the DAC. Turning one direction should increase the level to a maximum of 31. Turning the other direction should decrease the level to a minimum of 0.
The output of the DAC should go to one input of an analog comparator. The other input to the comparator should be from the analog input. Connect them such that if the analog input voltage is higher than the DAC voltage, the output of the comparator goes high.
Connect the HI/LO LED to the output of the comparator so that it reflects the comparator's state.
The ADC should read either the DAC voltage or the analog input voltage depending on the position of the DIP switch. Show this value as a number from 0 to 31 on the seven-segment display.
The two additional LEDs should indicate which value is being shown, the DAC output or the analog input.
Internal connections shown in the 2nd picture.
C programming using XC 8 compiler on a PIC 1 6 F

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!