Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 12:24 29 Apr 2024 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 : PicoMite Alpha Firmware - a27 onwards - starting on displays

     Page 9 of 14    
Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 06:53pm 27 Jun 2021
Copy link to clipboard 
Print this post

Is GP21 T_CS and GP20 T_IRQ (since an earlier indication had T_IRQ first--it should be T_CS first).

I have continued to be unable to get GUI CALIBRATE to work with an ILI9341. I get no response whatever to a touch with my LCD.

With multiple failures (up to about 10) I have gotten GUI CALIBRATE to work with 2 ILI9488s on two different Picos.

My question is, aside from this, has anyone other than Peter gotten GUI CALIBRATE to work?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 06:54pm 27 Jun 2021
Copy link to clipboard 
Print this post

GUI calibrate definitely works on a39 and the code hasn't changed since 36 but all I/O on the Pico seems very fragile. Each new build will act slightly differently as the caching of the instructions from the flash memory chip will differ. Depending on caching the execution of an instruction could be delayed waiting for it to load from the flash. This is an inevitable consequence of the architecture of the RP2040 (and the ESPs) and is a major downside compared to conventional chips like the PIC32 or STM32.

The 10 on the SDcard is now redundant and should be removed. It was the SPI speed to be used for SDcard access but this is now bitbanged to try and improve reliability.

I can slow the SPI speed for the touch controller in the next alpha to see if that helps at all but it is only 1Mbit now

I use OPTION TOUCH GP5, GP13 where GP5 is the chip select but any pins should work as these are controlled through simple I/O
Edited 2021-06-28 04:56 by matherp
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 12:19am 28 Jun 2021
Copy link to clipboard 
Print this post

@lizby

I am using a38 and TOUCH GP5,GP6 and it is working OK - NOW!

Initially I had a lot of problems as has been reported here - multiple calibrate errors, wrong orientation etc etc. I did find that for me at least a very brief touch on the target was needed as if I touched and held as was required on other mites, it would get all confused and fail.

I am going to try a39 this morning and will report how it went.

Doug.
Update:
Loaded a39
OPTION SYSTEM SPI GP10,GP11,GP12
OPTION LCDPANEL ILI9341,l,GP2,GP3,GP4
GUI TEST LCDPANEL  'works fine
OPTION TOUCH GP5,GP6
GUI CALIBRATE
then the following
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated                                                    
> GUI CALIBRATE     ' touched all targets briefly                                                            
Done. No errors                                                                
Deviation X = 0, Y = -2147483648 (pixels)                                      
> GUI TEST TOUCH    ' no touch pixels showing anywhere on display                                                            
> GUI CALIBRATE      ' same as above                                                          
Done. No errors                                                                
Deviation X = 0, Y = -2147483648 (pixels)                                      
> GUI CALIBRATE       ' random touches around middle of screen                                                        
Warning: Inaccurate calibration                                                
Deviation X = 260, Y = -1084 (pixels)                                          
> GUI CALIBRATE      ' touched all targets correctly and briefly                                                            
Done. No errors                                                                
Deviation X = 1, Y = -4 (pixels)                                                
> GUI TEST TOUCH       ' now working                                                          
>                                                                              
' reset via RUN pin grounded
>                                                                              
PicoMite MMBasic Version 5.07.00a39                                            
Copyright 2011-2021 Geoff Graham                                                
Copyright 2016-2021 Peter Mather                                                

> gui calibrate     ' touched all targets correctly and briefly                                                            
Done. No errors                                                                
Deviation X = 2, Y = 0 (pixels)                                                
>                                                                                
>                                                                              
> gui test touch      ' works fine with correct positioning.

This is a similar experience I had with 36 and 38 - purely a guess but it appears that the touch values initially seem to be in some random state or that the touch hardware needs to 'settle down'?

Doug.
Edited 2021-06-28 10:38 by panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 02:20am 28 Jun 2021
Copy link to clipboard 
Print this post

  panky said  I am using a38 and TOUCH GP5,GP6 and it is working OK - NOW!

Thanks for the detail. No joy for me though with the ILI9341, even with a light touch.

I'll recheck everything again tomorrow, but GUI CALIBRATE works (after multiple attempts) on an ILI9488, so I don't see how it can be the wiring or the TOUCH option. I'd try a different ILI9341, but that one kills the SD card.

