Touch command 14M2

Going crazy here because I am missing something simple.

Have a copper pad on the back of a panel wired onto bin b.3 and when I use the touch command it always returns 0. As does Touch16.

Same pin with a ReadADC command returns a value.

The pin is connected, not shorted, and I have tried a different 14M2 part. There is no resistor connected.
Code:
#picaxe 14m2
#no_data
setfreq m8
do
touch16 b.3,w0 'always returns 0?
'readadc10 b.3,w1
sertxd (#w0," ",#w1,cr,lf)
loop
Have use Touch before with other variants but don't remember this difficulty. Comment welcome.
 

techElder

Well-known member
a copper pad on the back of a panel
Assuming this means you are touching the FRONT side of the panel and not touching the copper itself.

How thick is the panel?

What is the panel made of?
 
Makes no difference whether I approach from front or back of the plastic panel. The pad itself is 3cm square copper.

Even when using just an insulated wire I should get a reading.

Main thing - is the code ok for a 14M2? If yes it has to be a wiring problem - though it is the same with other pins eg b.4.
 

AllyCat

Senior Member
Hi,

The On-line Basic Command Reference says:

Channel - is a variable/constant specifying the ADC channel (not pin number)

although (for ADC inputs) I thought that applied only to X2 chips. But clearly it's something else to try.

Cheers, Alan.
 
Thanks AlleyCat but the format has to be port.pin. That's the way in the manual example and the Editor will not accept anything else.

I'll just have to create another breadboard and try on that.
 

Technical

Technical Support
Staff member
The breadboard itself my be the issue, as the breadboard connections pins are effectively another very large touch sensor. Have you tried with the wire connected to the pin directly?
 
Thanks Technical but I ran out of time as the prototype needed to be handed across to a school so they can assess whether they want it developed for student use. I will get it back next week.

Meanwhile, It's not a breadboard issue as it worked fine on one I quickly lashed up. I think it is supply related:

Worked OK at 5v, 4.5v and 3.0v straight from a battery into the AXE117.
Failed at 3.3v from a battery via a linear regulator (slugged with a 470uF capacitor plus the one on the AXE117).

Whatever is causing the issue it is not affecting other Picaxe functions - just Touch/Touch16.

I'll have to look into it more when I get the prototype back.
 
Top