Capacitive touch sensors

XCore Project reviews, ideas, videos and proposals.
Post Reply
ale500
Respected Member
Posts: 259
Joined: Thu Sep 16, 2010 9:15 am

Capacitive touch sensors

Post by ale500 »

Looking at the touch facilities that other microcontrollers provide I was wondering if someone has implemented a capacitive touch sensor (for one or more keys) with the XS1 ports. I know that maybe a small uC could provide many keys via I2C, for a 1 or 2 key solution direct connection would provide a simpler path.


User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm
Contact:

Post by Berni »

Well ST i think makes 4 pin touch ICs that sense on one pin and give a TTL signal on the other so thats pretty simple. But doing it using a xmos would be pretty cool.

Only problem is that i think you can't turn off internal pull ups on xmos chips. Since the way i would try doing it is drive the touch pad high and low over a big resistor (like 1M) and then count clock ticks how long it takes for it to actually get between 1 and 0. But if the pull up is week enough you could try outputting a 0 on the pin and then quickly switching to input and see how long it takes the pull up to bring it up to logic 1.
ale500
Respected Member
Posts: 259
Joined: Thu Sep 16, 2010 9:15 am

Post by ale500 »

From what I read in the manual (port specification), pull-ups are optional (via the set_port_pull_up function)....
So we need a bidirectional pin, we have it at zero, then we pull it up for a little while and then switch to high-impedance input.
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

ale500 wrote:Looking at the touch facilities that other microcontrollers provide I was wondering if someone has implemented a capacitive touch sensor (for one or more keys) with the XS1 ports. I know that maybe a small uC could provide many keys via I2C, for a 1 or 2 key solution direct connection would provide a simpler path.
Yep, it has been done. See: https://github.com/xcore/sc_capacitive_sensing
ale500
Respected Member
Posts: 259
Joined: Thu Sep 16, 2010 9:15 am

Post by ale500 »

This is fantastic !... time to design a new board !
Post Reply