Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:00 04 Jul 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 : CMM2: Next steps?

     Page 4 of 8    
Author Message
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2428
Posted: 03:35pm 27 Jun 2020
Copy link to clipboard 
Print this post

  JohnS said  
  robert.rozee said  if someone wants to create a version 3 of the CMM, just take a RPi and port MicroMite basic to run on the bare metal...    

The closed hardware, need for NDA etc, make this problematic, to put it mildly.
John


"The closed hardware, need for NDA etc, make this problematic": not at all. linux on the RPi uses a 'binary blob' to interface with the proprietary stuff, with the linux-facing side completely open for anyone to use, and documented via the linux source code itself. all you need to do is talk to the blob, which is (as far as i am aware) free to distribute however you so choose.

is there any functionality, that micromite basic needs to use, within the RPi hardware  that is not accessible via the blob?

how would the performance of RPi + blob + MMbasic compare with the performance of H7 + MMbasic? bear in mind the massive memory and CPU resources available on even the lowest-end RPi.


cheers,
rob   :-)
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4033
Posted: 03:51pm 27 Jun 2020
Copy link to clipboard 
Print this post

So far as I can see, you can't do it that way unless you GPL the result.

Also, you would need to have the copyright owner's explicit permission to use & distribute the blob.  (The default with copyright is no permission at all.)

There has been talk of NDA(s) so I suspect it is an issue.

It may be an OK NDA and the owners may well grant permission.  Hopefully so.

On the non-copyright end of things (i.e. software) I've not looked due to the copyright problems which I wish not to face.

Benchmarks of picromite/CMM2 probably give some indication of (raw) performance.

John
Edited 2020-06-28 01:57 by JohnS
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2428
Posted: 04:26pm 27 Jun 2020
Copy link to clipboard 
Print this post

  JohnS said  So far as I can see, you can't do it that way unless you GPL the result.

Also, you would need to have the copyright owner's explicit permission to use & distribute the blob.  (The default with copyright is no permission at all.)

There has been talk of NDA(s) so I suspect it is an issue.

On the non-copyright end of things (i.e. software) I've not looked due to the copyright problems which I wish not to face.

Benchmarks of picromite/CMM2 probably give some indication of (raw) performance.

John


So far as I can see, you can't do it that way unless you GPL the result: why? the blob isn't GPL, and even if it was, the only requirement would be to release any changes you made to it - and no one is going to be making changes to it!

we are merely picking up a chunk of binary code (the blob), from a freely distributed source, and depositing it onto an SD card. next, we're picking up another chunk of binary code (a pre-compiled version of MMbasic from Geoff and/or Peter), and dropping it onto the same SD card. job done.

there is even open-source code out there, in the form of an application called "rpi-imager" https://github.com/raspberrypi/rpi-imager, that is capable of grabbing a copy the RPi image from the RPi foundation's servers. so we don't even need to distribute the blob ourselves, we can just use an existing program to uplift it - or create a RPi linux distro on an SD card and then delete the linux part from it (ie, leaving just the blob).


i'm afraid that i see the whole closed-source/NDA argument put up by many as simply a spurious excuse. there is no incompatibility between the applicable licences, and the blob is out there and free to be used (via the linux-facing side) by anyone who wishes.


the blob does the job, even when used just as broadcom intended.


cheers,
rob   :-)
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10194
Posted: 04:54pm 27 Jun 2020
Copy link to clipboard 
Print this post

  Quote  CMM2: Next steps?


The next steps for the CMM2 do not include anything to do with the Raspberry Pi
 
damos
Regular Member

Joined: 15/04/2016
Location: Australia
Posts: 74
Posted: 11:06pm 27 Jun 2020
Copy link to clipboard 
Print this post

  TassyJim said  PAUSE will take fractions.
begin = timer
pause 1
print timer - begin
'
begin = timer
pause 0.1
print timer - begin


DAC will let you produce arbitrary waveforms.

Just fill an array with whatever you require.

Jim


Thanks for that info Jim. Where in the manual does it describe how to create arbitrary waveforms? I can't see a specific command to play from an array. I was particularly wanting to pass an array to the play sound function with an array of data that it will repetitively play until told to stop, but would be happy with playing from a large array.

The timer routine is buggy. I works for times less than 1ms, but it is inaccurate above 1/650s.

dim f - 500
do
 play sound 11,L,S,f
 pause 1000/f
 play stop
 pause 1
