Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:51 25 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 release candidates

     Page 7 of 13    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 04:29pm 27 May 2024
Copy link to clipboard 
Print this post

  Volhout said  Path length?
Does it strip B, and defaults to active drive?

Volhout


I'm not sure it's exactly that but I think the FS on drive B: may have a path limit of 63 or 64 characters and that the PicoMite isn't checking for it ... could well also be the cause of the problem with playing a .mod file that I reported in the Gems'n'Rocks thread.

Will check it out later.

Thanks for pointing me in the right (?) direction.

Best wishes,

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 05:03pm 27 May 2024
Copy link to clipboard 
Print this post

OK, I've shortened the paths and confirmed that this was (probably) the issue. It would be nice if the firmware checked for this where appropriate .

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 05:08pm 27 May 2024
Copy link to clipboard 
Print this post

  thwill said  There seems to be a mechanism by which a program started with:

RUN "B:/mmbasic-third-party-private/games/gems-n-rocks/gems-n-rocks.bas"


Can return:

"A:/mmbasic-third-party-private/games/gems-n-rocks/"


From MM.INFO(PATH) ???

But whilst it is consistent for that file it isn't consistent for all files on B:

Best wishes,

Tom

The problem is that in this case, the program wants to reload files from other subfolders, starting from the program path, I'm not sure if it adjusts when you call the program with your path.


DRIVE "b:":chdir "b:\mmbasic-third-party-private/games/gems-n-rocks"
RUN "gems-n-rocks.bas"
should work
Edited 2024-05-28 03:10 by Martin H.
'no comment
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 213
Posted: 06:16am 28 May 2024
Copy link to clipboard 
Print this post

Why can’t you make TILES in PicoMiteVGA with a height of less than 12 lines?

I would like to use ZX-Spectrum a similar 8x8 font with color attributes for programming color graphics in monochrome mode MODE 1

This mode would allow the use of 256-32 Tiles with color attributes from an 8x8 font in an 80x60 grid for MODE 1 monochrome mode (640x480).

Best regards,Javavi
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 06:58am 28 May 2024
Copy link to clipboard 
Print this post

Hi Javavi,

1 magic word: memory
This is the answer to most questions about PicoMite. RAM is scarce. going from 80x40 to 80x60 is 800 bytes RAM. Maybe Peter can find 800 bytes.

Tiles where originally 16x16 to form a 40x30 pattern, designed for font #3, then where adapted to the default font #1 (8x12) to allow syntax coloring in the editor.
You can enlarge them, but not shrink any further.

Volhout

P.S. The user manual still says the tiles are used to color font #3.
P.P.S. The TILE WIDTH command is not listed in the manual
Edited 2024-05-28 17:02 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 07:02am 28 May 2024
Copy link to clipboard 
Print this post

  javavi said  Why can’t you make TILES in PicoMiteVGA with a height of less than 12 lines?

I would like to use ZX-Spectrum a similar 8x8 font with color attributes for programming color graphics in monochrome mode MODE 1

This mode would allow the use of 256-32 Tiles with color attributes from an 8x8 font in an 80x60 grid for MODE 1 monochrome mode (640x480).

Best regards,Javavi


You can set the tile height using TILE HEIGHT. Set it to 16 and then two tiles wide is 16x16. Every Pixel in Your font has to be 2x2 Pixel on the Pico Mode 1
t
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:46am 28 May 2024
Copy link to clipboard 
Print this post

Oops,

Just realized TILES are fixed width (8 pixels). Only the height can be varied.

Volhout
PicomiteVGA PETSCII ROBOTS
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 213
Posted: 06:58am 02 Jun 2024
Copy link to clipboard 
Print this post

After resetting PicoMiteVGA v.5.09.00RC3, I can't assign the Timer system variable more than it contains until it reaches this value. It gives an error:

timer = 60000
Error : 60000 is invalid (valid is 51898)

In the future, if you set this system variable to 0 (timer=0) , then you can assign larger values, but only those that do not exceed the system's operating time.
Is this how it should work?
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 07:03am 02 Jun 2024
Copy link to clipboard 
Print this post

  javavi said  After resetting PicoMiteVGA v.5.09.00RC3, I can't assign the Timer system variable more than it contains until it reaches this value. It gives an error:

timer = 60000
Error : 60000 is invalid (valid is 51898)

In the future, if you set this system variable to 0 (timer=0) , then you can assign larger values, but only those that do not exceed the system's operating time.
Is this how it should work?

timer is readonly
I use it that way:
tt%=Timer 'set tt% to the start time
'do something in your program
time_past%=timer-TT%

