Menu

use of touch sensitive cap inputs for PIC

Help
JANIS
2020-02-09
2020-02-14
  • JANIS

    JANIS - 2020-02-09

    Hello to all! I can't find any example with PIC with capacitive touch input configuration and usage. I have not read any reviews about it here. A long time ago, there was little discussion with the subject. Maybe have any feedback, suggestions for using touch sensitive inputs? Which PIC is better to use, who has experience?

     
  • Jim giordano

    Jim giordano - 2020-02-10

    I would start with one of the 16f18424 series and use cvd, that works the best.
    The absolute best end product is to use the microchip cvd library, in which case any chip with an appropriate adc can do it. I did one using 12F1840 and the microchip library and they worked very well. They have a setting to force a double read which works extremely well. Even passed the dreaded ultrasonic cleaner test without glitching, which every other solution I tried failed. (Before this, every touch circuit I tried would falsely trigger whenever I used the ultrasonic cleaner on my bench, a very noisy piece of equipment). It even worked better than the dedicated QProx touch chips. But that was done in assembly five years back.
    Today, I would definately see if I could figure out how to do it in GCB using a 16f18426 or equivalent with 12 bit adc resolution.
    Strangely, the 16183xx series say they have capacitive touch channels in the feature spreadsheet that microchip provides to pick chips by feature, but when you look in the datasheet, there is not one mention of touch in the whole document, so double check the datasheets, not just use the spreadsheet.

     
  • Jim giordano

    Jim giordano - 2020-02-10

    did you look at the program in demos
    \vendor_boards\microchip-curiosity_low_pin_count_demo_board\cvd_touch_button_16f1619.gcb
    ?

     
  • JANIS

    JANIS - 2020-02-10

    Thank you! I had not noticed that the gcb demo examples have this solution. The example uses analog input. The solution is very interesting, I didn't really understand it. I was thinking of an example of using specifically capacitive touch sensitive function of pic microcontroller.

     
  • JANIS

    JANIS - 2020-02-10

    I looked at the example of gcb demo mentioned by Jim, I do not understand well how ADC works and what is the wiring diagram for this example. what is the electrical connection, Don't need a resistor on the PIC pin?

     
    • Chris Roper

      Chris Roper - 2020-02-10

      Take a look at the Curiosity Development Board User's Guide
      http://ww1.microchip.com/downloads/en/devicedoc/40001804b.pdf
      it has a schematic diagram on page 21.

       
  • Anobium

    Anobium - 2020-02-10

    The analog to digital converter (ADC or A/D) module support is implemented by Great Cow BASIC to provide 8-bit, 10-bit and 12-bit Single channel measurement mode. There are other modes but will keep this simple.

    Great Cow BASIC configures the analog to digital converter, the acquisition time and the response as a byte, word or integer.

    The simple use is the Single channel measurement mode. This is the default method for reading the ADC port. The input is attached to suitable device (a light sensor or adjustable resistor) and the command ReadADC, ReadADC10, ReadADC12 with return a byte, word or word value respectively.

    Most microcontrollers support this mode. So, attach a variable resitor like this

    Example of use is where AN3 is a specific port on the chip. You may need to look at the datasheet to get the ANx mapping.

    Print ReadAD10(AN3)

     
  • JANIS

    JANIS - 2020-02-10

    Anobium, you know that I can use Analog input. In almost every project I have, the microcontroller uses an analog input. This is the first thing whats each need to learn. I was thinking of a gcb demo sample: \ vendor_boards \ microchip-curiosity_low_pin_count_demo_board \ cvd_touch_button_16f1619.gcb. I didn't really understand why the exsample is so complicated.

     
  • Anobium

    Anobium - 2020-02-10

    Of couse.

    I think you should look at AN1298, see http://ww1.microchip.com/downloads/en/Appnotes/01298A.pdf

    The code in the demo is representation of the AN1298.

    Have you reviewed AN1298? Best you start there. Then, ask away. :-)

     
  • JANIS

    JANIS - 2020-02-10

    Ok thanks

     
  • stan cartwright

    stan cartwright - 2020-02-11

    Just a thought. If you display the a to d voltage graphically then you notice it's mains voltage frequency it picks up first. I did a simple scope that showed leaving the adc input floating showed 50Hz in the a/d output. And it 's amplitude change showed it had been touched.

     
  • JANIS

    JANIS - 2020-02-11

    However, I will use ready-made modules TTP223 from China ( 1 ,2 eur :)) . I need 5 sensors in different places. To avoid interference from a distance, it is better to use the module. The information will then be processed by the PIC.

     
  • JANIS

    JANIS - 2020-02-12

    Maybe someone has worked with the touch sensitive module TTP223?

     
    • Anobium

      Anobium - 2020-02-12

      Not me. I can get some samples, but, they look very simple.

      Set your config by soldering specific pads. And, read the state.

      I am not sure on your design but this will be 5 ports for each sensor.

      A method you want to consider could be front end like a MCP23008 to raise a single interrupt when one of the sensors is activated, then you read the state of the 5 sensors in one read. May work....

       
  • JANIS

    JANIS - 2020-02-14

    I want to tell you an idea. I had a project for visualizing the power of my Yeti Haldex 5 pump using the SSD1306. Now I want to change the steering wheel to the sports corner. there will be no control buttons, but instead TTP223 modules will be placed under the new steering wheel leather trim. The PIC will create an imitation of a schroll button. To simulate the schroll function with one touch pad. (UP, DOWN) :)))))))))))))))

     
  • JANIS

    JANIS - 2020-02-14

    Super. Thanks!

     

Log in to post a comment.