~
Edited 2021-06-28 12:21 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 02:28am 28 Jun 2021
Copy link to clipboard 
Print this post

Re OPTION TOUCH,
I am finding some idiosyncrasies with setting touch on an ILI9341.

If you are using the SD card on the display, you need to setup both touch and the sd card with their respective option commands. It would appear that without both being configured, there is a conflict on MISO/MOSI causing either inconsistent results or errors. I think Peter has pointed this out before but I am just reporting my own findings.

On a new firmware update, when performing a GUI CALIBRATE, anything other than a very, VERY brief touch on the targets generates a swag of 'Error : Touch not calibrated' messages.

If you get this failure, do another GUI CALIBRATE with the briefest of touches on the targets (or in fact, anywhere on the screen) and if this is successful, even if the calibration is out of tolerance, you can then repeat the GUI CALIBRATE and the duration of the touch does not matter - the next target will not appear until the previous touch is lifted and assuming you have been precise on your touch placement, the calibration will complete successfully.

So without in any way being presumpious enough to pretend I understand the internals, it appears as if the touch interrupt starts off without the touch duration mechanism operative until a successful calibrate sequence is completed? Just a thought?

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 07:37am 28 Jun 2021
Copy link to clipboard 
Print this post

a40


PicomiteV5.07.00a40.zip


Also now has the same 7 in-built fonts as the CMM2

I've turned on hysteresis  on the SD-MISO pin which may improve touch/sdcard/LCD reliability. Will definitely be active for SDcard but unknown for touch and LCD read as the manual isn't clear if this is overridden by speical I/O functions (e.g.SPI)

Let me know if any improvement
Edited 2021-06-28 18:15 by matherp
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 11:01am 28 Jun 2021
Copy link to clipboard 
Print this post

a40: no joy with ILI9341--no response to touch either light or prolonged.

With ILI9488 and light touch (same hardware), GUI CALIBRATE worked the first time.

But . . . with the ILI9341 with which I previously could not get FILES to work, FILES now does work and GUI CALIBRATE worked the first time. So it looks like the other ILI9341 has a problem. (And I now see that on that ILI9341, the touch controller chip is absent, though there's a place for it. DOH!)

~
Edited 2021-06-28 21:08 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 11:29am 28 Jun 2021
Copy link to clipboard 
Print this post

A41


PicomiteV5.07.00a41.zip



The very first working PIO program  

Minor change to PIO INIT MACHINE syntax from that proposed above

PIO INIT MACHINE pio%, statemachine%, clockspeed [,pinctrl] [,execctrl] [,shiftctrl]


Dim a%(7)=(&H0001E000E101E081,0,0,0,0,0,0,0)
SetPin 1,pio0
PIO program 0,a%()
PIO init machine 0,0,100000
PIO start 0,0


generates a square wave on pin-1 at 1/4 of the clock frequency requested.
Edited 2021-06-28 21:30 by matherp
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 11:38am 28 Jun 2021
Copy link to clipboard 
Print this post

VegiPete's ChemiChaos on the PicoMite with Touch

ChemiTouch on youtube.

Same code as here

cc_pico.zip

Movement of the stylus is erratic because it's taped to a pencil to keep my fingers out of the way, and I'm looking at the phone screen, not the PicoMite screen.

PicoMite on FruitOfTheShed

~
Edited 2021-06-28 21:45 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3845
Posted: 06:15pm 28 Jun 2021
Copy link to clipboard 
Print this post

Bug or user error with a41?

> list
SetTick 50, tick_fn

foo()

Sub foo
 Print "Hello"
 Pause 150
 Print "World"
 End
End Sub

Sub tick_fn
 Print ".";
End Sub
> run
Hello
.......................................................................................................................................................................................................................


Never prints "World" and never ENDs.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5729
Posted: 07:07pm 28 Jun 2021
Copy link to clipboard 
Print this post

I wonder if that's because you are printing ";" every 50ms so the Print command recognizes it as a valid control character and gets it's knickers in a twist because you should never get more than one in a row? Normally it would flag a syntax error, but it can't because it gets interrupted by yet another valid character. Only a guess....
Mick

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3845
Posted: 07:51pm 28 Jun 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  I wonder if that's because you are printing ";" every 50ms so the Print command recognizes it as a valid control character and gets it's knickers in a twist because you should never get more than one in a row? Normally it would flag a syntax error, but it can't because it gets interrupted by yet another valid character. Only a guess....


Hi Mick. I don't think that is the case. The Print statement is for illustrative purposes only, the real code (which works on a CMM1) wasn't printing in the tick subroutine. I'm also not certain if it is possible for a tick timer to interrupt itself, or even if one tick timer can interrupt a different tick timer ?

Best wishes,

Tom
Edited 2021-06-29 05:51 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5729
Posted: 08:00pm 28 Jun 2021
Copy link to clipboard 
Print this post

AFAIK interrupts are handled serially in the order that they were configured. I doubt if the timers are involved as they probably aren't triggering interrupts - it'll just be a program delay.
Mick

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3845
Posted: 08:25pm 28 Jun 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  AFAIK interrupts are handled serially in the order that they were configured. I doubt if the timers are involved as they probably aren't triggering interrupts - it'll just be a program delay.


I'm using the terminology from the Armmite manual (in the absence of another reference) which talks about their being four "tick timers", I'm not speculating about how this is actually implemented. Anyway I'm reasonably sure this is a bug, and if not I'm sure Peter will let me know in his own unique style .

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5729
Posted: 08:34pm 28 Jun 2021
Copy link to clipboard 
Print this post

lol! - no doubt. :)
Mick

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

