i currently working on PIC microcontroller. I have PIC18F26K40. I want to use CVD (Capacitive Voltage Divider) technique to implement capacitive touch button. I am using mTouch library of MCC (Microchip Code Configurator) library for that. I am doing same as per microchip documentation (links are here and here ). PIC is not detecting the touch. Here is my main method below:
void main(void)
{
// Initialize the device
SYSTEM_Initialize();
INTERRUPT_GlobalInterruptEnable();
INTERRUPT_PeripheralInterruptEnable();
LED_TRIS = OUTPUT;
while (1)
{
if(MTOUCH_Service_Mainloop())
{
/* Button API*/
if (MTOUCH_Button_isPressed(0))
LED_LAT = HIGH;
else
LED_LAT = LOW;
}
}
}
I have some doubts:
- What is differential CVD.
- What is driver shield. Do i need it?
- Do i need to use two analog channels.
- I have worked and tested CTMU mode of PIC18F26K22. Is there any way use CVD like CTMU.
- If you have any solutions with or without library then let me know.
I am attaching some screenshot of my MCC configurations. Please go through it.
Note:
- MPlab IDE: v5.50
- Analog pin used for sensing: RB0
- Programmer: PICKIT3