Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:35 24 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 V6.00.00 release candidates - all versions

     Page 17 of 24    
Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 06:25am 31 Oct 2024
Copy link to clipboard 
Print this post

hmm... the heap issue is again in RC11
  Quote  
PicoMiteVGA MMBasic Version 6.00.00RC11
OPTION KEYBOARD US
OPTION CPUSPEED (KHz) 252000
OPTION DISPLAY 30, 53
OPTION SDCARD GP10, GP12, GP11, GP13
OPTION AUDIO GP6,GP7', ON PWM CHANNEL 3
OPTION MODBUFF ENABLE  192


Play flac "Audio/finish-level-1.flac"
Error : Not enough Heap memory

what changed?
Edited 2024-10-31 16:26 by Martin H.
'no comment
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 08:31am 31 Oct 2024
Copy link to clipboard 
Print this post

Peter,

For me the problem now also occurs after 48 minutes for heart rate LED and time$.

Jan.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 08:46am 31 Oct 2024
Copy link to clipboard 
Print this post

Jan

Please try this version. I've had it running all night. There is a diagnostic in it whereby if the clock stops it is automatically restarted. Please report if you see a message "Timer resetting" and confirm the program then keeps running together with the heartbeat.


PicoMite.zip


  Quote  what changed?

I had to reduce the heap size from 100kB to 96kB to avoid stack issues. It will play a flac file perfectly well but not if your program uses lots of heap itself.
I'll see if I can find a way to restore back to 100K.
Edited 2024-10-31 19:33 by matherp
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2120
Posted: 05:04pm 31 Oct 2024
Copy link to clipboard 
Print this post

  phil99 said  If memory serves, Sprites are not available on the LCD version, Just VGA and HDMI.
Edit
And perhaps the Virtual LCDPANEL that exists only in memory as it is similar to VGA.
  Quote  OPTION LCDPANEL VIRTUAL_C
or
OPTION LCDPANEL VIRTUAL_M
 Configures a virtual LCD panel without a physically connected panel.
VIRTUAL _C = Colour, 4bit, 320 x 240
VIRTUAL _M = Monochrome, 640 x 480
Using this feature a program can draw graphical images on this virtual
panel and then save them as a BMP file. Useful for creating a graphic
image for export without an attached display


Correction.
Sprite commands don't work on the Virtual LCD Panel.

yes it's blit not sprite and there's BLIT x1, y1, x2, y2, w, h there's no reverse blit like vga. I thought blit and sprite were interchangeable but maybe just vga. doh
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 05:18pm 31 Oct 2024
Copy link to clipboard 
Print this post

For LCD, rather than VGA/HDMI, sprites only work on framebuffers and NOT the physical device. This is because sprites are RGB121 in order to minimize memory usage. For an LCD implementation just do everything on a framebuffer and then copy to the display when appropriate

UPDATE on the heartbeat issue. Looks like a bug in the sdk which is fixed in the latest development version (as advised by Raspberry Pi development staff). I'm testing now and will post an update when confirmed happy
Edited 2024-11-01 03:20 by matherp
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2120
Posted: 05:34pm 31 Oct 2024
Copy link to clipboard 
Print this post

  matherp said  For LCD, rather than VGA/HDMI, sprites only work on framebuffers and NOT the physical device. This is because sprites are RGB121 in order to minimize memory usage. For an LCD implementation just do everything on a framebuffer and then copy to the display when appropriate

er, blitread1 reads a sprite drawn on screen to blit1 and write blit1 writes to screen  no frame f but framef,l work work and copy to n, the screen.
mostly like vga but if I wanted data for half a symmetrical sprite I just have to read it in reverse then write to screen and blitread whole sprite.. like vga
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 05:41pm 31 Oct 2024
Copy link to clipboard 
Print this post

Peter,

The program worked for 8 hours in the background and only kept an eye on the LED, which was still flashing.
I looked at the data and there are no reports.
Unfortunately, the program stopped after an hour and 16 minutes.
Here are the beginning and end of the dates.


PicoMite MMBasic RP2040 Edition V6.00.00RC11
Copyright 2011-2024 Geoff Graham
Copyright 2016-2024 Peter Mather

