I'm designing a project based on Atmega328P which uses QMatrix to drive 15 capacitive touch buttons. Well, QMatrix sensors requires a couple of resistors and capacitors on sensor pins

Is any issue if some of the ISP pins are wired to capacitors and used as touch?


simulate this circuit – Schematic created using CircuitLab

This schematics shows typical wiring for a single QMatrix sensor, along with recomended component values. X/YA/YB/SMP are simply names QMatrix spec give to pins based on it's role.

The X line and YA line are not directly in eletrical contact on the button, though they form an interdigitated pattern which happens to form a capacitor

  • \$\begingroup\$ I'd add jumpers in line so that you can isolate the touch input signals when you want to use the ISP header. \$\endgroup\$ – Tom Carpenter Feb 17 '17 at 18:21
  • 1
    \$\begingroup\$ What are the values of the resistors and capacitors, and how are they configured? \$\endgroup\$ – duskwuff Feb 17 '17 at 18:42
  • \$\begingroup\$ @TomCarpenter nice idea \$\endgroup\$ – magnomp Feb 19 '17 at 13:07
  • \$\begingroup\$ @duskwuff Added the schematic and values to original post \$\endgroup\$ – magnomp Feb 19 '17 at 13:08

If the 4.7nF between two of the ISP pins, you may well have issues unless you slow the ISP clock rate down quite considerably (<1MHz) otherwise the signal edges will be slowed possibly to the point of not being recognised.

You have two options that I can think of:

  1. Use some 2.54mm header jumpers that are placed between the MCU pins and the touch sensor components (caps, resistors, etc.). When you want to do ISP, remove the jumpers so that the ISP pins are now isolated from the rest of the circuitry, leaving only the ISP header connected. Once programmed replace the jumpers.

  2. Use solder jumpers to isolate the circuitry. Do a one-time programming of a bootloader, then solder the jumpers. This way if you need to reprogram you can use the serial port rather than the ISP pins to do so. In the event that the bootloader gets corrupted, you can desolder the jumpers to use the ISP again.

The advantages of having a small solder jumper vs a 2.54mm jumper header are firstly the space used is much less, and secondly the impact on your touch signals from parasitics of the jumpers is minimised.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.