Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:41 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 V5.09.00 release candidates

     Page 12 of 13    
Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 01:55am 25 Jul 2024
Copy link to clipboard 
Print this post

A very minor issue, when using
Option Base 1

Play LOAD SOUND WaveArray()

gives

Error : Array size

Easily fixed by converting to Base 0 but Base 1 allowed an array index value to equal the harmonic numbers in the tone and simplified the wave generation function a little.
eg fundamental had array index 1, 2nd harmonic had array index 2 etc.
 
Volhout
Guru

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

  matherp said  
The map( function returns a 24-bit RGB value that will pick up the slot that you have specified a colour for

so:

MAP(1)=rgb(brown)
map set

Will cause any "normally" blue pixels to turn brown. In order to then use a drawing command with the brown colour use the map(1) function as the colour

This should be obvious in the example. This is how the CMM2 does it using a H/W colour lookup table (CLUT) whereas the PicoMite does it in the VGA driver in S/W.

NB: this functionality is only available at CPU speeds of 252 and 378 MHz


Ok, got it. MAP sets the global palette, so it real time changes the video output regardless the content on screen. This could also be step one in effort to get 16 colors in RGB222 (needs 2 more PIO pins) format.
If you desire so, I offer to look at the PIO code to make this work. 16 colors from a 64 color palette.
Edited 2024-07-25 17:33 by Volhout
PicomiteVGA PETSCII ROBOTS
 
stanleyella

Guru

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

MAP demo working vga usb. It seem like amstrad 464.
I'll try a demo I remember doing on amstrad 464 in the 80's.
cheers, stan.
 
stanleyella

Guru

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

although the demo works copying and pasting
Dim integer cmap(6)

'Clear the screen
MODE 2
Map reset
CLS

'Set up 6 colours in the array
cmap(1)=RGB(red)
cmap(2)=RGB(green)
cmap(3)=RGB(blue)
cmap(4)=RGB(yellow)
cmap(5)=RGB(magenta)
cmap(6)=RGB(cyan)
' Do an initial update of the Colour map to set up our colours
domap

gives error domap unknown command
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 08:08pm 25 Jul 2024
Copy link to clipboard 
Print this post

domap is a sub in this program

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 07:46am 27 Jul 2024
Copy link to clipboard 
Print this post

  Quote  A very minor issue, when using
Option Base 1


Can't replicate


 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 08:15am 27 Jul 2024
Copy link to clipboard 
Print this post

Ok, that has me stumped. At the command line I can't enter Option Base 1 so I put your lines in a program and it does not produce an error. Yet my program wouldn't run with Base 1
Later I will load RC7, convert it back to Base 1 and try again.

PicoMiteVGA MMBasic Version 5.09.00RC5
Copyright 2011-2024 Geoff Graham
Copyright 2016-2024 Peter Mather

> option base 1
Error : Must be before DIM or LOCAL
>

Thanks for testing it.
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 213
Posted: 10:25am 27 Jul 2024
Copy link to clipboard 
Print this post

Is there any way to use the EDIT fname$ command to edit other text files from within a running program?
It works from the command line, but from a running program it gives an error
ERROR : Invalid in a program
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 10:27am 27 Jul 2024
Copy link to clipboard 
Print this post

  Quote  Is there any way to use the EDIT fname$ command to edit other text files from within a running program?


No: completely impossible as edit uses all the variable ram as its working buffer
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 01:13pm 27 Jul 2024
Copy link to clipboard 
Print this post

Re Option Base 1, couldn't find RC7 so loaded latest version of RC5 and it works.

Found another odd thing, Play STOP is quite temperamental.
When sounds are loaded, played and stopped in a loop (in a program) eventually Play STOP causes an error.

[25] Play STOP
Error : Invalid character: 0


Also at the command line characters after it or a space before it cause an error.

> Play LOAD SOUND PLS02() : Play SOUND 3, B, U, 440, 25
> Play STOP 'error if anything after it, or a space before it
Error : Unknown command
> Play LOAD SOUND PLS02() : Play SOUND 3, B, U, 440, 25
>  Play STOP
Error : Unknown command
>


Edit.
Only happens with a loaded sound, pre defined Q, W, S & T all ok.
Edited 2024-07-27 23:23 by phil99

Footnote added 2024-07-28 08:30 by phil99
The error does not occur if the loaded array is empty.

Footnote added 2024-07-28 09:08 by phil99
Filling the array directly also does not result in an error.

for n=0 to 1023 : a%(n)=n*16 : next

is ok

There must be something wrong with my program, but can't see what.
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 213
Posted: 04:00pm 27 Jul 2024
Copy link to clipboard 
Print this post

  matherp said  
Is there any way to use the EDIT fname$ command to edit other text files from within a running program?
No: completely impossible as edit uses all the variable ram as its working buffer

Perhaps it is possible to organize a program that is running to stop it and start editing the selected file. The program selects the file to be edited, stops, and starts editing it.
For example, the RUN fname$ command allows one program to start another.
Edited 2024-07-28 02:01 by javavi
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2120
Posted: 06:47pm 27 Jul 2024
Copy link to clipboard 
Print this post

I think I figured cmap. a "3d moving matrix" demo where nothing is redrawn.

'map switching demo
Dim integer cmap(13)

'Clear the screen
MODE 2
Map reset
CLS rgb(black)

'Set up colours in the array
cmap(1)=RGB(white)
cmap(2)=RGB(black)
cmap(3)=RGB(black)
cmap(4)=RGB(black)
cmap(5)=RGB(black)
cmap(6)=RGB(black)

cmap(7)=RGB(white)
cmap(8)=RGB(black)
cmap(9)=RGB(black)
cmap(10)=RGB(black)
cmap(11)=RGB(black)
cmap(12)=RGB(black)

' Do an initial update of the Colour map to set up our colours
domap

hline=76:hy=1:mch=1
line 0,75,319,75,,RGB(white)

do'draw horizontal lines
 line 0,hline,319,hline,,map(mch)
 inc mch:if mch=7 then mch=1
 hline=hline+hy:hy=hy+0.6
loop until hline>240

xb=-149:xt=10:mch=7
do'draw vertical lines
 line xb,239,xt,75,,map(mch)
 inc mch:if mch=13 then mch=7
 xb=xb+8:xt=xt+4
loop until xb>=479

'
lr=0
do
cmap(0)=cmap(6)
 For i=5 To 0 Step -1' move horizontal lines
   cmap(i+1)=cmap(i)
 Next

 if lr<40 then
 cmap(6)=cmap(12)
 For i=11 To 6 Step -1' move vertical lines
   cmap(i+1)=cmap(i)
 Next
 else
 cmap(12)=cmap(7)
 For i=7 To 12' move vertical lines
   cmap(i)=cmap(i+1)
 Next
 end if
 inc lr:if lr>80 then lr=0

 domap
 pause 100
loop

end

Sub domap
Local integer i
Map (0)=RGB(black)
For i=1 To 12
  Map (i)=cmap(i)
Next
Map set
End Sub


 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 12:00pm 28 Jul 2024
Copy link to clipboard 
Print this post

Here we are, back in Venice with more ... Play LOAD SOUND.
What am I doing wrong?
PicoMiteVGA MMBasic Version 5.09.00RC5
Copyright 2011-2024 Geoff Graham
Copyright 2016-2024 Peter Mather

> LIST
' Print "Test for PLAY LOAD SOUND v00.bas"
Option base 0
Dim a%(1023), b%(4095), n%

For n% = 0 To 4095
 b%(n%) = n%
Next

Memory PACK b%(), a%(), 4096, 16

Do
 Play LOAD SOUND a%()
 Play SOUND 1, B, U, 440, 25
 Print "a%() now playing"
 Pause 500
 Play STOP
 Pause 200
Loop

End
>
> RUN
a%() now playing
a%() now playing
a%() now playing
a%() now playing
[16] Play STOP
Error : Unknown command
>
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 01:11pm 28 Jul 2024
Copy link to clipboard 
Print this post

Try this


PicoMite.zip
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 09:56pm 28 Jul 2024
Copy link to clipboard 
Print this post

Thank you, that is perfect!
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 857
Posted: 11:30am 04 Aug 2024
Copy link to clipboard 
Print this post

  matherp said  Out of interest please try the attached with the I2C display


PicoMite.zip



Standard Pico.

Tried running my program @420MHz and the first try, it ran for a minute before throwing up something like illegal (or invalid?) Speed.

The next attempt and error appeared immediately.

On 400MHz, currently and running without a hitch for 20+ hours.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 11:49am 04 Aug 2024
Copy link to clipboard 
Print this post

At those speeds the RP2040 isn't guaranteed to be stable anyway. Your test could fail at 140MHz and it would still be well within spec.  :)
Mick

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

Joined: 07/11/2023
Location: United Kingdom
Posts: 857
Posted: 01:02pm 04 Aug 2024
Copy link to clipboard 
Print this post

  Mixtel90 said  At those speeds the RP2040 isn't guaranteed to be stable anyway. Your test could fail at 140MHz and it would still be well within spec.  :)


Granted but nothing froze. It was a complaint from MMBasic but it allowed me to set the speed in the first place.

Update on Volhout's PIO quad decode/counting.

I have had a system running almost continuously @378MHz, spinning a motor, since I got the quad decode. I don't know how many billions of counts I have but it hasn't skipped a single pulse. Motor runs @3000RPM, stops, starts, reverses, all kinds of acceleration and deceleration rates....really loving this.
Basic interpreter and I'm running at the same rates (sample rate) as the industry big-boys    
 
georgestheking
Newbie

Joined: 21/12/2021
Location: Belgium
Posts: 26
Posted: 03:33pm 04 Aug 2024
Copy link to clipboard 
Print this post

Hi,

With the new firmware version this line give me an error :

SETPIN GP16,CIN ' right encoder

Best regards

Georges
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 06:02pm 04 Aug 2024
Copy link to clipboard 
Print this post

  Quote  With the new firmware version this line give me an error :

SETPIN GP16,CIN ' right encoder


User manual: page 32

  Quote  Counting Inputs
Any four pins can be used as counting inputs to measure frequency, period or just count pulses on the input.
The pins used for this function can be configured using the OPTION COUNT command but, if not changed,
will default to GP6, GP7, GP8 and GP9.
 
     Page 12 of 13    
Print this page
© JAQ Software 2024