Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:48 02 Aug 2025 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 VT100 Mandelbrot

Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1234
Posted: 07:29am 06 Jun 2022
Copy link to clipboard 
Print this post

To test,how the Pico performes, compare to the old 8 Bit Computers, I translated  Matt Heffernans small Basic Program to mmbasic.
This Version uses the Terminal (VT100) for Output a Mandelbrot.
The X / y Resulution is set by DX and DY
In this case it is set to 32x22 as this is the same Resolution used in the "8 Bit Battle".
The Pico performs in Basic much faster than the 8 Bit fellows in Assembler.
(even the Commander x16 or the Spectrum Next)


'mandelbrot
'
'inspired by Matt Heffernan s 8-BIT BATTLE
'https://www.youtube.com/watch?v=DC5wi6iv9io
'for PicoMite is a Raspberry Pi Pico running the free MMBasic interpreter.
'and Putty or other VT100 emulation
'2022 by M. Herhaus
'
'clear screen, home and cursor off
Print Chr$(27);"[2J";Chr$(27);"[H";Chr$(27);"[?25l";Chr$(27);"(0";
Time$="00"
' max x and max y
DX=32:DY=22
For py=0 To DY-1
 For px=0 To DX-1
   xz=px*3.5/DX-2.5
   yz=py*2/DY-1
   x=0
   y=0
   For i=0 To 14
     If x*x+y*y>4 Then Exit For
     xt = x*x - y*y + xz
     y= 2 * x * y + yz
     x=xt
   Next i
   Print Chr$(27);"[";Str$(py+1);"H";Chr$(27);"[";Str$(px+1);"G";
   'at py+1,px+1
If i<8Then
   Print Chr$(27);"[";Str$(39+i);"m ";
 Else
   Print Chr$(27);"[";Str$(32+i);"ma";
EndIf
 Next px
Next py
'cursor on
Print Chr$(27);"[40m";Chr$(27);"[?25h";Chr$(27);"(B":Print Time$


'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5090
Posted: 12:23pm 06 Jun 2022
Copy link to clipboard 
Print this post

Hi Martin,

Pico does it in roughly 3.8 seconds (at 126MHz) tried on the VGA version.
using Putty through serial interface USB, the mandelbrot shows nicely. Although there are some "a" characters in some of the cells. Not sure if the VT100 supports 16 colors.

There is one advise I can give you:
Replace:
Time$="00" and print Time$ with
Timer=0 and print Timer.

Time$ and Date$ is the system time from the RTC (Real time clock). and when you set it to 0 , you loose your time reference. Timer is an independent variable that shows the time in ms (mili seconds). It does not change the system time Time$.
Edited 2022-06-06 22:23 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5090
Posted: 12:51pm 06 Jun 2022
Copy link to clipboard 
Print this post

The VGA version of the program running in mode 2 on a picomite 5.07.05b5
Mapping of the colors is different, but can be tuned.
Takes 1.2 seconds at 126MHz.

'mandelbrot
'
'inspired by Matt Heffernan s 8-BIT BATTLE
'https://www.youtube.com/watch?v=DC5wi6iv9io
'for PicoMite is a Raspberry Pi Pico running the free MMBasic interpreter.
'2022 by M. Herhaus
'2022 adaptation for picomiteVGA by Volhout
'
'clear screen, home and cursor off
MODE 2
CLS

'read colours
Dim color(15)
For i=0 To 15
 Read color(i)
Next i

'MANDELBROTH
Timer =0
' max x and max y
DX=32:DY=22
For py=0 To DY-1
For px=0 To DX-1
  xz=px*3.5/DX-2.5
  yz=py*2/DY-1
  x=0
  y=0
  For i=0 To 14
    If x*x+y*y>4 Then Exit For
    xt = x*x - y*y + xz
    y= 2 * x * y + yz
    x=xt
  Next i
  Box px*10,py*10,10,10,1,0,color(i)
Next px
Next py

Print @(10,230) "time = ";Timer;
Do :Loop While Inkey$=""
End

'indexing the colors
Data RGB(white),RGB(yellow),RGB(lilac),RGB(brown),RGB(fuchsia),RGB(rust)
Data RGB(magenta),RGB(red),RGB(cyan),RGB(green),RGB(cerulean),RGB(midgreen)
Data RGB(cobalt),RGB(myrtle),RGB(blue),RGB(black)

Edited 2022-06-06 22:57 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 01:06pm 06 Jun 2022
Copy link to clipboard 
Print this post

For MMBASICW (3GHz) 18 ms

Micha?
 
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 01:07pm 06 Jun 2022
Copy link to clipboard 
Print this post

duplicate
Edited 2022-06-06 23:07 by Michal
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 01:12pm 06 Jun 2022
Copy link to clipboard 
Print this post

I have a feeling that that 3GHz computer didn't cost 3.60 UKP. :)
Mick

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

Joined: 05/03/2018
Location: Netherlands
Posts: 5090
Posted: 01:21pm 06 Jun 2022
Copy link to clipboard 
Print this post

Yip,

But 17.8ms is quite fast. And early 2010 laptops are cheap, can run Ubuntu, and MMB4W runs nice under WINE. 17.8ms...
Anyway... the pico is 32 bit.. so not an 8bit challenge...
Edited 2022-06-06 23:24 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1234
Posted: 01:56pm 06 Jun 2022
Copy link to clipboard 
Print this post

  Volhout said  Hi Martin,

Pico does it in roughly 3.8 seconds (at 126MHz) tried on the VGA version.
using Putty through serial interface USB, the mandelbrot shows nicely. Although there are some "a" characters in some of the cells. Not sure if the VT100 supports 16 colors.

There is one advise I can give you:
Replace:
Time$="00" and print Time$ with
Timer=0 and print Timer.

Time$ and Date$ is the system time from the RTC (Real time clock). and when you set it to 0 , you loose your time reference. Timer is an independent variable that shows the time in ms (mili seconds). It does not change the system time Time$.

Thank you for your Response ..
the "a" is the "Checkerboard Character" on VT100, depending on the Charset the terminel uses, as VT100 has just 8 Colors,I put it in as the "light" version of the Colors ;-)


Edited 2022-06-07 00:06 by Martin H.
'no comment
 
Michal
Senior Member

Joined: 02/02/2022
Location: Poland
Posts: 125
Posted: 02:54pm 06 Jun 2022
Copy link to clipboard 
Print this post

PicoMite with:
3.5inch Touch Display Module for Raspberry Pi Pico, 65K Colors, 480×320, SPI
https://www.waveshare.com/pico-restouch-lcd-3.5.htm

1,3 sec

Michal
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 03:05pm 06 Jun 2022
Copy link to clipboard 
Print this post

That's not a bad price for that Pico PCB with 480x320 LCD & SD card. Are there I/Os left over to do I2C to a MCP23017 module? Or maybe the SPI version would work.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025