28x2 doesnt support touch?!?!?!?!?!?

Hi,
I ordered several 28x2 chips (AFTER already running into this problem with the 20x2!)

It says here http://www.picaxe.com/BASIC-Commands/Analogue-InputOutput/touch/
that the TOUCH command applies to the 28x2

AND it says on the 28x2 shop page http://www.picaxe.com/Hardware/PICAXE-Chips/PICAXE-28X2-microcontroller/
that this chip supports touch! (actually it says all x2 chips support touch which is false because i already found out the hard way that the 20x2 does not!)

Am I missing something here???
I am going to be very frustrated if these chips actually don't support touch!
 
I just downloaded the new Picaxe Editor 6, even though I don't have the 28x2's yet, I tried simulating some code with a touch command. It doesn't give me a "touch not supported by this chip" error like the Picaxe Editor 5 does.
Can someone please confirm if the 28x2 chips do support touch or not?
 

srnet

Senior Member
Plus, the manual says touch is supported, and the pin out diagrams say touch is supported.

So its reasonable to assume its supported.

I dont get a "touch not supported by this chip" in PE5 with a 28X2.

So what PICAXE have you got PE5 set for ?
 

MPep

Senior Member
Hmmm..... on the 20X2 page it says Touch is supported on ALL X2 chips. Weird! The pinout does not show Touch. The 20M2 does however support it.



RevEd: please consider giving the correct info to us.
 

Circuit

Senior Member
Hi,

AND it says on the 28x2 shop page http://www.picaxe.com/Hardware/PICAXE-Chips/PICAXE-28X2-microcontroller/
that this chip supports touch! (actually it says all x2 chips support touch which is false because i already found out the hard way that the 20x2 does not!)

Am I missing something here???
I am going to be very frustrated if these chips actually don't support touch!
Yes, I am afraid that you are indeed missing something. The statement made regarding the X2 chips is correct but you are misinterpreting it. The statement made is;

"All X2 series parts support enhanced features such as configurable i/o pins, ring tone music and touch sensor inputs, i2c, spi and high-speed serial with background receive. Scratchpad memory plus separate Data EEPROM and Data Table are supported. - See more at: http://www.picaxe.com/Hardware/PICAXE-Chips/PICAXE-20X2-microcontroller..."

The statement is correct; all X2 series parts DO support enhanced features. The statement continues "such as..." - this means that there is a RANGE of enhanced features and therefore one or more may be supported. It does not imply that all the chips have all the features. The syntax, grammar and content of the sentence are appropriate and correct. The datasheet reference in the hyperlink shows immediately which pins support which features on which chips.

Have a look at Manual 1 and you will see immediately precisely which features are available on ALL PICAXE chips.

And, of course, yes the 28X2 does support TOUCH. It is all there in most clear terms. I fear that you somewhat jumped the gun with your assumptions about the chip without reading the datasheets or the other very comprehensive support material; something that I guess we all do from time-to-time. Clearly you are frustrated by your error, but please do accept that it is indeed your error.
 

nick12ab

Senior Member
Touch is supported on the PICAXE-28X2 and PICAXE-40X2 universal voltage versions only, plus M2 parts. The PICAXE-20X2 and -3V/-5V variants of the 28X2/40X2 do not support touch.
 

inglewoodpete

Senior Member
Touch is supported on the PICAXE-28X2 and PICAXE-40X2 universal voltage versions only, plus M2 parts. The PICAXE-20X2 and -3V/-5V variants of the 28X2/40X2 do not support touch.
The universal voltage 28X2 and 40X2 were introduced in December 2010. Any chips purchased more than a few months after that will have touch capability. Compatible chips will be marked PIC18F25K22 or PIC18F45K22.
 

bryanl

Member
One thing to watch out for is nomenclature as the manuals are not clear (IMHO) about whether to use pin or ADC numbers. Here is what I am using on a 28x2 in an AXE401 Shield Base:

Code:
Symbol ij = w20		; loop and counter indices
Symbol i = b40		; and other temporary values
Symbol j = b41		; of short life in routines

; Symbol touch1 = 2		; A.2  ADC2
; Symbol touch2 = 3		; A.3  ADC3
; symbol touch3 = 9		; B.3  ADC9
symbol touch4 = 11 		; B.4  ADC11
; on 28x2 must use ADC channel number and not pin
 ...
	Touch16 touch4, ij
	; SerTxd ("touch input = ",#ij,cr,lf)

	If ij > 120 Then 
		Gosub  ........
	EndIf
note that you get a value back that you must interpret and calibrate for your particular setup.
 

Goeytex

Senior Member
From the Online manual.
touch
Syntax:

TOUCH channel, variable

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

Variable - receives the byte touch reading
Then the example:
main: touch C.1,b0 ; read value into b0
if b0 > 100 then
high b.2 ; output B.2 on
else
low b.2 ; output b.2 off
endif
goto main ; else loop back to start
The command reference clearly states "not pin number". However, a few lines below, the example clearly uses the pin number.

We think this is unclear.
 

bryanl

Member
I tried to make sure I had the latest manual revision to resolve my confusions but the one I had says "Channel is a variable/constant specifying the ADC pin" -- so I'll do another refresh. I tried to make a constructive suggestion with an example to illustrate and I meant no offense.

When I went through this a couple of months ago, it was only a side comment in a product briefing that clued me in. That gave me context for other clues in the manuals via inconsistencies and chip difference patterns.

What really got me was the effect confusing pins and channel numbers had in the code behavior. When I used "B.4" rather than "11" in the touch command, my I2C communications went haywire and my battery voltage ADC came up with some really weird results. I'd expect that using the wrong nomenclature would generate an error but axepad didn't blink either way. Finding syntax errors via unexpected results can be educational but very frustrating ;-)

so I thought I'd share and hoped to help someone else avoid my experience. sorry if it caused offense or created undue difficulty.
 

Technical

Technical Support
Staff member
The command reference clearly states "not pin number". However, a few lines below, the example clearly uses the pin number.
We think this is unclear.
Agreed, this example comes from a M2 part where the pin number is the channel anyway, but it could be more generic.
 
Top