Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:53 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Simulating a touch panel

Author Message
fred777
Regular Member

Joined: 01/07/2021
Location: United Kingdom
Posts: 57
Posted: 12:18pm 08 Nov 2022
Copy link to clipboard 
Print this post

Hi all,

I have a ssd1963 based display without touch support.
I would like to simulate touch events using a trackball.
The trackball works like a ps/2 mouse and is handled by an
avr microcontroller that decodes the ps/2 data. I don’t
think I can read the trackball from the picomite.
It might be possible to let the avr act like a touch controller
(XPT2046?) but that would be a lot of work.
I’d rather just have the avr generate an interrupt for the picomite to have it
fetch the mouse coordinates from the avr and then simulate a touch event.
Is there a way to simulate a touch event?

Cheers,
Fred
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 09:30pm 08 Nov 2022
Copy link to clipboard 
Print this post

Somebody has done that with a mouse but I can't find the post.

You can do it with a serial mouse or one of the USB to serial mouse converters. It has been done on the CMM1 a couple of times.

Don't now about trackballs.

Bill
Keep safe. Live long and prosper.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 09:38pm 08 Nov 2022
Copy link to clipboard 
Print this post

I don't think the PicoMite can handle the streams of interrupts you get from a mouse or trackball - not if you are trying to update a pointer on the screen at the same time anyway. The CMM is a different beast.
Edited 2022-11-09 07:39 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 10:03pm 08 Nov 2022
Copy link to clipboard 
Print this post

Here it is! It was done by VegiPete.

The CMM1 is indeed a different device, it's a lot slower that the Picomite at 80MHz there are posts here and here.

TassyJim has done something with an arduino also.

Bill
Keep safe. Live long and prosper.
 
fred777
Regular Member

Joined: 01/07/2021
Location: United Kingdom
Posts: 57
Posted: 10:33pm 08 Nov 2022
Copy link to clipboard 
Print this post

Thanks for those suggestions but I was also looking for a way to fake touch events. The idea is to use the Trackball with MMBasic's Gui controls. So a routine to simulate pressing the lcd panel would be needed.  (TOUCH FAKE X,Y or something like that... ;-)  )
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:46pm 08 Nov 2022
Copy link to clipboard 
Print this post

  Quote  The idea is to use the Trackball with MMBasic's Gui controls.


Can't be done unless you emulate the XPT2046
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:07am 09 Nov 2022
Copy link to clipboard 
Print this post

With a touch panel, you 'click' where you touch.
With a mouse, you need a cursor to know where you are going to click.

Without some sort of visual indication of where the mouse is, life would be difficult.

PS2 to serial with an Arduino nano is easy.
Serial interrupts in MMBasic is easy.
It is then up to you to track the mouse movements and organize a mouse cursor for your program.
If you want to control programs similar to joysticks, no cursor is needed, just the serial interrupt routines.

Jim
VK7JH
MMedit
 
fred777
Regular Member

Joined: 01/07/2021
Location: United Kingdom
Posts: 57
Posted: 08:22am 09 Nov 2022
Copy link to clipboard 
Print this post

I was planning on drawing a crosshair as a cursor.
But let’s forget about the whole trackball thing for a moment.
Is there any way to trigger a gui control from basic, if only for testing purposes?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 09:01am 09 Nov 2022
Copy link to clipboard 
Print this post

  Quote  Is there any way to trigger a gui control from basic, if only for testing purposes?


No: gui controls are tightly bound to touch
 
fred777
Regular Member

Joined: 01/07/2021
Location: United Kingdom
Posts: 57
Posted: 09:18am 09 Nov 2022
Copy link to clipboard 
Print this post

Ok, thanks for the information. I guess I’ll just use the avr to read the trackball and drive the ssd1963.
Cheers,
Fred
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 09:23am 09 Nov 2022
Copy link to clipboard 
Print this post

Could you display your own version of the controls as an image on the screen then move a cursor sprite over it and read the x,y position on a click interrupt? It's rather simplified in some ways though.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 09:35am 09 Nov 2022
Copy link to clipboard 
Print this post

Have a look at the various backpack projects on Geoff's site. Lots of examples of GUIs without using the GUI command using straight Basic
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 09:48am 09 Nov 2022
Copy link to clipboard 
Print this post

See Geoff's Getting Started with the Micromite document. It explains how to do it quite well and gives a program listing.

The MX170 Micromite does not have GUI functions so they must be done in MMBasic.

If you check out my link above, that's how I do it, I pinched his code. Don't tell him.

Bill
Keep safe. Live long and prosper.
 
fred777
Regular Member

Joined: 01/07/2021
Location: United Kingdom
Posts: 57
Posted: 09:51am 09 Nov 2022
Copy link to clipboard 
Print this post

Thanks I’ll have a look at those examples
Edited 2022-11-10 03:05 by fred777
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025