loop

This plays a single period and then does 1 ms pause to it is easy to see what is going on.

If you look at this on an oscilloscope, it works perfectly for values of f above 650. Below 650Hz it chops the waveform as if it is rounding the pause down to the nearest ms.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6266
Posted: 11:13pm 27 Jun 2020
Copy link to clipboard 
Print this post

Look up the DAC command
  Quote  Sets up the DAC to create an arbitrary waveform. DAC1array%() and
optional DAC2array%() should contain numbers in the range 0-4095 to suit
the 12-bit DACs...

VK7JH
MMedit
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 12:13am 28 Jun 2020
Copy link to clipboard 
Print this post

Serial Mouse:

I would like to have one but not at the permanent cost of a serial COM port. Perhaps another OPTION?

OPTION COMnbr MOUSE ON|OFF or
OPTION MOUSE COMnbr ON|OFF

the COM port parameters could be set in the usual way

Return the pointer location by maybe:

MM.INFO(MHPOS)
MM.INFO(MVPOS)

Bill

PS I am aware of TassyJim's efforts using a PS2 mouse and Arduino and have used the Silicon Chip USB to serial mouse adaptor myself. Raros started it years ago with a real serial mouse. Now I see vegepete is using one also.

PPS Sorry for the repeat post but the first one was not responded to.
Keep safe. Live long and prosper.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1127
Posted: 02:08am 28 Jun 2020
Copy link to clipboard 
Print this post

I must say, a mouse is a joy to use, especially now that we can read the state of the [SHIFT] and [CTRL] keys.

The trouble is, ps/2 mice are easy (enough) to interface with but are becoming rare, and USB mice need either a chunk of USB stack code or more hardware. For example, look at this USB host board.
Visit Vegipete's *Mite Library for cool programs.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 02:31am 28 Jun 2020
Copy link to clipboard 
Print this post

  Quote  I must say, a mouse is a joy to use

I agree, this is the one I use. It uses a close relative of the Micromite (a 270) and can be programmed with the Microbridge.

Bill
Keep safe. Live long and prosper.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1127
Posted: 02:41am 28 Jun 2020
Copy link to clipboard 
Print this post

An entire PIC32MX270 to serve as a USB host controller? Yikes.

I'm watching Bitluni's USB host controller project for ideas. An interface with 2 USB ports, mouse and joystick/game controller, would be just the ticket. Perhaps linked by I2C.
Visit Vegipete's *Mite Library for cool programs.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 09:52am 28 Jun 2020
Copy link to clipboard 
Print this post

Good morning,

Can anything be done about the fact that the first parameter of RUN needs to be string literal and not a string variable ?

With this restriction in place if program A want to pass control to program B then program B has to be in a fixed location ... and you wouldn't even make SEARCH PATH a fixed location

In an earlier thread you pooh-poohed Jim's clever workaround of writing a temporary .BAS file containing the hardcoded RUN describing it thus: "This is a CATASTROPHICally bad idea and causes the flash to be re-written twice." So what is our alternative?

Incidentally how many writes is the CMM2 flash guaranteed for? My understanding is each time we RUN then unless the program currently stored in the flash is identical to the program we are RUNNing then the flash is overwritten. That means I could easily be rewriting the flash 50-100 times in an evening's development. If the flash is guaranteed for <ignoramus pulls figure from google>10,000 writes</ignoramus> then do I need to be lining up spare Waveshare boards like printer-cartridges?

Regards,

Tom
Edited 2020-06-28 19:54 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10194
Posted: 10:06am 28 Jun 2020
Copy link to clipboard 
Print this post

  Quote  Can anything be done about the fact that the first parameter of RUN needs to be string literal and not a string variable ?


No: the choice is between three options
string literal and MM.CMDLINE$
or variable and no MM.CMDLINE$
or no RUN without a filename and MM.CMDLINE$

There is no possible way of parsing and getting all three
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 10:30am 28 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  There is no possible way of parsing and getting all three


I know your reserved about the details, but I'm going to ask "Why?"

1. Tokenize the statement.
2. All tokens after RUN and up to the first comma (unless that comment is enclosed in quotes) are evaluated as a string expression used to determine the file to RUN.
3. Everything after that first comma token is passed verbatim to MM.CMDLINE$

