Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:46 12 May 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 : HDMI output from MM2/MM+: interesting?

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10070
Posted: 10:56am 05 Oct 2018
Copy link to clipboard 
Print this post










Using MMBasic running on Pi-Zero as an HDMI I/F for a MM2.
A loadable CFunction display driver on the MM2 (running completely standard MMBasic) communicates over a 4-bit parallel I/F to the Pi-Zero. This is also running MMBasic with a new feature OPTION REMOTE ENABLE which tells it to listen on the 4-bit port for graphics commands.

Surprising, the Pi is very poor at acting as a slave device and receiving high volume data but using the 4-bit i/f I'm getting a reasonable throughput.

Reliability isn't there yet as the Pi seems to crash out of MMBasic after 5 minutes or so but this could just be a wiring issue.
Edited by matherp 2018-10-06
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9493
Posted: 11:20am 05 Oct 2018
Copy link to clipboard 
Print this post

You don't rest for long before coming up with something else, do you?

This is neat. But if you had to have an HDMI output for your MM, surely there are HDMI host chips that can be had these days?

Perhaps not. I know HDMI licensing is a little complicated.
Smoke makes things work. When the smoke gets out, it stops!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10070
Posted: 11:32am 05 Oct 2018
Copy link to clipboard 
Print this post

  Quote  surely there are HDMI host chips that can be had these days?


Possibly, but you also need a framebuffer, a PCB layout, build and debug etc.....

A Pi-Zero does all this for you for a fraction of the price
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9493
Posted: 11:36am 05 Oct 2018
Copy link to clipboard 
Print this post

Yes, good point.
Smoke makes things work. When the smoke gets out, it stops!
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 03:14pm 05 Oct 2018
Copy link to clipboard 
Print this post





very good idea




 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3999
Posted: 04:39pm 05 Oct 2018
Copy link to clipboard 
Print this post

Are you in effect bit-banging at the Pi end?

Either way, roughly what sort of throughput (*) can you reliably get?

Probably some follow-up questions/ideas depending on the above...

(*) not sure what units make sense: 4-bit transfers per second? MB/s?

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10070
Posted: 06:06pm 05 Oct 2018
Copy link to clipboard 
Print this post

Are you in effect bit-banging at the Pi end?


Nibble banging

  Quote  Either way, roughly what sort of throughput (*) can you reliably get?


A 14 byte message takes 75 micro-seconds so 187Kbytes/second when active
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3999
Posted: 06:52pm 05 Oct 2018
Copy link to clipboard 
Print this post

Thanks.

Would it be better to use an ordinary channel - UART, or whatever?

That way Linux already has a device driver and there may be hardware buffering so overall better throughput / less CPU load.

Does depend on what the MMS/MM+ has available as well as what the RPi has...

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10070
Posted: 07:03pm 05 Oct 2018
Copy link to clipboard 
Print this post

  Quote  Would it be better to use an ordinary channel - UART, or whatever?


UART is no good as the "proper" UART on Pi's with Wifi is used for Bluetooth. The other one has a baudrate that varies with CPU clock speed (very useful - not)

SPI would be the obvious one but no-one has ever got a Pi to work in SPI slave mode. This uses some "special" I/F H/W (bsc)

I2C too slow and uses the same I/F as SPI, does work sort of but not reliable.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3999
Posted: 08:47pm 05 Oct 2018
Copy link to clipboard 
Print this post

Oh.

Sorry, was just a thought.

Er, do you change the CPU clock speed often?

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10070
Posted: 09:38pm 05 Oct 2018
Copy link to clipboard 
Print this post

  Quote  Er, do you change the CPU clock speed often?


I don't but Rasbian does it behind your back in response to thermal /load etc.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 06:09am 06 Oct 2018
Copy link to clipboard 
Print this post

Use a 1455 as a Serial/SPI/Parallel input at the mm side and USB CDC or HID at the Pi side and get a pretty high throughput.

You could use that also to create a 'window' on a windows/Linux machine that can act as a remote screen. (Got that working already, but it is not open source as it is made for a client so can not share).


Microblocks. Build with logic.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3999
Posted: 06:36am 06 Oct 2018
Copy link to clipboard 
Print this post

I wonder if any USB uart would let the RPi do better throughput?

If the MM has a uart free.

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10070
Posted: 07:20am 06 Oct 2018
Copy link to clipboard 
Print this post

  Quote  I wonder if any USB uart would let the RPi do better throughput?

  Quote  Use a 1455 as a Serial/SPI/Parallel input at the mm side and USB CDC or HID at the Pi side and get a pretty high throughput.


I'm getting 1.5Mbits/second already so probably outside UART capability
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3999
Posted: 11:50am 06 Oct 2018
Copy link to clipboard 
Print this post

I've run uarts faster.

Might it reduce the CPU load and/or provide better buffering?

Still, it sounds good enough already if it's reliable and predictable.

John
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2927
Posted: 05:13pm 06 Oct 2018
Copy link to clipboard 
Print this post

Hi Peter,

Am I correct in assuming that the 'source MM' can only output graphics to the 'slave Pi-MM' i.e. it can not also drive another TFT such as an ILI9341?

Any chance of a video of GUI TEST LCDPANEL to see the 'smoothness' FULLY understanding this is work in progress (and excellent work too!)

Thanks.


WW
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10070
Posted: 06:01pm 06 Oct 2018
Copy link to clipboard 
Print this post

  Quote  Am I correct in assuming that the 'source MM' can only output graphics to the 'slave Pi-MM' i.e. it can not also drive another TFT such as an ILI9341?


Yes, of course. The code on the MM2 is a normal loadable display driver and you can only have one driver at a time

Video here

Note circles are worst case for the I/F as each pixel on edge of the circle takes an 18 byte message, exactly the same as a clear screen command.

So
timer=0:circle 200,200,100,,,rgb(red),rgb(blue):?timer


gives 155mSec but

timer=0:box 100,100,200,200,,rgb(red),rgb(blue):?timer


is 11msec

Remember, of course, this is a 800x480 display being driven by a 28-pin MM2 at 40MHz

Edited by matherp 2018-10-08
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2140
Posted: 08:43pm 06 Oct 2018
Copy link to clipboard 
Print this post

so the Pi is acting as a graphics terminal, albeit with custom interface?
 
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