Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:21 26 Nov 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 V5.09.00 betas: Sorting out SPRITE and BLIT + USB variants

     Page 7 of 9    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 10:01am 02 Mar 2024
Copy link to clipboard 
Print this post

I think I've fixed this so please download again.
It seems to have been a compiler bug ignoring a "volatile" specifier on a variable. All I've done is re-ordered some code and the problem has gone away. This code hasn't changed for ages so it is concerning that you were seeing those symptoms
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 172
Posted: 02:05pm 02 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  I think I've fixed this so please download again.
It seems to have been a compiler bug ignoring a "volatile" specifier on a variable. All I've done is re-ordered some code and the problem has gone away. This code hasn't changed for ages so it is concerning that you were seeing those symptoms


Unfortunately, behaves the same. Its should show still as b5 (`WebMite MMBasic Version 5.09.00b5`), right? I downloaded it from Geoff's site unter beta versions. I reloaded the page.

Best
Thomas
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 02:26pm 02 Mar 2024
Copy link to clipboard 
Print this post

Hmmm. Standard PicoMite is definitely fixed but not the WebMite. This is really disappointing because there is no code bug. What happens is that the startup waits for the first of 5 seconds or the USB console connecting. The problem is that the 5 seconds counter which is incremented in an interrupt routine isn't being seen as counting so the wait loop never ends
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 02:36pm 02 Mar 2024
Copy link to clipboard 
Print this post

Try this


PicoMiteWeb.zip
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2127
Posted: 03:19pm 02 Mar 2024
Copy link to clipboard 
Print this post

  JanVolk said  Peter,
If I only apply voltage to the USB connector with a 5V adapter in the latest version, the Raspberry Pi Pico never starts running and the LED remains off.
Also does not start if connected to TeraTerm (PC beeps twice) and the correct COM port has not yet been selected, the LED remains off.
Option RESET doesn't help either.
Only when the correct com port has been selected in Tera Term will the flashing LED start. When there is only voltage on the module, the LED remains off.
Also tested with clearing memory with Clear_flash.uf2 with no changes.

PicoMite MMBasic version 5.09.00b5
Copyright 2011-2024 Geoff Graham
Copyright 2016-2024 Peter Mather

>

Jan

I connected a 5V usb power pack to picovga with usb 00b5 and heartbeat flashed and the auto run on code started.
In teraterm you Have to select serial then com 1,2 or the last which will be picomite then win beeps. You must set baud to 115200.
mmcc the console in mmedit finds the pico when connected and baud is 115200.
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 172
Posted: 04:10pm 02 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  Try this
PicoMiteWeb.zip

This seems to work - thanks!! I'll do further testing and report back, if there is another problem.
 
karlelch

Senior Member

Joined: 30/10/2014
Location: Germany
Posts: 172
Posted: 04:11pm 02 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  Hmmm. Standard PicoMite is definitely fixed but not the WebMite. This is really disappointing because there is no code bug. What happens is that the startup waits for the first of 5 seconds or the USB console connecting. The problem is that the 5 seconds counter which is incremented in an interrupt routine isn't being seen as counting so the wait loop never ends

Some minor new version in the build chain?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 05:02pm 02 Mar 2024
Copy link to clipboard 
Print this post

b5 updated with working versions (I hope)
Edited 2024-03-03 03:02 by matherp
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 05:39pm 02 Mar 2024
Copy link to clipboard 
Print this post

Thank you. It now works properly for the PicoMite version 5.09.00b5. The LED now immediately starts flashing after 5V voltage and after reset and immediately beeps twice that a USB driver has seen the RP2040, but only 5 seconds later the com port is released via Tera Term.
The operation is otherwise normal. No errors seen yet.

The comment about the com port number from stanleyella is, in my opinion, for a USB connection determined by the USB port in the RP2040 or the separate USB to TTL converter, each of which has its own unique com port number and is visible at Tera Term Setup Serial port and eventually also select this when using MMEdit(4).

Jan
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 05:51pm 02 Mar 2024
Copy link to clipboard 
Print this post

Small addition. The 5 second wait time is now gone. Good work Peter.

Jan.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 07:10pm 05 Mar 2024
Copy link to clipboard 
Print this post

Hi Peter,
I've been testing B5, this is on a GameMite, with a ILI9481IPS screen, which I know is physically too large, but I wanted to try 480x320.
I have enabled LCD Console.
When I edit a program and scroll to the bottom of the screen, using the arrow keys, when the screen tries to scroll, I get
'Error : Display not configured' and the Pico locks up, requiring a reset, if I use the page up/down there is not a problem.

PicoMite MMBasic Version 5.09.00b5
OPTION SYSTEM SPI GP6,GP3,GP4
OPTION SYSTEM I2C GP26,GP27
OPTION COLOURCODE ON
OPTION HEARTBEAT OFF
OPTION CPUSPEED  252000 'KHz
OPTION LCDPANEL CONSOLE
OPTION DISPLAY 26, 60
OPTION LCDPANEL ILI9481IPS, LANDSCAPE,GP2,GP1,GP0
OPTION TOUCH GP5,GP7
OPTION SDCARD GP22
OPTION AUDIO GP20,GP21', ON PWM CHANNEL 2
OPTION PLATFORM Game*Mite