> run
Tijd:00:00:03   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:00:13   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:00:23   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:00:33   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:00:43   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:00:53   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:01:03   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
                           |
                           |
Tijd:01:15:05   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:15:15   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:15:25   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:15:35   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:15:45   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:15:55   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:16:05   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:16:15   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:16:25   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C

Jan.
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2120
Posted: 06:15pm 31 Oct 2024
Copy link to clipboard 
Print this post

  stanleyella said  
  matherp said  For LCD, rather than VGA/HDMI, sprites only work on framebuffers and NOT the physical device. This is because sprites are RGB121 in order to minimize memory usage. For an LCD implementation just do everything on a framebuffer and then copy to the display when appropriate

er, blitread1 reads a sprite drawn on screen to blit1 and write blit1 writes to screen  no frame f but framef,l work work and copy to n, the screen.
mostly like vga but if I wanted data for half a symmetrical sprite I just have to read it in reverse then write to screen and blitread whole sprite.. like vga

I was mistaken,lcd does reverse blit. it was just change every sprite to blit and it worked on lcd.it's my test prog for compatibility. works on all vga,hdmi,ili lcd. why not make it sprite on lcd instead of blit for compatibility ?
restore sprite1:sht=16:swid=8
udg1 'draws sprite1 on screen at 10,10
blit READ 1,10,10,8,16 'reads sprite1 from screen to blit buffer1
blit WRITE 1,18,10,&B001 'inverts sprite horizontal and draws next to first half
blit CLOSE 1
blit READ 1,10,10,16,16 'reads whole sprite1 from screen to blit buffer 1
end
sub udg1 'draws data for blit to copy
 for spht=1 to sht
   for spw=1 to swid
     read sp1
     pixel spw+9,spht+9,sp1
   next spw
 next spht
end sub
sprite1:
data wh,bl,bl,bl,bl,bk,bk,bk ',bk,bk,bk,bl,bl,bl,bl,wh
data bk,bl,re,re,re,bl,bl,bk ',bk,bl,bl,re,re,re,bl,bk
data bk,bk,bk,bl,re,wh,bl,bk ',bk,bl,wh,re,bl,bk,bk,bk
data bk,bk,bk,bl,re,wh,bl,bk ',bk,bl,wh,re,bl,bk,bk,bk
data bk,bk,bk,bk,bl,wh,bl,bk ',bk,bl,wh,bl,bk,bk,bk,bk
data bk,bk,bk,bk,bk,bl,bl,bk ',bk,bl,bl,bk,bk,bk,bk,bk
data bk,bk,bk,bk,bk,bk,bk,bk ',bk,bk,bk,bk,bk,bk,bk,bk
data bk,bk,bk,bk,ye,ye,ye,bk ',bk,ye,ye,ye,bk,bk,bk,bk
data bk,bk,bk,ye,bk,bk,bk,bk ',bk,bk,bk,bk,ye,bk,bk,bk
data bk,ye,ye,bk,bk,bk,bk,bk ',bk,bk,bk,bk,bk,ye,ye,bk
data bk,ye,bk,bk,bk,bk,bk,bk ',bk,bk,bk,bk,bk,bk,ye,bk
data ye,bk,bk,bk,bk,bk,bk,bk ',bk,bk,bk,bk,bk,bk,bl,ye
data ye,bk,bk,bk,bk,bk,bk,bk ',bk,bk,bk,bk,bk,bk,bk,ye
data ye,bk,bk,bk,bk,bk,bk,bk ',bk,bk,bk,bk,bk,bk,bk,ye
data bk,ye,bk,bk,bk,bk,bk,bk ',bk,bk,bk,bk,bk,bk,ye,bk
data bk,bk,ye,bk,bk,bk,bk,bk ',bk,bk,bk,bk,bk,ye,bk,bk
Edited 2024-11-01 05:01 by stanleyella
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 06:29pm 31 Oct 2024
Copy link to clipboard 
Print this post

To understand the difference between blit and sprite please reread

https://www.thebackshed.com/forum/ViewTopic.php?TID=16672&PID=216994
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 07:16pm 31 Oct 2024
Copy link to clipboard 
Print this post

Peter,

