Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:55 11 Nov 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 : Touch SPI Bug?

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 03:14am 04 Feb 2018
Copy link to clipboard 
Print this post

Using PM's 470 backpack, I have come across a problem that appears to be a bug?

I am running 5.04.09 running on a 64 pin 470 board with an SSD1963 7" display

If I try to use D13 (470 pin 50) on the Arduino shield which is SPI Clk as a digital out, as soon as I set it to 1 the touch function on the 7" screen stops working.

I have checked the board and the 7" display uses SPI2 which should mean that using SPI1Clk (the D13 pin referred to above) should have no impact on touch?

The code below demonstrates the issue - the top touch checkbox works as it should for multiple touches but as soon as the bottom checkbox is touched, all touch functionality stops and the only recovery is a power reset.

If the line pin(50)=1 in the touchdown interrupt is commented out, both buttons work as they should when touched.


' Peter Mather 470 board running 5.04.09
' with SSD1963 7" display
' initialise graphics
cls
font 4,2
setpin 50,dout ' D13 which is SPI1Clk
pin(50)=0 ' all works when SPI1Clk is low
GUI checkbox #1,"Test Touch",50,20,100,RGB(green)
gui checkbox #2,"Test Touch 2",50,220,100,RGB(green)
gui interrupt TouchDown

'Main program loop entry
ctrlval(#1) = 0
ctrlval(#2) = 0
do
loop
print " Program error - should never get here! "
end

' Interrupt service routines
sub TouchDown
if ctrlval(#2) = 1 then
print "Button 2 touched"
pin(50)=1 ' this will now disable touch
else
Print "Button 1 touched"
endif
End sub



If I have misread the manual on the SPI usage, I would appreciate any advice on where I have gone wrong.

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9750
Posted: 03:27am 04 Feb 2018
Copy link to clipboard 
Print this post

Works OK for me.





No errors, no lockups, touch continues to work fine.
Smoke makes things work. When the smoke gets out, it stops!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 03:29am 04 Feb 2018
Copy link to clipboard 
Print this post

What platform and what software version G?

My config is

  Quote  
option list
OPTION LCDPANEL SSD1963_7, RLANDSCAPE
OPTION TOUCH 51, 33
OPTION SDCARD 52
OPTION RTC 43, 44
> print mm.ver
5.0409
> memory
Flash:
1K ( 0%) Program (29 lines)
99K (100%) Free

RAM:
0K ( 0%) 0 Variables
1K ( 0%) General
102K (100%) Free
>
Edited by panky 2018-02-05
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9750
Posted: 03:36am 04 Feb 2018
Copy link to clipboard 
Print this post

E64 module(same chip as you), 5.04.08

I have one permanently setup here with a 7" LCD on it for development, which is why I could test your code immediately.
Smoke makes things work. When the smoke gets out, it stops!
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1044
Posted: 03:40am 04 Feb 2018
Copy link to clipboard 
Print this post

T_CS is on pin 51. Maybe a bridge between pins 50 & 51 so when pin 50=1 then the touch T_CS pin won't pull low to select the touch.

Gerry
F4 H7FotSF4xGT
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 03:48am 04 Feb 2018
Copy link to clipboard 
Print this post

Bingo! Got it in 1 Gerry - thanks and apologies to Geoff/Peter.

Thanks,
Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9750
Posted: 03:58am 04 Feb 2018
Copy link to clipboard 
Print this post

Nice suggestion, Gerry!!!!!
Smoke makes things work. When the smoke gets out, it stops!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 04:18am 04 Feb 2018
Copy link to clipboard 
Print this post

SOAB! Bin using this board for over 2 years but never D13 till now! Mr. Murphy has a lot to answer for!

Thanks G and Gerry,
Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
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