I got the same on B2, so I thought I'd try B5.
Any ideas? Thanks.
Regards, Kevin.
Edited 2024-03-06 05:20 by Bleep
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 07:58pm 05 Mar 2024
Copy link to clipboard 
Print this post

You can't read from a ILI9481IPS display - or at least I couldn't get it to work, so console mode should be disabled for this display. I'll fix this in the next beta
Edited 2024-03-06 05:59 by matherp
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 10:40am 06 Mar 2024
Copy link to clipboard 
Print this post

Hi Peter,
Ok, I didn't realise that the console function required reading to work.
However I may have another problem with that display?
When I run this program, It's a Matrix code rain type display, when I do the Blit, to move the frame buffer down by 4 pixies I start to get random artifacts all across the screen? I'm now assuming this is the same problem? But if I try to do
'Blit Framebuffer F,F....' that is not allowed? so will the only way to resolve this for this display be to set up 2 framebuffers F & L, and ping pong between the 2, which will get quite messy?

' Matrix code rain
' turn off default typing and force explicit typing
Option EXPLICIT
Option DEFAULT NONE
SetPin GP25, DOUT

Dim Integer horiz=MM.HRes/10-1, vert=MM.VRes/10-1
' Set up the rotation strings
Dim String orientate(3) Length 3 =("CMN","CMD","CMU","CMI")
Dim Integer shade(horiz),i,k=&hA00,l=2,LCD=0,c,r,x,n,m,y
Font 7

If MM.Device$="PicoMite" Or MM.Device$="PicoMiteUSB" Then
 FRAMEBUFFER create
 FRAMEBUFFER Write f
 LCD=1
Else
 MODE 2
EndIf

 CLS
' Draw 'Matrix' code rain display
 Do
  If l=0 Then
' Move the 'code' down one line, gradually decreasing Green
' If white change to Green
   If shade(m)=&hF0FFFF Then shade(m)=&hff00+k:shade(n)=&h
