convert two analogue pulses (5000/second) for display on HDMI or Composite Video

Started by charliecoutas, Jun 29, 2026, 01:19 PM

Previous topic - Next topic

JonW

I did have a look, and nothing like this exists; there are PC-based emulators, but no true hardware emulators with HDMI. I'm not sure how many I would sell for the effort, and I would have to make it secure so I didn't get ripped off. I would have to design a new FPGA board without using the Sipeed development board, as programming the onboard flash is VERY hit-or-miss due to the poor Chinese-made/copy FTDI device, which misses commands and has terrible JTAG timing.  Plus, the Gowin parts are not easy to get hold of at a low price; I will check, though.

I have just knocked out a quick 27Q43 dev board this morning. I am using this part in more projects, so I thought it's probably worth doing one. It should connect directly to the FPGA, as with an SPI OLED; with the inbuilt VHDL SPI test sequence, the OLED should image the HDMI without an MCU present; a great way of proving if I have captured the full SD1306 command set.  Whacked on an encoder (with caps this time).  Hmm, maybe I should have done an Alps joystick...

Once I have them, I'll send you the Dev and a programmed FPGA, so you can do some funky code on a large screen!

charliecoutas

That's brilliant Jon, well done indeed.

Why two channels? Was a question: The scope on Colossus at the moment shows the sprocket hole signal plus one data track. The lad who thought he was good at Python has shown that he isn't. So guess who's been up until all hours trying to get it working?

Micropython is not part of my DNA so I have been struggling but I have got something going on a little Pico2. The amount of code is massive. One clever thing about the processor used on the Pico is that it has four State Machines. These can be programmed in their own right (to generate vertical and horizontal syncs or whatever you like) and they don't affect the main processor at all. So timing is not a problem once you've worked out how to do it.

I have also made a front-end which will connect to Colossus. It monitors the data bits as they leave the tape reader, and surprisingly, they are around 5 volts high. But they are negative going from zero so I have converted this to positive going pulses. The sprocket fires an interrupt in the 18F46K22 which manages a ring-buffer and sends 20-byte samples to the VGA display every 5 seconds.

So it's coming along nicely. I haven't been on the forum for a few days as I have been getting depressed over my attempts at writing Micopython. But the sun is out and I am feeling positive again.

The original idea of making a VGA screen behave like a scope was replaced with an analysis of the data and a picture of the data itself.

Will report back soon.

Charlie

JonW

The Pico is decent, and MicroPython is very efficient due to the libraries. I have a few projects done for the RP2354A that has protected internal flash.  The PIOs are a marvel, really something that should be on many MCUs.  If you want to use the HDMI emulator, let me know.  I need to test it a little more, but you should be able to program the SSD1306 OLED and connect the hardware to any HDMI monitor in the project with no changes to the code.

J


charliecoutas

I might take you up on the HDMI emulator Jon, as VGA screens will become rare before long.

Charlie

JonW


charliecoutas

Jon, I hadn't realised that you did the HDMI for us (Bletchley). How Very Kind of you. Yes, let's do it.......

Charlie

See_Mos

The major problem that I come across with VGA screens is the backlight tubes have worn out.  Conversion to LED backlight is fairly easy but not normally viable except for the industrial monitors that I do.  The LED and driver kits are very cheap.

charliecoutas

Do LED VGA screens suffer screen-burn? This will running for long periods so I might just build in a PIR detector and blank the screen when nobody is about. For some reason long forgotten I have a couple of ZILOG detectors. Was that the same ZILOG that made the Z80's etc?

Charlie

See_Mos

I have seen  ghosting on screens that have been on 24 hors a day for weeks on end.  LED backlights will fade over time if kept at full brightness just like any other LED's so blanking or having the monitor on a timer is a good idea.

JonW

I have managed to get the binary file into the Emb Flash now and test with a SSD1306, it all works well with the connected SSD1306 "real screen" and the HDMI mirroring together now.  As the hardware fully emulates the SSD1306, blanking is trivial, a single command can do this, add a  sensor to the PIC side to blank the screen or even have a screen saver.  One issue with the Tang 9k dev boards Sipeed did, is that you can get back-powering from the HMDI cable and if power to the Dev board is applied after the HDMI, then it wont boot.  In addition the LVDS is not spec compliant to the HDMI standard as the LVDS is low level..  I think i will design a dedicated FPGA dev board with external Jtag, 2 USB for two USB 1.1 devices, (mouse and keyboard etc), SSD1306 port and use a AC coupled HDMI re-transmit IC, this will fix the back powering and be fully compliant with all HDMI monitors and have the ability to drive a screen at a distance with ease.

charliecoutas

That's very good Jon. Do you want to send me something to try, or wait until you get a bit further?
I have got the Raspberry Pi Pico running driving a VGA screen. I have no fingernails or hair left.

I put a movement-detector in to save the screen.

"Back powering" caused much head-scratching at the museum: the signals from the Colossus tape reader were enough to raise the as-yet-unpowered Pico and 18F46K22 such that they never got going. Fixed that.

Charlie

JonW