Guru

Joined: 31/01/2019
Location: Germany
Posts: 501
Posted: 09:29pm 28 Jun 2021
Copy link to clipboard 
Print this post

SetTick 50, tick_fn

foo()

Sub foo
Print "Hello"
Pause 150
Print "World"
End
End Sub

Sub tick_fn
Print ".";
End Sub



pause 50 works
pause 51 not

hope it help
Edited 2021-06-29 07:31 by Plasmamac
Plasma
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8583
Posted: 09:40pm 28 Jun 2021
Copy link to clipboard 
Print this post

Its a bug - will look at it tomorrow
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3845
Posted: 09:58pm 28 Jun 2021
Copy link to clipboard 
Print this post

  matherp said  Its a bug - will look at it tomorrow


Thank you Peter, much appreciated.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 02:05am 29 Jun 2021
Copy link to clipboard 
Print this post

I am still having issues with GUI CALIBRATE - unsure if it is something I am doing wrong, a hardware issue with my Pico/ILI9341 or something in the firmware.

I have the Pico connected to the ILI9341 as per Peter's physical setup - ie. using DuPont connectors with three  modified to be 1 way to 3 for MOSI, MISO and CLK to touch, sd card and lcd. The Pico is connected via USB to a laptop via a powered hub. VBUS is 4.96V, 3V3 on Pico is 3.25V

The problem always occurs after a firmware update and has done for all versions since a38. Once I get a correct calibration, the Pico works correctly for all subsequent calibrations until firmware is changed/reloaded.

The sequence below indicates what is occuring:-


> update firmware                                                              
PicoMite MMBasic Version 5.07.00a41                                            
Copyright 2011-2021 Geoff Graham                                                
Copyright 2016-2021 Peter Mather                                                
                                                                               
> option reset                                                                  
> flash erase all                                                              
> var clear                                                                    
> option list                                                                  
> option cpuspeed 250000                                                        
> option system spi gp10,gp11,gp12                                              
> option sdcard gp15                                                            
> option lcdpanel ili9341,l,gp2,gp3,gp4                                        
> option touch gp5,gp6                                                          
> gui calibrate                                                                
Error : Touch not calibrated                                                    
' many of these error messages, dependent upon the duration of the touch
' on the target
>                                                                              
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated                                                    
> gui calibrate    ' exactly the same thing again                                                            
Error : Touch not calibrated                                                    
>                                                                              
'  many error messages                                                                              
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated

' now reset by grounding RUN pin
                                                 
PicoMite MMBasic Version 5.07.00a41                                            
Copyright 2011-2021 Geoff Graham                                                
Copyright 2016-2021 Peter Mather                                                
                                                                               
> gui calibrate                                                                
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated                                                    
>                                                                              
' problem continues with many error messages
' Note: I am applying a touch on the target for around 1/4 to 1/2 a second                                                  
>                                                                              
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated                                                    
> gui calibrate     ' tried a short duration touch - first target OK but
' when I touched the second target - fail
                                                           
