please teach me mTouch on flowcodeV5

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
bigflowcode
Posts: 2
Joined: Wed Jun 27, 2012 8:05 pm

please teach me mTouch on flowcodeV5

Post 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

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Re: please teach me mTouch on flowcodeV5

Post 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.
1 in 10 people understand binary, the other one doesn't !

bigflowcode
Posts: 2
Joined: Wed Jun 27, 2012 8:05 pm

Re: please teach me mTouch on flowcodeV5

Post 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

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: please teach me mTouch on flowcodeV5

Post by dazz »

As you are using V5 please sign up to the V5 forums
Regard
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: please teach me mTouch on flowcodeV5

Post 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 298 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.

Post Reply