www.micro-examples.com : TouchClock

Views
From www.micro-examples.com
(Difference between revisions)
Jump to: navigation, search
(Created page with "Design your own GLCD Touch Clock ==TouchClock : a PIC18 GLCD touchscreen clock== Let me introduce TouchClock to you with this short video clip : {{#ev:youtube|rTRGn16-ml8}} T...")
 
 
(12 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
[[File:TouchClock.jpg|thumb|TouchClock screen shot]]
 
Design your own GLCD Touch Clock
 
Design your own GLCD Touch Clock
 
==TouchClock : a PIC18 GLCD touchscreen clock==
 
==TouchClock : a PIC18 GLCD touchscreen clock==
Let me introduce TouchClock to you with this short video clip :
+
A short video clip is sometimes better than a long explanation :
 
{{#ev:youtube|rTRGn16-ml8}}
 
{{#ev:youtube|rTRGn16-ml8}}
  
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
+
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==
 
==Circuit Schematic==
[[File:LCDscope-schematic.png]]
+
This project is designed to run on an [[EasyPIC3]] development board, so no circuit schematic is available.
* LCD1 is a 4 x 20 text LCD, but it works also with a classic 2x 16 text LCD (see source code) :
+
 
[[File:LCDscope-LCD-2x16.jpg]]
+
This is how to connect the 4-wires resistive touchpanel directly to the PIC :
* input signal is 0...5V
+
 
* you can find the LCD at [[CircuitED]]
+
[[File: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 below.
 +
 
 +
X and Y raw coordinates are then adjusted using calibration coordinates to get X and Y coordinates in pixel.
  
 
==C Source code==
 
==C Source code==
<pre>
+
Since this project has multiple source files, source code is not expanded here : please download archive file below.
</pre>
+
 
 
==Download project==
 
==Download project==
Download LCDscope-project.ZIP file for mikroC : [[File:LCDscope-project.zip]]  
+
Download TouchClock-project.zip file for mikroC : [[File:TouchClock-project.zip]]  
  
 
Includes :
 
Includes :
  
* [[mikroC PRO]] project files for [[PIC18F4620]], should work also with most of PIC
+
* [[mikroC PRO]] project files for [[PIC18F4620]], should work also with most PICs
* LCDscope C source code  
+
* TouchClock C source code with resistive touchscreen library
* LCDscope .HEX files
+
* TouchClock .HEX files
 
[[Category:Projects]]
 
[[Category:Projects]]
 
[[Category:PIC18]]
 
[[Category:PIC18]]
 +
 
==Discussion and Comments==
 
==Discussion and Comments==
 +
{{#w4grb_rate:}}
 
<discussion />
 
<discussion />

Latest revision as of 23:02, 12 February 2012

TouchClock screen shot

Design your own GLCD Touch Clock

Contents

TouchClock : a PIC18 GLCD touchscreen clock

A short video clip is sometimes better than a long explanation :


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 project is designed to run on an EasyPIC3 development board, so no circuit schematic is available.

This is how to connect the 4-wires resistive touchpanel 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 below.

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

C Source code

Since this project has multiple source files, source code is not expanded here : please download archive file below.

Download project

Download TouchClock-project.zip file for mikroC : File:TouchClock-project.zip

Includes :

  • mikroC PRO project files for PIC18F4620, should work also with most PICs
  • TouchClock C source code with resistive touchscreen library
  • TouchClock .HEX files

Discussion and Comments

Current user rating: 80/100 (108 votes)

 You need to enable JavaScript to vote

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