' Reduce Green brightness
   For y=0To horiz:shade(y)=Choice(shade(y)<&h1000,0,shade
  EndIf
' Move whole screen down 4 pixies
'  Blit Framebuffer f,f,0,0,0,4,MM.HRes,MM.VRes-4
  Blit 0,0,0,4,MM.HRes,MM.VRes-4
' Blank out the top 4 lines of pixies
  Line 0,0,MM.HRes,0,4,0
  Inc l
  If l>1 Then
   l=0
' Output to display
   m=Rnd*horiz:n=Rnd*horiz
' Set to white initially
   shade(m)=&hF0FFFF : shade(n)=&hF0FFFF
' Draw the top line of randomised characters, rotating rand
   For x=0To horiz
    Text x*10+4,4,Chr$(Rnd*75+48),orientate(Rnd*3),,,shade
   Next
  EndIf
  If LCD Then
'     FRAMEBUFFER Wait
    FRAMEBUFFER copy f,n,b
'     Pause 40
  Else
    Pause 80
  EndIf
  Print Timer:Timer =0
 Loop
End

Thanks for looking.
Regards, Kevin.
Edited 2024-03-06 20:42 by Bleep
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 12:27pm 06 Mar 2024
Copy link to clipboard 
Print this post

From here

  Quote  ILI9488 and ILI9481IPS are different displays. Use the one that matches your display. ILI9481IPS does not support reading from the framebuffer hence no BLIT. ILI9488 does.
ILI9481IPS is a crap display and not recommended, poor implementation.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 03:55pm 06 Mar 2024
Copy link to clipboard 
Print this post

Hi Peter,
Understood, but I'm trying to untangle something here, because if on a VGA I create a frame buffer, with 'Frame Buffer create' & 'Framebuffer write F' and then use Blit, that operates fine on the framebuffer & when I then do 'FRAMEBUFFER copy f,n' the shifted framebuffer appears on the VGA screen correctly.
However if I do exactly the same on this LCD I get garbage, I don't believe this is using the read from 'LCD' framebuffer, but maybe it is?
I realise this is a rubbish LCD, but I don't currently have another 480x320 LCD to test with. I have tested with a 320x240 LCD and that works as expected. If this screen is no good, maybe it would be better to remove it completely to save memory?
Sorry the code I pasted before got mangled & I can't now correct it, this should be correct and is doing the same with FRAMEBUFFER in both LCD and VGA.
' Matrix code rain
' turn off default typing and force explicit typing
Option EXPLICIT
Option DEFAULT NONE
SetPin GP25, DOUT

Dim Integer horiz=MM.HRes/10-1, vert=MM.VRes/10-1
' Set up the rotation strings
Dim String orientate(3) Length 3 =("CMN","CMD","CMU","CMI")
Dim Integer shade(horiz),i,k=&hA00,l=2,LCD=0,c,r,x,n,m,y
Font 7

If MM.Device$="PicoMite" Or MM.Device$="PicoMiteUSB" Then
FRAMEBUFFER create
FRAMEBUFFER Write f
LCD=1
Else
MODE 2
FRAMEBUFFER create
FRAMEBUFFER Write f
EndIf

CLS
' Draw 'Matrix' code rain display
Do
 If l=0 Then
' Move the 'code' down one line, gradually decreasing Green
' If white change to Green
  If shade(m)=&hF0FFFF Then shade(m)=&hff00+k:shade(n)=&hff00+k
' Reduce Green brightness
  For y=0To horiz:shade(y)=Choice(shade(y)<&h1000,0,shade(y)-k):Next
 EndIf
' Move whole screen down 4 pixies
'  Blit Framebuffer f,f,0,0,0,4,MM.HRes,MM.VRes-4
 Blit 0,0,0,4,MM.HRes,MM.VRes-4
' Blank out the top 4 lines of pixies
 Line 0,0,MM.HRes,0,4,0
 Inc l
 If l>1 Then
  l=0          
' Output to display
  m=Rnd*horiz:n=Rnd*horiz
' Set to white initially
  shade(m)=&hF0FFFF : shade(n)=&hF0FFFF
' Draw the top line of randomised characters, rotating randomly
  For x=0To horiz
   Text x*10+4,4,Chr$(Rnd*75+48),orientate(Rnd*3),,,shade(x)
  Next
 EndIf
 If LCD Then
'     FRAMEBUFFER Wait
   FRAMEBUFFER copy f,n
'     Pause 40
 Else
   FRAMEBUFFER copy f,n
   Pause 40
 EndIf
'  Print Timer:Timer =0
Loop
End

Thanks for looking.
Regards, Kevin.
Edited 2024-03-07 02:00 by Bleep
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 04:19pm 06 Mar 2024
Copy link to clipboard 
Print this post

I probably never implemented framebuffer copy for this display so it is using some incorrect driver. I'll remove it in the next beta.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 06:24pm 06 Mar 2024
Copy link to clipboard 
Print this post

Version 5.09.00b6

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Fixes bug in MATH M_MULT
Blocks ILI9481IPS display from being used as the console

Major internal re-engineering of command tokens

Programs in memory will be corrupt and must be re-loaded from disk or re-downloaded

FOR KEVIN

There is a bug in BLIT of a framebuffer when a 480x320 SPI display is the main display. I don't believe that there is a bug for an ILI9341 display or VGA. Please confirm.
Edited 2024-03-07 04:59 by matherp
 
Hans

Senior Member

Joined: 18/10/2022
Location: Canada
Posts: 116
Posted: 08:09pm 06 Mar 2024
Copy link to clipboard 
Print this post

@matherp

Hi Peter;

Is it possible to have the PicoMiteVGA of 5.09.00xx version also allow for the OPTION VGA PINS reassignment without the USB coding?

Love all the new stuff BTW!  

Thanks for all your efforts,

Hans ...
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 09:22pm 06 Mar 2024
Copy link to clipboard 
Print this post

Peter,

A little too much internal re-engineering of command tokens?

PicoMite MMBasic Version 5.09.00b6
Copyright 2011-2024 Geoff Graham
Copyright 2016-2024 Peter Mather


> option reset
> list functions
*              +              -              /              <
<<             <=             <>             =              =<
=>             >              >=             >>             @(
\              ^              Abs(           ACos(          And
As             Asc(           ASin(          Atan2(         Atn(
Bin$(          Bin2str$(      Bound(         Call(          Choice(
Chr$(          Cint(          Cos(           CtrlVal(       Cwd$
Date$          DateTime$(     Day$(          Deg(           DEVICE(
Dir$(          Distance(      Else           Eof(           Epoch(
Eval(          Exp(           Field$(        Fix(           For
Format$(       GoSub          GoTo           GPS(           Hex$(
Inkey$         Input$(        Instr(         Int(           INV
LCase$(        LCompare(      Left$(         Len(           LGetByte(
LGetStr$(      LInStr(        LLen(          Loc(           Lof(
Log(           Math(          Max(           Mid$(          Min(
MM.Device$     MM.ErrMsg$     MM.Errno       MM.Fontwidth   MM.HPOS
MM.HRes        MM.I2C         MM.Info$(      MM.Info$(      MM.Info(
MM.OneWire     MM.Ver         MM.VPOS        MM.VRes        MM.Watchdog
Mod            MsgBox(        Not            Oct$(          Or
Peek(          Pi             Pin(           Pio(           Pixel(
Port(          Pos            Pulsin(        Rad(           RGB(
Right$(        Rnd            Rnd(           Sgn(           Sin(
Space$(        SPI(           SPI2(          sprite(        Sqr(
Step           Str$(          Str2bin(       String$(       Tab(
Tan(           TEMPR(         Then           Time$          Timer
To             UCase$(        Until          Val(           While
Xor
Total of 131 functions and operators
> list commands




























Total of 137 commands
>

Jan
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 10:40pm 06 Mar 2024
Copy link to clipboard 
Print this post

Hi Peter,
I can confirm that Blit is working fine for 9341 & VGA.
Regards Kevin.
 
     Page 7 of 9    
Print this page
© JAQ Software 2024