Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 16:14 30 Sep 2023 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 : Micromite eXtreme (MMX) V5.07.00 betas

     Page 2 of 2    
Author Message
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 773
Posted: 09:58pm 31 Aug 2023
Copy link to clipboard 
Print this post

What do you think about including
MM.INFO$(LINE)
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 7773
Posted: 02:09pm 02 Sep 2023
Copy link to clipboard 
Print this post

V5.07.00b2

100 and 144 pin

Micromite.X.production.zip


64 pin


Micromite.X.production.zip

Small changes
MM.INFO$(LINE)
LGETBYTE
MATH(CRCn....
MM.INFO(TRACK)
MM.INFO(SOUND)

Big changes

Complete re-write of the audio code. This is now the best platform for audio of all MMBasic ports

Supports via 12S,
Flac playback: PLAY FLAC_I2S fname$
mp3 playback: PLAY MP3_I2S fname$
wav playback: PLAY WAV_I2S fname$
mod file playback: PLAY MOD_I2S fname$

Supports via PWM
Flac playback: PLAY FLAC fname$
mp3 playback: PLAY MP3 fname$
wav playback: PLAY WAV fname$
mod file playback: PLAY MODFILE fname$
Tone command: PLAY TONE LFREQ, RFREQ [,DurationInMsec]
Sound command: As per PicoMite manual
SAM Text-to-speech PLAY TTS string$

Flac, wav and mp3 playback (both variants) all support playing an entire directory, just use a directory name instead of a filename. PLAY NEXT, PLAY PREVIOUS allow you to step through tracks

I2S playback is rated up to 24-bit 192KHz

MMX-144 wired for I2S playback.
Bit-clock SPI3-CLK (pin 98)
Data SPI3-OUT (pin 96)
L/R word clock SPI3-SS (pin 97)
Master clock (if required) SPI3-IN (pin 99)

MMX-100 wired for I2S playback.
Bit-clock SPI3-CLK (pin 69)
Data SPI3-OUT (pin 67)
L/R word clock SPI3-SS (pin 68)
Master clock (if required) SPI3-IN (pin 70)

MMX-64 wired for I2S playback
Bit-clock SPI3-CLK (pin 29)
Data SPI3-OUT (pin 45)
L/R word clock SPI3-SS (pin 30)
Master clock (if required) SPI3-IN (pin 11)

NB: the i2S dac pictured won't run on 3.3V - needs 5V




Edited 2023-09-03 00:51 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 4764
Posted: 05:00pm 02 Sep 2023
Copy link to clipboard 
Print this post

I really can't understand this. The weather's not been *that* bad, surely?

Excellent work (again), Peter. :)
Mick

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

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 1119
Posted: 08:56pm 02 Sep 2023
Copy link to clipboard 
Print this post

I got pickit3 and gcb extended but not a clue but looks clever
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 7773
Posted: 11:03am 14 Sep 2023
Copy link to clipboard 
Print this post

V5.07.00b3

100 and 144 pin

Micromite.X.production.zip

64 pin


Micromite.X.production.zip


This should be getting near finished. Just file handling to bring up-to-date

Changes:
BITBANG HUMID replaces HUMID
BITBANG LCD replaces LCD
BITBANG WS2812 introduced (same syntax as PicoMite)
FRAMEBUFFER command - same as PicoMite - works for all displays
All Sprite functionality reworked
Multiline comments (same as latest PicoMite beta)

Revised screen support

SPI
ILI9488, ILI9341, ILI9481 (Pi HAT version)

8-Bit parallel
SSD1963_4, SSD1963_5, SSD1963_5A, SSD1963_7, SSD1963_7A, SSD1963_8

16-Bit parallel
SSD1963_4_16, SSD1963_5_16, SSD1963_5A_16, SSD1963_7_16, SSD1963_7A_16, SSD1963_8_16
ILI9341_16, IPS_4_16 (supports OTM8009A and NT35510)

VGA
640x480 RGB111, 640x400 RGB111