so your result is stored in time_past%
Edited 2024-06-02 17:04 by Martin H.
'no comment
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 213
Posted: 07:11am 02 Jun 2024
Copy link to clipboard 
Print this post

  Martin H. said  
timer is readonly

The manual for PicoMiteVGA says:
TIMER = msec
Resets the timer to a number of milliseconds.  Normally this is just used to
reset the timer to zero but you can set it to any positive number

And how can I get interrupts every second from the RTС system time clock on PicoMiteVGA?
Edited 2024-06-02 17:28 by javavi
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6783
Posted: 07:48am 02 Jun 2024
Copy link to clipboard 
Print this post

From what I understand the RTC pulse output is disabled by default. Even if you connect it you won't get an interrupt. You have to set the registers on the RTC chip using the I2C port. Once this is done you can connect the pulse pin of the RTC to any digital input pin set up as an interrupt or, better, as a counter. The difference is that a normal interrupt input is scanned by MMBasic and a counter input is handled in hardware.

Not being able to set TIMER confuses me as I'm sure I've used it for zeroing in the past. Does that still work? I've never felt the need to set it to any other value as it always counts up, never down.

You can have a sub that runs every second using SETTICK. It's usually accurate enough for most purposes, but not for timing.
Mick

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

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 07:53am 02 Jun 2024
Copy link to clipboard 
Print this post

  javavi said  

And how can I get interrupts every second from the RTС system time clock on PicoMiteVGA?

Look in the manual, part Interrupts
I think Tick would do your job.
  Quote  
SETTICK period, target [, nbr]
This will setup a periodic interrupt (or "tick").
Four tick timers are available ('nbr' = 1, 2, 3 or 4). 'nbr' is optional and if not
specified timer number 1 will be used.
The time between interrupts is ‘period’ milliseconds and ‘target' is the interrupt
subroutine which will be called when the timed event occurs.
The period can range from 1 to 2147483647 ms (about 24 days).
These interrupts can be disabled by setting ‘period’ to zero
(i.e. SETTICK 0, 0, 3 will disable tick timer number

Edited 2024-06-02 17:56 by Martin H.
'no comment
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 213
Posted: 08:13am 02 Jun 2024
Copy link to clipboard 
Print this post

  Mixtel90 said  You can have a sub that runs every second using SETTICK. It's usually accurate enough for most purposes, but not for timing.

Thank you very much Mixtel90  !
Thank you very much Martin H. !
Now the clock is running, I am updating the readings by SETTICK.


7SClock.zip
Edited 2024-06-02 18:22 by javavi
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 213
Posted: 10:18am 02 Jun 2024
Copy link to clipboard 
Print this post



7Sclock2.zip
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:06am 03 Jun 2024
Copy link to clipboard 
Print this post

Peter (Geoff),

I have a generic question about matrix multiplication.
In my Thermal imager project I am trying to speed processing up by doing matrix multiplications to achieve higher video resolutions.

But there is something strange in the MATH M_MULT command.

This is the knowledge I have:



Dim a(1,1)=(0,2,10,100)
Dim b(1,2)=(1,0,0,0,1,0)
Dim c(1,2)

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print

Math m_mult a(),b(),c()

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print


When I try the values for n,m,p (see above) that are according to the text book, I get an error message (array dimensions).


But when I look in the PicoMite user manual I see this:



This implies that matrices in(1) and in(2) are in reverse order in the multiplication ? Please explain how this works ??? Are rows and columns swapped in the MMbasic implementation ? What cells are multiplied by what cells to achieve the geometry specified ?

Dim a(1,1)=(0,2,10,100)
Dim b(2,1)=(1,0,0,0,1,0)
Dim c(2,1)

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print

Math m_mult a(),b(),c()

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print


Volhout

This is consistent in MMB4W and PicoMite, so must be generic.
Edited 2024-06-03 17:08 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 07:13am 03 Jun 2024
Copy link to clipboard 
Print this post

MMBasic will not allow arrays with a dimension of only 1 element so you cannot initialise an array to achieve your first example. This could be programmed round in the multiplication algorithm to special case the single element but that is a big project - If anyone wants to do it I would gladly incorporate it.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:19am 03 Jun 2024
Copy link to clipboard 
Print this post

Hi Peter,

With(default) option base 0, the arrays have minimum 2 elements per dimension in the example code (not in the text book copy).

Please try this:

Dim a(1,1)=(1,2,10,100)
Dim b(2,1)=(1,1,1,1,1,1)
Dim c(2,1)

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print

Math m_mult a(),b(),c()

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print
> RUN
  1.0000,    2.0000
 10.0000,  100.0000

  1.0000,    1.0000,    1.0000
  1.0000,    1.0000,    1.0000

  0.0000,    0.0000,    0.0000
  0.0000,    0.0000,    0.0000

  1.0000,    2.0000
 10.0000,  100.0000

  1.0000,    1.0000,    1.0000
  1.0000,    1.0000,    1.0000

  3.0000,    3.0000,    0.0000
110.0000,  110.0000,    0.0000


Regardless how I fill array b(), there are never any values in c(2,xx).
It feels a bit like the code has a good implementation of the text book, just array dimension checking works reverse.

Volhout
Edited 2024-06-03 17:22 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 08:13am 03 Jun 2024
Copy link to clipboard 
Print this post

Hi Peter,

Despite the fact that MMBasic implementation of the multiplication is not exactly text-book, I think I can make it work except for the c(2,xx) problem. I have no idea why these cells are left blank.





Volhout

edit:

with larger array sizes, it seems that all cells that exceed square array are not filled.

This code:

Dim a(2,2)=(1,2,3,10,100,1000,32,64,128)
Dim b(4,2)=(1,0.5,0,0,0, 0,0.5,1,0.5,0, 0,0,0,0.5,1)
Dim c(4,2)

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print

Math m_mult a(),b(),c()

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print


results in

  1.0000,    2.0000,    3.0000
 10.0000,  100.0000, 1000.0000
 32.0000,   64.0000,  128.0000

  1.0000,    0.5000,    0.0000,    0.0000,    0.0000
  0.0000,    0.5000,    1.0000,    0.5000,    0.0000
  0.0000,    0.0000,    0.0000,    0.5000,    1.0000

  0.0000,    0.0000,    0.0000,    0.0000,    0.0000
  0.0000,    0.0000,    0.0000,    0.0000,    0.0000
  0.0000,    0.0000,    0.0000,    0.0000,    0.0000

  1.0000,    2.0000,    3.0000
 10.0000,  100.0000, 1000.0000
 32.0000,   64.0000,  128.0000

  1.0000,    0.5000,    0.0000,    0.0000,    0.0000
  0.0000,    0.5000,    1.0000,    0.5000,    0.0000
  0.0000,    0.0000,    0.0000,    0.5000,    1.0000

  1.0000,    1.5000,    2.0000,    0.0000,    0.0000
 10.0000,   55.0000,  100.0000,    0.0000,    0.0000
 32.0000,   48.0000,   64.0000,    0.0000,    0.0000


But the C() matrix should be filled with:

  1.0000,    1.5000,    2.0000,    2.5000,    3.0000
 10.0000,   55.0000,  100.0000,  550.0000, 1000.0000
 32.0000,   48.0000,   64.0000,   96.0000,  128.0000

Edited 2024-06-03 18:32 by Volhout
PicomiteVGA PETSCII ROBOTS
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 896
Posted: 10:20am 03 Jun 2024
Copy link to clipboard 
Print this post

I happen to have the F4 source open and initially had the same results.
After a fix to the source now gives this. The swapping of the rows and columns was being done in two places.

Dim a(1,1)=(1,2,10,100)
Dim b(2,1)=(1,2,3,4,5,6)
Dim c(2,1)

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print

Math m_mult a(),b(),c()

Math m_print a():Print
Math m_print b():Print
Math m_print c():Print



  1.0000,    2.0000
 10.0000,  100.0000

  1.0000,    2.0000,    3.0000
  4.0000,    5.0000,    6.0000

  0.0000,    0.0000,    0.0000
  0.0000,    0.0000,    0.0000

  1.0000,    2.0000
 10.0000,  100.0000

  1.0000,    2.0000,    3.0000
  4.0000,    5.0000,    6.0000

  9.0000,   12.0000,   15.0000
410.0000,  520.0000,  630.0000



Fix for MATH M_MULTI command in F4 should be same for Picomites.


MMFLOAT **matrix1=alloc2df(numcols1,numrows1);
//MMFLOAT **matrix2=alloc2df(numrows2,numcols2);  
//MMFLOAT **matrix3=alloc2df(numrows3,numcols3);

MMFLOAT **matrix2=alloc2df(numcols2,numrows2);
MMFLOAT **matrix3=alloc2df(numcols3,numrows3);
       



Latest F4 Latest H7
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 10:40am 03 Jun 2024
Copy link to clipboard 
Print this post

Yes, that seems correct.

I hope Peter can add that to the bug-fix list (actually for MMB4W and PicoMite minimum, but I guess all platforms).

Thanks for digging into this Disco4Now !

Volhout
PicomiteVGA PETSCII ROBOTS
 
     Page 7 of 13    
Print this page
© JAQ Software 2024