Unfortunately, I cannot say with certainty whether I loaded and started the correct file this morning because I cannot find the unzipped file.
I don't see any differences in the program from the outside.
Sorry.

Jan.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 07:35pm 31 Oct 2024
Copy link to clipboard 
Print this post

Jan

This version (RC12) should be fixed by using the updated sdk. I've had it running for > 7hrs with no issues


PicoMite.zip
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 07:55pm 31 Oct 2024
Copy link to clipboard 
Print this post

Peter,

Thank you. Version PicoMite MMBasic RP2040 Edition V6.00.00RC12 now works with cpuspeed.bas.

Jan.
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 09:50pm 31 Oct 2024
Copy link to clipboard 
Print this post

Peter,

The program is still running, but I notice that time is passing a bit.
The time$ shouldn't be affected by anything, right?

> list
Dim Float Temp, Tin
Do
 Tin = Pin(Temp)
 Print "Tijd:"; Time$; "   CPU-snelheid:"; MM.Info(CpuSpeed); " Hz";
 Print "   Temperatuur RP2040:"; Str$(Tin, 2, 0); " "; Chr$(176); "C"
 Pause 10000                       ' Wacht 10 sec en doe een meting.
Loop

> run
Tijd:00:00:08   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:00:18   CPU-snelheid:133000000 Hz   Temperatuur RP2040:20 °C
Tijd:00:00:28   CPU-snelheid:133000000 Hz   Temperatuur RP2040:20 °C
Tijd:00:00:38   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:00:48   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:00:58   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:01:08   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:01:18   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C

Tijd:00:50:19   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:50:29   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:50:39   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:50:49   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:50:59   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:51:09   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C

Tijd:01:02:00   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:02:10   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:02:20   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:02:30   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:02:40   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:02:50   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:03:00   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C

Tijd:01:45:11   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:45:21   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:45:31   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:45:41   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:45:51   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:46:01   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:46:11   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:46:21   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C


Now the jumping with the transitions to determine the progression:

Tijd:00:10:08   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:10:19   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C

Tijd:00:56:29   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:00:56:40   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C

Tijd:01:43:00   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C
Tijd:01:43:11   CPU-snelheid:133000000 Hz   Temperatuur RP2040:21 °C

Jan.

Footnote added 2024-11-01 08:26 by JanVolk
Sorry, I made a mistake. I have to set the time correctly with > time$="hh:mm:ss" and > date$="dd-mm-yy" and then compare.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 10:21pm 31 Oct 2024
Copy link to clipboard 
Print this post

I would expect an occasional error in the seconds as the total loop time = 10000mS + (reading, interpreting and processing time) of all the other commands.

I expect the error would accumulate more slowly with:-
Dim Float Temp, Tin, T, P
Do
  T = Timer
  Tin = Pin(Temp)
  Print "Tijd:"; Time$; "   CPU-snelheid:"; MM.Info(CpuSpeed); " Hz";
  Print "   Temperatuur RP2040:"; Str$(Tin, 2, 0); " "; Chr$(176); "C",
  P = Timer - T : Print Cint(P*1000); " uS + a bit = Loop time"
  Pause 10000 - P - 0.01 'extra 0.01 for this line & Loop ' Wacht 10 sec en doe een meting.
Loop

or
Dim Float Temp, Tin, T
Do
  T = Timer
  Tin = Pin(Temp)
  Print "Tijd:"; Time$; "   CPU-snelheid:"; MM.Info(CpuSpeed); " Hz";
  Print "   Temperatuur RP2040:"; Str$(Tin, 2, 0); " "; Chr$(176); "C"
  ' Pause 10000                       ' Wacht 10 sec en doe een meting.
  Do While (Timer-T)<9999.99 : Loop 'allow time for main Do and Loop
Loop

The Print statements take most of the time.
AD conversion in Tin = Pin(Temp) takes about 20uS.
IIRC it takes 10 samples, discards highest and lowest and takes the mean of the rest.
Tijd:10:31:05   CPU-snelheid:400000000 Hz   Temperatuur RP2040:29 °C     623uS Loop time

Edited 2024-11-01 10:43 by phil99
 
hhtg1968
Senior Member

