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
OK !
It is not so difficult to read.
Thanks again!
Lakis from Thessaloniki.
Bookmarks