Hi,
I have been experimenting a lot with the PIC24F16KA102 for measuring accurately a period at nanosecond resolution.
I managed to get current calibration up an d running with very good values. I used the 55µA mode with 30K 0.1% resistance to produce 70% of full scale 2.5V as suggested in the application note.
Now I am trying to do capacitance calibration. I am starting from the smallest value of time to give to the A/D internal cap to charge and gradually increase the time and plot a graph. At first there seems to be a cap charging graph but at times, the value is totally distorted and totally goes out of the way. When I simulate it with proteus I get good values all the way. With MPLAB SIM the 5 transients for the A/D cap to charge up to approx. 1.65V, the stop watch showed 184µs. The code is below and the schematic is attached. The CTMUI is infact the voltage across the resistance not the current.
LCD 4-bit PIC24.png
Did anyone try something like and can give me some tips? Or even maybe there is a particular pic that is preferred when it comes to time measurement with the ctmu. (if it is possible to eliminate these factors)
I have been experimenting a lot with the PIC24F16KA102 for measuring accurately a period at nanosecond resolution.
I managed to get current calibration up an d running with very good values. I used the 55µA mode with 30K 0.1% resistance to produce 70% of full scale 2.5V as suggested in the application note.
Now I am trying to do capacitance calibration. I am starting from the smallest value of time to give to the A/D internal cap to charge and gradually increase the time and plot a graph. At first there seems to be a cap charging graph but at times, the value is totally distorted and totally goes out of the way. When I simulate it with proteus I get good values all the way. With MPLAB SIM the 5 transients for the A/D cap to charge up to approx. 1.65V, the stop watch showed 184µs. The code is below and the schematic is attached. The CTMUI is infact the voltage across the resistance not the current.
LCD 4-bit PIC24.png
Did anyone try something like and can give me some tips? Or even maybe there is a particular pic that is preferred when it comes to time measurement with the ctmu. (if it is possible to eliminate these factors)
Last edited: