Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

AR1020 Touch Controller

Status
Not open for further replies.
I have no idea why someone would want to use a pain in the butt specialty IC to do something as simple as read an XY touchpanel. It's like using a specialty chip to read 2 pots. ;)

The IC gives you both position and pressure data. It's also better for battery operated items since powering a uC's ADC takes power and it can't sleep during that time unless you poll over longer intervals. The touchscreen IC's are low power and provide wake up interrupts for a uC.

You could still try the tsc2046:
https://www.electro-tech-online.com/threads/tsc2046-controller-and-nds-touchscreen.92141/
 
Thanks for the info Dirtylude. :)

I've used low power with the PIC directly controlling touchscreen by using sleep/WDT and only reading one ADC after each wakeup. Then if Y>min the PIC knows the screen is touched and comes out of sleep to do both Y and X readings.

I know some people like using these peripherals ICs for every task imaginable but I guess I'm a bit "old school". I like it best if it can all be done by the one PIC . ;)
 
Id rather use a ic for a couple reasons.. Less code for me.. Spi/i2c is simple as is and to have a external interrupt is nice. Also its more precise than what i would create...

I do use both software and hardware versions so im not saying to use a ic only but there are advantages... Like if you need more adc pins etc...
 
Hello

I do not understand well x,y reading function from edman222 : touchPress();
Could you please explain me the last lines of the function:

Code:
void  touchPress (void)
{
...
pen = (pen>>7)&0x00FF;
yhi = (((yhi<<7)|ylo)&0x0FFF);  // set it to a 0-1024 type thing
xhi = (((xhi<<7)|xlo)&0x0FFF);
}

I would like to use AR1020 with a 128x64 GLCD screen,

Once touchPress(); has been ran, how should i use the returned results : xhi , yhi, pen in order to compare them with a user defined area , i mean something like a button drawed in the GLCD ?

Is a calibration mandatory ?

Many thanks for your help,
 
Last edited:
...
I would like to use AR1020 with a 128x64 GLCD screen,

Once touchPress(); has been ran, how should i use the returned results : xhi , yhi, pen in order to compare them with a user defined area , i mean something like a button drawed in the GLCD
...

I usually like to scale the values from the touchscreens to be the same as the pixel X and Y coords.

So if touchscreen X is 0-1023 I convert it to screen pixel X 0-127 like this;
scrX = (tpX / 8);

The TP coords are easier to use if they roughly match screen pixel coords.

...
Is a calibration mandatory ?
...

I don't think so. If you need to draw on the screen and get the pen tip matching an exact pixel then maybe. But generally the TP output is fairly linear and if you glue the TP onto the GLCD straight it will always be within a couple pixels of the right value. For buttons and simple screen controls that is plenty accurate enough.
 
(To Crocu)- You PM'ed me, I will answer here as I don't like using PMs for stuff which already has it's own thread (and benefits everybody).

The answer is; Sorry I don't use the AR1020 controller, and don't have any code for it. I use the touch controller directly with 4 PIC pins as I never saw the need to buy a special chip when you can just use 4 PIC pins (two of them ADC inputs).

Maybe someone who uses the AR1020 can help you with the specifics for that controller IC?
 
Crocu, My code just takes the data and combines the two upper and lower bytes of the X1 X2 and Y1 Y2 position into one X Y... it is easier to handle a single int rather than two chars (X1 X2) ... that way you can scale it or put it into a dot drawing algorithm for the screen..

Calibration is necessary if you want to draw on the screen or have a touch screen keyboard... if you want large buttons it doesn't matter to much...
 
Thanks edman222

But, what does do :
Code:
pen = (pen>>7)&0x00FF;
Why 'pen' is usefull in the result function ?

--

Have you wrote a calibration function, something like "click in each angles of the screen", i do not know how to do it .
 
edman, i calibrate the driver and it is perfectly working thanks.
I have still problem. Can i look at your code? Thanks a lot.

Moderator edit: displaying your e-mail address on the forum is an invitation to spammers. Deleted.
 
Last edited by a moderator:
This is a very old thread, 2 minutos has not been seen here for over six years.

JimB
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top