I have started to document it for you. Even if you don't use it this run, I am sure you can bring it up pretty quickly.  I don't want ot provide you with something that is going to cause you more stress and is a right B-Hole to get running and debug.

In the interim, I can send you the 27Q43 Dev when it arrives, and a programmed FPGA dev board (with the backfeed issue), loaded with some reference code and docs, to have a play with at home or in the office.  It will include the tape-and-sprocket demo. It can be stopped and started with a push button, so you could have this triggered by the tape motor button, etc. When it runs/stops, you see an emulated Tape on the TV, and won't need an MCU at all.  Then do an upgrade.  I did buy a cheap HDMI retransmitter; however, the backfeed still exists; it will be easier to reset as it's powered by USB and will be compliant with HDMI, well maybe not, as it was only £15 off Amazon; (hmm, we can say close to compliant)

I'll take a look and see if I can pop an isolated ADC on the new FPGA board or spin another 27Q + FPGA + Isolated multichannel ADC and I/O + HDMI retransmit.  This would then give you a PIC/POSITRON-adaptable, single isolated HDMI module that you can use for any exhibit.  I can provide all the docs and binaries so you can order this directly from JLC.  We can sort something out :-).  I can then pop over and see it all in action.

Maybe Les can do a PIC18F Enigma decoder on the SSD1306 and show 1940's computing versus 2026 single PIC..  Sell the compiler and John's dev boards in the shop as a kit.

Keep going, it's all fun!

charliecoutas

Yikes Jon!!  You are doing so much and it is much appreciated. You said "...HDMI module that you can use for any exhibit."  Yes, I hadn't considered that. There is the forerunner to Colossus which is called Heath Robinson. It has two paper tapes and a nice display would go well there too.

We don't have anything to do with Enigma, that is another department and we don't interbreed.

Looking forward to getting your stuff going.

Charlie

JonW

HAHA. No problem.  I am sure you can make a lot of interactive stuff on HDMI

J

charliecoutas

Certainly can.

I forgot to say that you and/or any of the forum members are always welcome to the museum. I am normally only there on non-bank-holiday Mondays but if you want to come let me know. Mondays are Closed To The Public days where we muck about and mend things. It's surprising what force a hand can exert on a volume control! Even using defensive methods and people still manage to break things.

Charlie

JonW

Hi Charlie

Here is a Vid of the working display, FPGA only, no MCU.  The SSD1306 is also attached, and you can see that, once reset, it configures the HDMI and displays a test card at 640 x 480.  The SSD1306 is upscaled to fit the width nicely, but there was some wasted dead space at the Top and bottom and plenty of LUT and BRAM on the FPGA, so I tweaked it a bit more, as you do...

I have added some secret commands to the SSD command set to change the colour of the main SSD1306 in HDMI and a mechanism to add 32 characters (user-defined) to the Top and bottom dead space.  I currently have this programmed to appear by default; however, it can be written to by new Ex. Commands, including a different colour for Top, Main, and Bottom.  Thus you can easily write the dead space and have the full main screen to mess around with (as a normal SSD1306) without changing the dead space text. 

The built-in Demo is a real SSD1306-compatible SPI data stream pushing out the tape demo; you can also see a Real SSD1306 working, scrolling HDMI, outputting a simulation of a Colossus Tape. The demo will only appear on keypress and will conflict with any attached MCU, as they share the pins. If driven by an MCU, don't push the button; I can remove it if needed. It's a great debugging feature and a good way to test the Verilog without coding an MCU.  Therefore, only push the demo button if nothing is connected or if an SSD1306 is also connected.

EDIT:  The top and bottom areas would be great fixed text or live data area without impacting the main SSD1306.  Can feel the old Star Wars vector game coming on, with score area HMMMM...  (No, No, No can't tangent off course now haha).

This is a £12/$15 9k LUT FPGA with DSP blocks, PLL, BRAM, Embedded flash, built and working, free open-source toolchains (Yosys not as good as Gowin TC but works).  Fit a custom RISC-V MCU + Code on it too.  55nm TSMC chip!  Not some crappy foundry. 



CPR


RGV250

Hi Jon,
Is it an optical illusion, the LCD seems to scroll left to right where the main screen scrolls right to left. Or an I just imagining it?

Bob

charliecoutas

My oh my Jon! That's great. How far are you from Bletchley? We MUST HAVE that paper tape simulation at the very least. Today wasn't going too well but you've changed that!

Charlie

JonW

Quote from: RGV250 on Today at 04:44 PMHi Jon,
Is it an optical illusion, the LCD seems to scroll left to right where the main screen scrolls right to left. Or an I just imagining it?

Bob

Well spotted, 1306 Screen upside down, Bob, yet the test is right..., I turned it over and propped it up; wires broke, did it again and blew one up. So it stays as is :-).  It doesn't matter from an SSD1306 perspective, since it's just GDDRAM per frame. It can go any direction.  It will invert, though, as SSD, or should.  I need to wait for the 27Q43, as I have a really compact library in CCS C written, and it's a breeze to port in CCS C. I am busy on some new SDR designs, so I want to be efficient with time.  Wait for LES to do SSD1306 Lib.............