Demo of sprites and framebuffer - should work on any display except ILI9481 (doesn't support reading the controllers framebuffer)


Option explicit
Option default none
Framebuffer create
Framebuffer write f
CLS
'brownian motion demo using sprites
Dim integer x(64),y(64),c(64)
Dim float direction(64)
Dim integer i,j,k, collision=0
Dim string q$
For i=1 To 64
direction(i)=Rnd*360 'establish the starting direction for each atom
c(i)=RGB(Rnd*255,Rnd*255,Rnd*255) 'give each atom a colour
Circle 10,10,4,1,,RGB(white),c(i) 'draw the atom
SPRITE read i,6,6,9,9 'read it in as a sprite
Next i
CLS RGB(blue)
Box 0,0,MM.HRes,MM.VRes
k=1
For i=MM.HRes\9 To MM.HRes\9*8 Step MM.HRes\9
For j=MM.VRes\9 To MM.VRes\9*8 Step MM.VRes\9
  SPRITE show k,i,j,1
  x(k)=i
  y(k)=j
  vector k,direction(k), 0, x(k), y(k) 'load up the vector move
  k=k+1
Next j
Next i
'
Do
For i=1 To 64
  vector i, direction(i), 1, x(i), y(i)
  SPRITE show i,x(i),y(i),1
  If sprite(S,i)<>-1 Then
    break_collision i
  EndIf
Next i
Framebuffer copy f,n
Loop
'
Sub vector(myobj As integer, angle As float, distance As float, x_new As intege
r, y_new As integer)
Static float y_move(64), x_move(64)
Static float x_last(69), y_last(64)
Static float last_angle(64)
If distance=0 Then
  x_last(myobj)=x_new
  y_last(myobj)=y_new
EndIf
If angle<>last_angle(myobj) Then
  y_move(myobj)=-Cos(Rad(angle))
  x_move(myobj)=Sin(Rad(angle))
  last_angle(myobj)=angle
EndIf
x_last(myobj) = x_last(myobj) + distance * x_move(myobj)
y_last(myobj) = y_last(myobj) + distance * y_move(myobj)
x_new=Cint(x_last(myobj))
y_new=Cint(y_last(myobj))
Return

' keep doing stuff until we break the collisions
Sub break_collision(atom As integer)
Local integer j=1
Local float current_angle=direction(atom)
'start by a simple bounce to break the collision
If sprite(e,atom)=1 Then
  'collision with left of screen
  current_angle=360-current_angle
ElseIf sprite(e,atom)=2 Then
  'collision with top of screen
    current_angle=((540-current_angle) Mod 360)
ElseIf sprite(e,atom)=4 Then
  'collision with right of screen
  current_angle=360-current_angle
ElseIf sprite(e,atom)=8 Then
  'collision with bottom of screen
  current_angle=((540-current_angle) Mod 360)
Else
  'collision with another sprite or with a corner
  current_angle = current_angle+180
EndIf
direction(atom)=current_angle
vector atom,direction(atom),j,x(atom),y(atom) 'break the collision
SPRITE show atom,x(atom),y(atom),1
'if the simple bounce didn't work try a random bounce
Do While (sprite(t,atom) Or sprite(e,atom)) And j<10
  Do
    direction(atom)= Rnd*360
    vector atom,direction(atom),j,x(atom),y(atom) 'break the collision
    j=j+1
  Loop Until x(atom)>=0 And x(atom)<=MM.HRes-sprite(w,atom) And y(atom)>=0 And
y(atom)<=MM.VRes-sprite(h,atom)
  SPRITE show atom,x(atom),y(atom),1
Loop
' if that didn't work then place the atom randomly
Do While (sprite(t,atom) Or sprite(e,atom))
  direction(atom)= Rnd*360
  x(atom)=Rnd*(MM.HRes-sprite(w,atom))
  y(atom)=Rnd*(MM.VRes-sprite(h,atom))
  vector atom,direction(atom),0,x(atom),y(atom) 'break the collision
  SPRITE show atom,x(atom),y(atom),1
Loop
End Sub

Edited 2023-09-14 21:14 by matherp
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2733
Posted: 12:40pm 14 Sep 2023
Copy link to clipboard 
Print this post

Just for fun, with number of sprites reduced from 64 to 32, "sprite show" changed to "blit write", and collision detection turned off because "If sprite(S,i)<>-1 Then" errors with "Error : S is not declared", this is what the sprite demo program looks like on a picomite with ILI9488:



Errors out with:

[34] Blit write i,x(i),y(i),1
Error : -9 is invalid (valid is -8 to 320)

Just playin'.

Edit: changing "Blit write i,x(i),y(i),1" to
 If y(i) > -9 And y(i) < 321) Then
   If x(i) > -9 And x(i) < 481 Then
     Blit write i,x(i),y(i),1
   EndIf
 EndIf

enabled it to run until all sprites had left the screen.

~
Edited 2023-09-14 23:03 by lizby
PicoMite, Armmite F4, SensorKits on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 7773
Posted: 06:21am 16 Sep 2023
Copy link to clipboard 
Print this post

STOP PRESS

There is now a full manual for the MMX produced for us by Panky (Doug Pankhurst).

This is available from here

It is still a work in progress and Doug will appreciate feedback but is so for ahead of where we were with my feeble efforts


 
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 752
Posted: 08:34pm 16 Sep 2023
Copy link to clipboard 
Print this post

Much thanks Doug... I have Peter's Built & operational PCB... I have somehow joined the dropbox share... I hope you don't mind... The board has been in the drawer for a few years... Will try to get back to it...  
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1066
Posted: 04:53am 30 Sep 2023
Copy link to clipboard 
Print this post

Peter,
The POLYGON command fails on the MMX144 with an SSD1963_7 lcd.

The same command works on MMB4W and Pico with SSD1963 LCD OK.

>print mm.device$Micromite eXtreme, Microchip ID 0x17227053
> print mm.ver 5.070103
> memoryFlash:
  1K ( 1%) Program (3 lines)
543K (99%) Free
RAM:
  0K ( 0%) 0 Variables
  1K ( 0%) General
380K (100%) Free
> list
Dim xarr%(3) = (100,140,130,110)
Dim yarr%(3) = (100,100,200,200)
Polygon 4,xarr%(),yarr%(),RGB(red),RGB(white)
> run
[3] Polygon 4,xarr%(),yarr%(),RGB(red),RGB(white)
Error : Syntax
>

Regards,
Doug.
Edit:
Further to the above, the MMX does not like the 'n' option in the command - if you take this out, it works as intended.

MMB4W correctly handles the 'n' parameter.

Picomite correctly handles the 'n' paramater if it matches the array sizes, however, if you specify the 'n' parameter above as 3 then Picomite draws the polygon incorrectly - it seems to forget the outline although the outline is correct when the 'n' parameter matches the array sizes.
Doug.
Edited 2023-09-30 15:12 by panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
     Page 2 of 2    
Print this page


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

© JAQ Software 2023