Joined: 25/05/2023
Location: Germany
Posts: 123
Posted: 07:16am 01 Nov 2024
Copy link to clipboard 
Print this post

documentation of the newest versions...

Hello. My pico2s have reached my home. i installed v6 an it runs very well. i ordered the hdmi device from olimex, but it has not come yet.
how can i find documentation about the differences between the versions (5.8 to 6, vga/hdmi an so on)? here in the forum it is not so easy to find because of the so many topics and comments.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 07:22am 01 Nov 2024
Copy link to clipboard 
Print this post

Mixtel90 has collated most of it here
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 08:45am 01 Nov 2024
Copy link to clipboard 
Print this post

V6.00.00RC12


PicoMiteRP2350V6.00.00RC12.zip



PicoMiteRP2040V6.00.00RC12.zip


Fixes a bug which could cause the heartbeat and time clock to stop
Fixes a bug in the PAUSE command

New Commands

SERVO channel [positionA] [,positionB]


positionA and B can be between -20 and 120 and will generate a 50Hz signal between 800uSec and 2.2mSec

As with the PWM command the pins must be set up with SETPIN n,PWM
To use just channel B use the syntax

SERVO channel,,positionB

Refer to the manual to give the channel and sub-channel (A or B) for each pin

WII NUNCHUCK OPEN [myint]
WII NUNCHUCK CLOSE


These commands enable use of a WII NUNCHUCK connected to the SYSTEM I2C pins
use the function
DEVICE(NUNCHUCK  x)

to read the nunchuck data where x=
AX acceleration in the x axis
AY acceleration in the x axis
AZ acceleration in the z axis
JX joystick x
JY joystick y
C status of C button
Z status of Z button

If the optional myint parameter is specified this is a subroutine which is called whenever the C or Z buttons are pressed

NB: because the Wii Nunchuck and Wii Classic use the same I2C address only one can be used at a time. If a second device is needed it must be connected to a different I2C channel to the SYSTEM I2C and will need to be configured and read in Basic.

Also in this version the following commands can now be used without the DEVICE qualifier

WS2812, HUMID, KEYPAD, LCD, WII CLASSIC, WII NUNCHUCK
Edited 2024-11-02 00:47 by matherp
 
hhtg1968
Senior Member

Joined: 25/05/2023
Location: Germany
Posts: 123
Posted: 03:54pm 01 Nov 2024
Copy link to clipboard 
Print this post

  phil99 said  Mixtel90 has collated most of it here


thank you very much.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6779
Posted: 08:25pm 01 Nov 2024
Copy link to clipboard 
Print this post

I thought we'd have a first of the month update.  :)
Added a few missing bits. Brought it up to date and added an index of sorts.

MMBasic catchup 1-11-24.pdf
Mick

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

Joined: 28/01/2023
Location: Netherlands
Posts: 144
Posted: 08:33pm 01 Nov 2024
Copy link to clipboard 
Print this post

Peter,

The cpuspeed.bas program worked flawlessly for 12 hours. Thanks for this.

The new servo command also works great. Also from the command line.

   PWM :PWM0A-PWM7A PWM0B-PWM7B
   PWM0A:GP00,GP16 PWM0B:GP01,GP17    
   PWM1A:GP02,GP18 PWM1B:GP03,GP19  
   PWM2A:GP04,GP20 PWM2B:GP05,GP21
   PWM3A:GP06,GP22 PWM3B:GP07,GP23
   PWM4A:GP08,GP24 PWM4B:GP09,GP25
   PWM5A:GP10,GP26 PWM5B:GP11,GP27
   PWM6A:GP12,GP28 PWM6B:GP13,GP29
   PWM7A:GP14 PWM7B:GP15  

Example:

 > SetPin GP6, PWM  
 > Servo 3, -20
 > Servo 3, 90
 > Servo 3, 120
 > PWM 3, OFF

With the up arrow you can repeat the last command.

Jan.  

Footnote added 2024-11-02 08:08 by JanVolk
90° servo:  0 = 0°, 100 =  90°  
180° servo:  0 = 0°, 100 = 180°  
360° servo: 50 = Stop, Speed: 51 - 100 = Left turn, 49 - 0 = Right turn.
 
     Page 17 of 24    
Print this page
© JAQ Software 2024