Thanks Hank. Well, 30% seems too much to me. I have managed up to 16%...
Thanks Darrel too. Yes your suggestions did made alot of difference.
Ioannis
Thanks Hank. Well, 30% seems too much to me. I have managed up to 16%...
Thanks Darrel too. Yes your suggestions did made alot of difference.
Ioannis
After some testing, it seems that with the modification Darrel suggested, it needs to touch very quickly to get a 'pressed=1' flag.
If you approach relatively slow the touch pad it won't get triggered. I may have to play with the constants in the CSM and average too.
But it made a very reliable system now.
Thanks for the tips.
PIC16f1827 with the internal CSM module makes it very easy to make a touch keyboard. Only a couple of registers to setup and you are ready.
Ioannis
Yes the deviation from the 'normal' (no finger nearby) CSM output count, is related to how long the sample period is vs how long you actually touch the sensor for.....also the physical composition of the sensor itself, and how moist your finger is!
So a quick touch might only see a 5% deviation from the normal count, whereas a long sensor press, will see the CSM output count plummet.
Last edited by HankMcSpank; - 6th December 2011 at 16:18.
OK, seems to work good now with these settings:
PIC chip : 16F1827
System clock : 32MHz
Timer0 Int's : From system clock every 8ms
Timer1 input : From CSM module
CSM setup : CPSCON0 = %10001100
CPSCON1 = %00000010
T1CON setup : %11000001
OPTION_REG : %10000111 Timer0 with /256 prescaller
AvgCount CON 16 ' = Number of samples to average (max 32)
FAspread CON 25
Now you may wonder why the average constants are low valued. Because the system clock is high enough, clocking everything too fast. But with these settings looks OK for the touch pad I am testing.
Ioannis
Ioannis , geia !
Is it possible to post the modified optimized code for the 16F1827?
Thank you.
Lakis.
Geia Laki.
OK, it is over a year now. Hmm, where do I have this file?
Let me search a bit, OK?
Ioannis
OK, Here it is.
It makes use of Darrels Averaging and Interrupt routines.
Unfortunately I had not add comments and may be hard to follow this test code. Sorry about that.
Ioannis
Bookmarks