Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:40 28 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 : Updated PicoMite, PicoMite and WebMite Firmware

     Page 3 of 4    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9129
Posted: 01:27pm 26 Jun 2023
Copy link to clipboard 
Print this post

Loading a program clears saved variables
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 01:44pm 26 Jun 2023
Copy link to clipboard 
Print this post

Aha.... makes sense ... have to find another solution using the filesystem ..

Volhout
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 511
Posted: 02:27pm 26 Jun 2023
Copy link to clipboard 
Print this post

Hi Peter,
As a follow up to this question, is it expected that a VAR SAVE of only 1 variable takes about a third of a second? this does not noticably go up with increased number of saved variables. I was getting a watchdog timeout intermittently caused by this, for now I've increased the timeout.
Thanks Kevin.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 08:06am 27 Jun 2023
Copy link to clipboard 
Print this post

Hi Peter,

I have one request for the PIO DMA.

Belowis the text in the manual

PIO DMA RX pio, sm, nbr,
data%() [,completioninterrupt]
[,transfersize] [,loopbackcount]

PIO DMA TX pio, sm, nbr,
data%() [,completioninterrupt]
[,transfersize] [,loopbackcount]


The "nbr" value is the number of transfers where the interrupt is called.

My request is :

When nbr=0 then do not call the interrupt ever (never stop the DMA). This is needed when using a ring buffer while reading (RX) or sending (TX) data through PIO infinitely.