Edit 1: OK, not quite so trivial, but IMO still doable as you need to handle someone deciding that they want to use a string expression involving a multi-dimensional array or a function call with more than 1 parameter as these add additional commas ...

Edit 2: If it helps then *I believe* I can write this code in BASIC since I've already built a tokenizer. If you want it in C then that will take me a bit longer. Unless that is there are limitations outide of parsing that you've not expounded upon.

Regards,

Tom
Edited 2020-06-28 20:46 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10194
Posted: 10:51am 28 Jun 2020
Copy link to clipboard 
Print this post

  Quote  but I'm going to ask "Why?"


Because on this one I'm simply not going to spend more time and effort for a limited use case
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 10:58am 28 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  but I'm going to ask "Why?"


Because on this one I'm simply not going to spend more time and effort for a limited use case


Fair enough.

Could you please comment on my question about flash rewriting ?

- Have I got the essential details correct ?
- Do we potentially have the Tesla problem ?
- I recognise I'm not a hardware guy and might be talking complete sh*t.

One of the reasons I'm concerned is that my proposal for a utility that manages the contents of SEARCH PATH and creates "links" between files in there and the actual implementations means an additional flash write for an execution and I don't want to be responsible for people's Waveshares wearing out.

Regards,

Tom
Edited 2020-06-28 21:09 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10194
Posted: 11:09am 28 Jun 2020
Copy link to clipboard 
Print this post

Minimum guaranteed flash endurance is 10,000 writes. I don't suppose anyone will get near the number I've done in development and I haven't hit an issue
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 11:25am 28 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  Minimum guaranteed flash endurance is 10,000 writes. I don't suppose anyone will get near the number I've done in development and I haven't hit an issue


Thank you.

10,000 / 50 = 200 days

... hmm, I'm still a little concerned. I think maybe I'll buy a spare ;-)

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4033
Posted: 02:49pm 28 Jun 2020
Copy link to clipboard 
Print this post

  robert.rozee said  
  JohnS said  So far as I can see, you can't do it that way unless you GPL the result.

Also, you would need to have the copyright owner's explicit permission to use & distribute the blob.  (The default with copyright is no permission at all.)

There has been talk of NDA(s) so I suspect it is an issue.

On the non-copyright end of things (i.e. software) I've not looked due to the copyright problems which I wish not to face.

Benchmarks of picromite/CMM2 probably give some indication of (raw) performance.

John


So far as I can see, you can't do it that way unless you GPL the result: why? the blob isn't GPL, and even if it was, the only requirement would be to release any changes you made to it - and no one is going to be making changes to it!

I replied to your post about using the Linux source code to figure out how to use the blob.  Doing that opens you to GPL.  To avoid it you'd have to do it the "clean room" way used e.g. to create a non-copyright-infringing IBM PC BIOS.

If you're confident, though, just do it :)

It may well be that in practice no-one will care, especially as the number of potentially infringing copies would be very low.

However, the RPi strikes me as a poor choice due to its very limited I/O.  Also, its rather high power usage.

John
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 03:11pm 28 Jun 2020
Copy link to clipboard 
Print this post

  JohnS said  However, the RPi strikes me as a poor choice ...


Not that I'm terribly familiar with it, but what do you hope to gain that you wouldn't get running RISC OS on the Pi? That boots almost instantaneously and has a powerful BASIC with O/S level integration a couple of key presses away. It even comes with a community of ardent devotees.

Regards, Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2428
Posted: 03:12pm 28 Jun 2020
Copy link to clipboard 
Print this post

  JohnS said  
However, the RPi strikes me as a poor choice due to its very limited I/O.  Also, its rather high power usage.
John


i'd have to agree on that - there is limited I/O, and the newer ones are starting to get up there with their power consumption. the RPi 4 is no better than a low-end laptop in many regards. plus, it would not be an easy programming task, certainly not something i could be bothered with myself!

the pluses of the RPi that i've always seen for ANY project are:
1. it is CHEAP, especially for a RPi zero or A+;
2. it has HDMI socket soldered to the PCB, which is increasingly becoming a necessity;
3. 256mb is heaps of onboard RAM for a basic or a BASIC computer;
4. the 'early' ones could be configured for relatively low power consumption.

having said that, the CMM2 is a wonderful bit of kit, a major draw being that people can solder it together themselves. there are far too few things these days that you can build yourself!


cheers,
rob   :-)
 
     Page 4 of 8    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025