Page 1 of 1

please teach me mTouch on flowcodeV5

Posted: Wed Jun 27, 2012 8:15 pm
by bigflowcode
i'm novice for Pic and C .can you help me some sample file for the 1 ch touch sensor and 1 output led

regards
:D

Re: please teach me mTouch on flowcodeV5

Posted: Wed Jun 27, 2012 8:53 pm
by JohnCrow
Hi
Are you refering to the touch screen ?

What version of FC are you using. The touch screen can only be used in the pro versions of FC5.
Also the touch function does not simulate, though the text display does work in simulation.

Re: please teach me mTouch on flowcodeV5

Posted: Thu Jun 28, 2012 2:08 am
by bigflowcode
thank you John Crow


I use FC 5 Pro.. I never use Fc and C code before but I have try to do basic code it is very well easy save my time for PIC .

SO i need to try CVD on ADC to be Touch Switch .
i have read (http://ww1.microchip.com/downloads/en/A ... 01298A.pdf) from Microchip
but how to do follow step on FC

1. Drive secondary channel to VDD as digital output.
2. Point ADC to the secondary VDD pin (charges CHOLD to VDD).
3. Ground sensor line.
4. Turn sensor line as input (TRISx = 1).
5. Point ADC to sensor channel (voltage divider from sensor to CHOLD).
6. Begin ADC conversion.
7. Reading is in ADRESH:ADRESL


pls. advice me


best regards

big

ps. I just knew ASM on MCS-51

Re: please teach me mTouch on flowcodeV5

Posted: Thu Jun 28, 2012 10:18 am
by dazz
As you are using V5 please sign up to the V5 forums
Regard
Dazz

Re: please teach me mTouch on flowcodeV5

Posted: Thu Jun 28, 2012 10:20 am
by Benj
Hello,

This custom component should work in v5 for PIC to give you CAP touch.
FC5_PIC_Custom.c
(5.66 KiB) Downloaded 310 times
Simply copy the file into your Flowcode/v5/Components directory.

Then add the custom component to your Flowcode program and go into the EXT properties.

The properties control the following parameters of the CAP touch component.

//ADC Defines
#define %a_MX_ADC_CHANNEL %b
#define %a_MX_ADC_ACTIME %c
#define %a_MX_ADC_CONVSP %d
#define %a_MX_ADC_VREFOP %e

//Cap Touch Defines
#define %a_MX_ADC_FILTER %f
#define %a_MX_ADC_CHARGE %g
#define %a_MX_ADC_DISCHARGE %h

a = Unique Reference - Same as ADC Component - eg CTCH1_
b = Which ADC Channel - Same as ADC Component - eg 0 for AN0
c = Acquisition time - Same as ADC Component - eg 200
d = Conversion Speed - Same as ADC Component - eg 5
e = VRef+ Option - Same as ADC Component - eg 0
f = Number of filter iterations - default 5 times - range 1 to 15
g = Cap Touch Charge Time - default 125us - range 1 to 255
h = Cap Touch Discharge Time - default 125us - range 1 to 255

The code will currently only work with some devices. I believe it was developed for use with the 18F26J50 device for use with the board below.
http://uk.farnell.com/jsp/search/produc ... ningCenter

I have moved the topic to the appropriate section of the forums details of how to sign up are available from here.
http://www.matrixmultimedia.com/mmforum ... =46&t=9958

Let me know how you get on.