Error : Touch hardware failure                                                  
> gui calibrate                                                                
Error : Touch hardware failure                                                  
> gui calibrate                                                                
Error : Touch hardware failure

' same problem each time regardless of touch duration

' unplug-plug USB - ie. power cycle
                                               
PicoMite MMBasic Version 5.07.00a41                                            
Copyright 2011-2021 Geoff Graham                                                
Copyright 2016-2021 Peter Mather                                                
                                                                               
> gui calibrate      ' 1/4 to 1/2 second duration touch
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated                                                    
>                                                                              
' many error messages>                                                                              
Error : Touch not calibrated                                                    
> gui calibrate   ' tried brief duration touch
                                                             
Error : Touch hardware failure

' power cycle again                                                
PicoMite MMBasic Version 5.07.00a41                                            
Copyright 2011-2021 Geoff Graham                                                
Copyright 2016-2021 Peter Mather                                                
                                                                               
> var clear                                                                    
> flash erase all                                                              
> option list                                                                  
OPTION CPUSPEED (KHz) 250000                                                    
OPTION SDCARD GP15, 10                                                          
OPTION SYSTEM SPI GP10,GP11,GP12                                                
OPTION LCDPANEL ILI9341, LANDSCAPE,GP2,GP3,GP4                                  
OPTION TOUCH GP5,GP6                                                            
> gui calibrate   ' used very, VERY brief duration touches
' just a tap, probably something less than 50mS                                                              
Warning: Inaccurate calibration                                                
Deviation X = 290, Y = -2147483648 (pixels)                                    
> gui calibrate  ' now duration of touch has no effect whatsover and
' calibration completed successfully                                                              
Done. No errors                                                                
Deviation X = 0, Y = 2 (pixels)
                                               
> update firmware                                                              
PicoMite MMBasic Version 5.07.00a41                                            
Copyright 2011-2021 Geoff Graham                                                
Copyright 2016-2021 Peter Mather                                                
                                                                               
> option list                                                                  
> option cpuspeed 250000                                                        
> option system spi gp10,gp11,gp12                                              
> option lcdpanel ili9341,l,gp2,gp3,gp4                                        
> option touch gp5,gp6                                                          
> option sdcard gp15,10                                                        
> option list                                                                  
OPTION CPUSPEED (KHz) 250000                                                    
OPTION SDCARD GP15, 10                                                          
OPTION SYSTEM SPI GP10,GP11,GP12                                                
OPTION LCDPANEL ILI9341, LANDSCAPE,GP2,GP3,GP4                                  
OPTION TOUCH GP5,GP6
'power cycle                                                            
PicoMite MMBasic Version 5.07.00a41                                            
Copyright 2011-2021 Geoff Graham                                                
Copyright 2016-2021 Peter Mather                                                
                                                                               
> option list                                                                  
OPTION CPUSPEED (KHz) 250000                                                    
OPTION SDCARD GP15, 10                                                          
OPTION SYSTEM SPI GP10,GP11,GP12                                                
OPTION LCDPANEL ILI9341, LANDSCAPE,GP2,GP3,GP4                                  
OPTION TOUCH GP5,GP6                                                            
> gui calibrate   ' using 1/2 second duration touch                                                              
Error : Touch not calibrated                                                    
>                                                                              
' many error messages>                                                                              
Error : Touch not calibrated                                                    
>                                                                              
Error : Touch not calibrated
' power cycle                                                    
PicoMite MMBasic Version 5.07.00a41                                            
Copyright 2011-2021 Geoff Graham                                                
Copyright 2016-2021 Peter Mather                                                
                                                                               
> gui calibrate   ' using very brief (<50mS) taps on targets                                                              
Warning: Inaccurate calibration                                                
Deviation X = 315, Y = -2147483648 (pixels)                                    
> gui calibrate    ' now using 1 second touches on targets                                                            
Done. No errors                                                                
Deviation X = 4, Y = -4 (pixels)                                                
>


Sorry for the length but I wanted to ensure that what I was seeing was real and repeatable.
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1802
Posted: 03:53am 29 Jun 2021
Copy link to clipboard 
Print this post

Geoff said...
  Quote  The line
  GUI CALIBRATE 0, 3966, 125, -898, 644
can be used to configure the touch on an LCD panel from within a BASIC program (see page 70 of the current Micromite User Manual.

Have you tried this.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
     Page 9 of 14    
Print this page
© JAQ Software 2024