Question: Capacitance meter. Consider the RC circuit of Figure. The voltage across the capacitor is Vc (t) = ke-t/RC. In one-time constant RC, this voltage is discharged to the value k/e. For a specific value of R, value of the capacitor C = T/R, where T is the time constant that can be counted by the PIC18F4321. Design the hardware and software for the PIC18F4321 to charge a capacitor by using a pulse to a voltage of your choice. The PIC18F4321 will then stop charging the capacitor, measure the discharge time for one time constant, and compute the capacitor value.
(a) Draw a hardware schematic.
(b) Write a PIC18F assembly language program to accomplish the above.