www.micro-examples.com : TouchClock

Views
From www.micro-examples.com
(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
  
 
==Circuit Schematic==
 
==Circuit Schematic==
 +
This is how to connect the 4-wire resistive touchscreen directly to the PIC :
 +
 
[[File:TouchClock-touchscreen.png]]
 
[[File:TouchClock-touchscreen.png]]
This is how the library reads the X raw coordinate of a touch  :
+
 
 +
How the library reads the X raw coordinate of a touch  :
  
 
* X+ and X- are in high Z : RA0 and RA2 are inputs
 
* X+ and X- are in high Z : RA0 and RA2 are inputs

Revision as of 12:51, 9 February 2012

Design your own GLCD Touch Clock

Contents

TouchClock : a PIC18 GLCD touchscreen clock

Let me introduce TouchClock to you with this short video clip :


The idea of this project is to use a graphic LCD with a touchscreen and a built-in sprite editor to design your own clock, and shows how to connect a resistive touchscreen directly to a PIC with no additional hardware.

This project also includes a ready-to use touchscreen library for PIC

Circuit Schematic

This is how to connect the 4-wire resistive touchscreen directly to the PIC :

TouchClock-touchscreen.png

How the library reads the X raw coordinate of a touch  :

  • X+ and X- are in high Z : RA0 and RA2 are inputs
  • Y+ is set to +5V : RA3 is output high
  • Y- is set to 0V : RA1 is output low
  • X+ voltage is read by ADC
  • Y+ is set to 0V : RA3 is output low
  • Y- is set to 5V: RA1 is output high
  • X- voltage is read by ADC and averaged with X+ value, the result is the raw X coordinate.
  • The same is then done to read the Y coordinate, please see TSlib.c file in .ZIP file above.

X and Y raw coordinates are then adjusted using calibration coordinates to get X and Y coordinates in pixel.

C Source code


Download project

Download LCDscope-project.ZIP file for mikroC : File:LCDscope-project.zip

Includes :

  • mikroC PRO project files for PIC18F4620, should work also with most of PIC
  • LCDscope C source code
  • LCDscope .HEX files

Discussion and Comments

You need JavaScript enabled for viewing comments

Navigation
Others
Donation
You can help :
with Paypal
Share
Personal tools
www.micro-examples.com Electronic circuits with micro-controllers, projects with source code examples