It hurted in the logic analyzer (after a while the analyer stops waiting for a trigger), and in the sine wave generator (depending the PIO DMA speed the sine wave output stops after few minutes.

Alternatively you can disable the "nbr" interrupt when a loopback counter is used.

Thank you in advance for helping

Volhout.
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9129
Posted: 08:48am 27 Jun 2023
Copy link to clipboard 
Print this post

Unfortunately, the DMA has a 32-bit counter and will always stop when that runs out. It is not possible to tell it to run continuously
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 05:49pm 29 Jun 2023
Copy link to clipboard 
Print this post

Hi Peter,

I've come across a few things with the standard PicoMite (specifically in embedded use with LCD and no attached console) whilst developing the software for the Bintendo / PicoGAME LCD which I think may be considered general usability issues and I'm wondering if you might consider addressing them ?

1. When the PicoMite aborts (e.g. "Error invalid address - resetting") then, to prevent the possibility of the device going into an endless reboot loop, it clears OPTION AUTORUN. This is ideal during development, but once the PicoMite is deployed it means that if such an abort does occur the device is "dead" until you attach a USB console to reconfigure OPTION AUTORUN, even resetting the device doesn't help because the OPTION has been cleared. I would like to suggest that the desired behaviour once deployed would be for OPTION AUTORUN to not be cleared on abort - hopefully by that point the programmer will have ironed out anything that might cause an endless reboot loop and the user would rather the device and program just restarted in the event of an abort. I realise this will probably need another OPTION to implement, or a flag to OPTION AUTORUN.

2. When a PicoMite with no console reports an ERROR and returns to the MMBasic prompt then it appears to have just hung. I would suggest that (again possibly OPTION configurable) if an LCD is configured it is cleared to black and the error message is written in white centrally on the LCD.

3. Under other circumstances (i.e. non-error conditions, and again OPTION configurable) when a PicoMite with no console finds itself starting at, or returning to the MMBasic prompt the LCD should be cleared to black and display the message "MMBasic - attach USB console".

YMMV,

Tom
Edited 2023-06-30 04:00 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9129
Posted: 06:03pm 29 Jun 2023
Copy link to clipboard 
Print this post

Sorry Tom, but this is another one user only request. You can achieve most of what you want with OPTION LCDPANEL CONSOLE
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 06:10pm 29 Jun 2023
Copy link to clipboard 
Print this post

ACK, I assume that given the PicoMite is open-source that you (and Geoff) have no objection to me providing a pre-built binary of a forked and slightly modified PicoGAME LCD specific version of the firmware if I decide I want to go down that route ?

Best wishes,

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 09:38am 02 Jul 2023
Copy link to clipboard 
Print this post

This feels like a bug, given no SD card present:

> option list
PicoMite MMBasic Version 5.07.08b7
OPTION SYSTEM SPI GP6,GP3,GP4
OPTION AUTORUN 1
OPTION CPUSPEED (KHz) 252000
OPTION LCDPANEL ILI9341, RLANDSCAPE,GP2,GP1,GP0
OPTION GUI CONTROLS 2
OPTION TOUCH GP5,GP7
GUI CALIBRATE 0, 4034, 2040, -2600000, -64285
OPTION SDCARD GP22
OPTION AUDIO GP20,GP21, ON PWM CHANNEL 2
> a:
> ? Mm.Info(SDCARD)
Ready                    <--- Huh?
> b:
> ? Mm.Info(SDCARD)
Not present


Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9129
Posted: 10:34am 02 Jul 2023
Copy link to clipboard 
Print this post

Thanks - will fix
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 07:32pm 17 Jul 2023
Copy link to clipboard 
Print this post

Hi Peter, others,

I have finished my SNAKE game for picomite VGA.
Now I want to port it to picomite (LCD)
The VGA game used 8 sprites.

I thought I could use the 8 blit buffers (picomite does not support sprites).

So on the VGA pico I loaded all sprites piece for piece in mode 2, and saved them as images (bmp files). I did not use save compressed image.

When I try to open these bmp files on the picomite with BLIT LOAD, the picomite complains they are not in 24bit RGB mode.

What did I do wrong ? Is this something that should have worked, or did I make a mistake in my thinking.

The sprites are 8x8 pixels (=64), and the bmp file is 150 bytes in size. That (indeed) does not sound like it can fit all the pixels as 24 bit values (should be 192 bytes minimum).

Is there any way I can convert sprites in VGA pico to something I can BLIT LOAD in a normal pico?

Thanks you for your help,

Volhout
Edited 2023-07-18 05:35 by Volhout
PicomiteVGA PETSCII ROBOTS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2137
Posted: 10:17pm 17 Jul 2023
Copy link to clipboard 
Print this post

Open the image in IrfanView, click Image => Increase Colour Depth => 16 milion colours (24 bit)
Then file => save as...

If you don't already have it it is free and can do batch processing. Once you set up the conversion rules it will do the lot in one go.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 07:06am 18 Jul 2023
Copy link to clipboard 
Print this post

Thanks !

Will try this tonight. I remeber that MS Paint also allows to save as 24bit bmp.
That was my alternative. I remember my old PC still has native MS Paint. The new ones do not have this installed anymore. See if it still boots...

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 09:24am 18 Jul 2023
Copy link to clipboard 
Print this post

The Format, Sprites are saved and loaded is 1 Byte per Pixel, which holds the Colornumber.

8,1,8
FFFFFFFF
F000000F
F000000F
F000000F
F000000F
F000000F
F000000F
FFFFFFFF
 This is not BMP

To translate Pictures for the Pico I use MMB4W

For example:

fname$="Loderunner.png"
W=128
H=32
cls
load png fname$
for y=0 to h
 for x=0 to w
   nc=0
   cl=pixel(x,y) and &HFFFFFF
   if (cl and &HFF)>&H7F then nc=&HFF
   select case  cl and &HFF00
     case &H1f00 to &H5E00
       inc nc,&H4000
     case &H5f00 to &H7F00
       inc nc,&H8000
     case &H8000 to &HFF00
       inc nc,&Hff00
   end select
   if (cl and &HFF0000)>&H7F0000 then inc nc,&HFF0000
   pixel x,y,nc
 next
next
save image "Loderunner.bmp",0,0,w,h

Edited 2023-07-18 19:31 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 09:48am 18 Jul 2023
Copy link to clipboard 
Print this post

Hi Martin,

OK, so the trick is to use MMB4W...
Apparently MMB4W saves "SAVE IMAGE" in 24bit RGB values.

Picomite VGA does not save in 24bit RGB using the exact same command (or I must be wrong).

Volhout
Edited 2023-07-18 19:49 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 10:00am 18 Jul 2023
Copy link to clipboard 
Print this post

I think the difference is not the BMP, but there is SPRITE LOAD and SPRITE LOADBMP
Which should also run with BLIT LOAD and BLIT LOADBMP  (untested)
The normal Load uses the Format the format I mentioned above
  Quote  
SPRITE LOADBMP will load a blit buffer from a 24-bit bmp image file. x,y
define the start position in the image to start loading and w,h specify the
width and height of the area to be loaded.
e.g.
BLIT LOAD #1,"image1", 50,50,100,100
will load an area of 100 pixels square with the top left had corner at 50,50
from the image image1.bmp

'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 10:49am 18 Jul 2023
Copy link to clipboard 
Print this post

Either I am confused, or you are confused....
I have the sprite file in pico VGA, named "8.spr"

in picomite VGA

MODE 2
SPRITE LOAD "8.spr",1 'load 8 sprites starting from index 1
SPRITE WRITE 1,0,0    'write the first 8x8 sprite in the top left corner of the VGA screen
SAVE IMAGE "1.bmp",0,0,8,8  'write the 8x8 top left corner as a BMP file to disk


copy the "1.bmp" file (SD card....) to a standard pico

in picomite

BLIT LOAD 1,"1.bmp",0,0  'load the pixels in blit buffer #1, size automatic


Then I get an error, the file is not in 24bit RGB format

That is where I was confused...

Volhout
Edited 2023-07-18 20:50 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 11:18am 18 Jul 2023
Copy link to clipboard 
Print this post

  Volhout said  Either I am confused, or you are confused....

now I am to ..
as I see it, "Blit LOAD" is not meant to load BMP files, but SPR.
There shold "Blit LOADBMP" work.
I'll test it this afternoon when I'm  back from the office :-)


Cheers
Mart!n
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 12:59pm 18 Jul 2023
Copy link to clipboard 
Print this post

Before you get even more confused

I use 2 different pico's

1/ picomite VGA, with screen attached, that runs SNAKE. Use it to create the BMP files from the individual spritest in the SPR file.
Note that on the VGA version, SPRITE and BLIT are doing the same.

2/ picomite (normal) with attached ILI9341 display. You need the display configured (not actually attached, the problem will also show if you only have the display configured, but not actually attached.
I use this to (try to) load the BMP file in the blit buffer.
Note that on picomite, SPRITE does not exist. BLIT does.

Volhout
Edited 2023-07-18 23:01 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 08:47am 19 Jul 2023
Copy link to clipboard 
Print this post

Playing with SPI to read an attached ADS8326 ADC.
Checked the 4 SPI modes:



The table is correct, but after I measured with a scope, I understood that "output data on falling edge" means "output shifts at falling edge".

So your SPI device must be configured to latch the data at the rising edge.





Volhout
Edited 2023-07-19 18:51 by Volhout
PicomiteVGA PETSCII ROBOTS
 
     Page 3 of 4    
Print this page
© JAQ Software 2024