Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:50 27 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/VGA/WEB V5.07.08 release candidates

     Page 11 of 18    
Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4246
Posted: 10:20am 08 Nov 2023
Copy link to clipboard 
Print this post

Hi Tom,

Since I only have RAM for N and L layers, I think that does not work.
I tried composting L ont N with FRAMEBUFFER COPY L,N,B but that does not work. The Magenta transparent color is in the way. I think it is a copy, not a composition.

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 10:28am 08 Nov 2023
Copy link to clipboard 
Print this post

How about ?

   FRAMEBUFFER WAIT

or something involving:

   GETSCANLINE

Best wishes,

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4246
Posted: 11:00am 08 Nov 2023
Copy link to clipboard 
Print this post

Tom,

That did it..... FRAMEBUFFER WAIT (although the delay is a real "pause" so we go down a bit in framerate (0-16ms -> average 10%).

Thanks a lot !!!

Volhout
Edited 2023-11-08 21:33 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 12:41pm 08 Nov 2023
Copy link to clipboard 
Print this post

Presumably if you do the Wait once you have done all the calculations, it will only mop up time that isn't being used anyway?
Regards Kevin
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4246
Posted: 01:00pm 08 Nov 2023
Copy link to clipboard 
Print this post

Hi Kevin,

The loop does not have much overhead anymore...
Once I have all functionality in I will start a optimization session.

Volhout
PicomiteVGA PETSCII ROBOTS
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 04:31am 11 Nov 2023
Copy link to clipboard 
Print this post

Edit: Never mind, the error is else where.
Edited 2023-11-11 15:57 by vegipete
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9126
Posted: 08:19pm 11 Nov 2023
Copy link to clipboard 
Print this post

V5.07.08RC15

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

Full support for VS1053 sound.

This version has full support for the VS1053 sound chip as a (much better) alternative to the PWM sound or the MCP4822 DAC (no filters needed just an SPI connection to the PicoMite). It is available on all versions and the chip packaged onto a module is cheap and widely available.





To enable the VS1053 use

OPTION AUDIO VS1053 SPICLKpin, SPIMOSIpin, SPIMISOpin, CSpin, DCSpin, DREQpin, RESETpin


Note that like the MCP4822 the VS1053 uses a separate SPI port from that specified by OPTION SYSTEM SPI. A dedicated SPI channel is essential to allow it to be used in a H/W interrupt routine.

What is the VS1053 and why is it so good?

The VS1053 can decode a wide variety of audio formats such as MP3, AAC, Ogg Vorbis, WMA, MIDI, FLAC, WAV (PCM and ADPCM). There's also a special MIDI mode that you can boot the chip into that will read execute realtime MIDI data. It has a high-quality on-chip stereo DAC with no phase error between channels and stereo earphone driver capable of driving a 30 Ω load direct.

I've integrated the VS1053 so that nearly all existing audio commands will work through it: FLAC playback, WAV file playback, MOD file playback but in addition it can also provide superb MP3 audio, playback MIDI files and also provide a real-time MIDI interface. In the case of FLAC, MP3, MIDI, and WAV files, all files in a directory can be played with a single command and PLAY NEXT and PLAY PREVIOUS can step forwards and backwards through the playlist.
Finally I've implemented a MP3 STREAM capability allowing the WebMite to provide internet radio  capability with half a dozen simple commands.

So once the VS1053 is enabled with the permanent option command you can do the following:

PLAY FLAC fname$ [,interrupt] or PLAY FLAC dirname$
PLAY MP3 fname$ [,interrupt] or PLAY MP3 dirname$
PLAY WAV fname$ [,interrupt] or PLAY WAV dirname$
PLAY MIDIFILE fname$ [,interrupt]  or PLAY MIDIFILE dirname$
PLAY MODFILE fname$ [,interrupt]

To enter realtime MIDI mode use:
PLAY MIDI

then you can use
PLAY NOTE ON channel, note, velocity
PLAY NOTE OFF channel, note [,velocity]
PLAY MIDI TEST n (n=0 to 3, 0 = normal realtime, the others play note and instrument samples)
PLAY MIDI CMD cmd%, data1% [,data2%] (used for setting instruments to channels etc.)

Finally, you can use:
PLAY STREAM buffer%(), readpointer%, writepointer%
This plays anything in the circular buffer and will continuously output if the write pointer is updated. This is specifically designed for use with the Webmite but could also be used to output any WAV pattern from MMBasic by first writing into the buffer a 44-byte WAV header.

See this thread and this one for more information and history of the development.

The new commands for the WebMite supporting streamed TCP data are:

WEB OPEN TCP STREAM address$, PORTno

and

WEB TCP CLIENT STREAM command$, buffer%(), readpointer%, writepointer%

The command will be something like
  Quote  GET /ClassicFMMP3 HTTP/1.1
Host: ice-the.musicradio.com
Connection: close


as in the example to listen to the UK program CLASSIC-FM

I think the VS1053 support has significantly increased the number of possible applications for the PicoMite (even MP3 support is a big advantage). There is more I could do in supporting AAC and/or OG and I haven't currently implement PLAY TONE or PLAY SOUND as they are somewhat difficult and largely superseded by the realtime MIDI capability


Edited 2023-11-12 06:26 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9126
Posted: 12:53pm 12 Nov 2023
Copy link to clipboard 
Print this post

V5.07.08RC16

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

Sorry one more change but the last for a while

This will delete all options and any contents of the A: drive

By request this has new maths functions


MATH C_ADD array1%(), array2%(), arrary3%()
MATH C_SUB array1%(), array2%(), arrary3%()
MATH C_MUL array1%(), array2%(), arrary3%()
MATH C_DIV array1%(), array2%(), arrary3%()
MATH C_ADD array1!(), array2!(), arrary3!()
MATH C_SUB array1!(), array2!(), arrary3!()
MATH C_MUL array1!(), array2!(), arrary3!()
MATH C_DIV array1!(), array2!(), arrary3!()


These do cell by cell operations (hence C_) on identically sized arrays. There are no restrictions on the number of dimensions and no restrictions on using the same array twice or even three times in the parameters. The datatype must be the same for all the arrays

so

MATH C_MULT a%(),a%(),a%()

will square all the values in the array a%()
Edited 2023-11-12 22:58 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 01:32pm 12 Nov 2023
Copy link to clipboard 
Print this post

Minor cosmetic issue:

> option list
PicoMite MMBasic Version 5.07.08RC16
OPTION SYSTEM SPI GP6,GP3,GP4
AUTORUN 1,NORESET
OPTION CPUSPEED (KHz) 252000
OPTION LCDPANEL ILI9341, RLANDSCAPE,GP2,GP1,GP0
OPTION TOUCH GP5,GP7
OPTION SDCARD GP22
OPTION AUDIO GP20,GP21, ON PWM CHANNEL 2
OPTION MODBUFF 128


Note how the AUTORUN option is not prefixed OPTION.

Also is there an option to run a file on boot rather than AUTORUNning from a flash slot ?

Best wishes,

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

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 07:36pm 12 Nov 2023
Copy link to clipboard 
Print this post

  Quote  By request this has new maths functions


Thanks for this, it will speedup lots of calculations.

Jim
VK7JH
MMedit   MMBasic Help
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2136
Posted: 09:36pm 12 Nov 2023
Copy link to clipboard 
Print this post

  Quote  is there an option to run a file on boot rather than AUTORUNning from a flash slot ?

Sub MM.STARTUP
 RUN [file$] [, cmdline$]
End Sub

Would this work? - Not tested
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 10:31pm 12 Nov 2023
Copy link to clipboard 
Print this post

  phil99 said  
  Quote  is there an option to run a file on boot rather than AUTORUNning from a flash slot ?

Sub MM.STARTUP
 RUN [file$] [, cmdline$]
End Sub

Would this work? - Not tested


Hi Phil,

I believe that is still running something already in flash (either slot 0 or possibly the LIBRARY). I vaguely thought there may have been a magic "autoexec.bas" file which if present got run, but I can't find it in the code or documentation so may have been imagining it?

Best wishes,

Tom
Edited 2023-11-13 08:32 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 10:20am 13 Nov 2023
Copy link to clipboard 
Print this post

Peter,

Have we lost a significant slab of A:/ flash-drive since 5.07.08RC7, looks like we now only have 442 K (+ 128K mod buffer) and I'm sure we had 60+ K more than that ?

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9126
Posted: 10:23am 13 Nov 2023
Copy link to clipboard 
Print this post

The RAM available has grown. Therefore 4*RAM as flash slots has also grown. I've also had to nudge up the flash allocated to the program by 32Kb to cover the extra functionality. Many clones (and all my designs) have > flash so are a better platform
Edited 2023-11-13 20:25 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 10:32am 13 Nov 2023
Copy link to clipboard 
Print this post

  matherp said  The RAM available has grown. Therefore 4*RAM as flash slots has also grown. I've also had to nudge up the flash allocated to the program by 32Kb to cover the extra functionality.


Ack.

  matherp said  Many clones (and all my designs) have > flash so are a better platform


Except IMO it rather splinters the PicoMite platform, YMMV.

I'm going to make a couple of suggestions acknowledging that my use-case is not everyone's:

- OPTION to configure the number of flash slots.

- Make one of the flash slots small (2K or even less), just enough to AUTORUN a program from the flash-disk.

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9126
Posted: 10:57am 13 Nov 2023
Copy link to clipboard 
Print this post

Either of those would be a huge change as MAXFLASHSLOTS is a compile time constant with many other constants relating to placement of things in flash dependent on it
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9126
Posted: 05:24pm 13 Nov 2023
Copy link to clipboard 
Print this post

V5.07.08RC17

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

I lied about no more changes - sorry.

This will delete all options and any contents of the A: drive


Flash slots reduced to 3 and changes to optimization to increase the size of the A: drive. No functional changes but please report anything odd.
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 05:55pm 13 Nov 2023
Copy link to clipboard 
Print this post


No sooner do you make changes than they become outdated.
Yesterday Volhout released the new version that uses Flashslot 4 instead of Library.

But seriously, switching from slot 4 to 3 in two parts of the Code makes the program run again
'no comment
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 07:09pm 13 Nov 2023
Copy link to clipboard 
Print this post

  thwill said  Minor cosmetic issue:

> option list
PicoMite MMBasic Version 5.07.08RC16
OPTION SYSTEM SPI GP6,GP3,GP4
AUTORUN 1,NORESET
OPTION CPUSPEED (KHz) 252000
OPTION LCDPANEL ILI9341, RLANDSCAPE,GP2,GP1,GP0
OPTION TOUCH GP5,GP7
OPTION SDCARD GP22
OPTION AUDIO GP20,GP21, ON PWM CHANNEL 2
OPTION MODBUFF 128


Note how the AUTORUN option is not prefixed OPTION.

Best wishes,

Tom


Another minor cosmetic one, could OPTION CPUSPEED be changed to
OPTION CPUSPEED 252000 'KHz
so that it is a valid MMBasic statement?
Visit Vegipete's *Mite Library for cool programs.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 08:40pm 13 Nov 2023
Copy link to clipboard 
Print this post

Yep. CPUSPEED is always in kHz. I know, it's weird. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 11 of 18    
Print this page
© JAQ Software 2024