When we first saw the Raspberry Pi Pico and its RP2040 microcontroller last month it was obvious that to be more than just yet another ARM chip it needed something special, and that appeared to be present in the form of its onboard PIO peripherals. We were eagerly awaiting how the community might use them to push the RP2040 capabilities beyond their advertised limits. Now [Luke Wren] provides us with an example, as he pushes an RP2040 to produce a DVI signal suitable to drive an HDMI monitor.
It shouldn’t be a surprise that the chip can be overclocked, however it’s impressive to find that it can reach the 252 MHz necessary to generate the DVI timing. With appropriate terminations it proved possible for the GPIO lines to mimic the differential signalling required by the spec. A PCB with the RP2040 and an HDMI socket was created, also providing a couple of PMOD connectors for expansion. All code and software can be found in a GitHub repository.
The result is a usable DVI output which though it is a relatively low resolution 640×480 pixels at 60 Hz is still a major advance over the usual composite video provided by microcontroller projects. With composite support on monitors becoming a legacy item it’s a welcome sight to see an accessible path to an HDMI or DVI output without using an FPGA.
Thanks [BaldPower] for the tip.
66 thoughts on “Bitbanged DVI On A Raspberry Pi RP2040 Microcontroller”
If only they sold them for the same price in the country they were made as in the rest of the world.
What do you mean, care to elaborate please?
We pay a heck of a lot more for the same things here in the UK… Raspberry Pi Foundation is based here in Cambridge…
They’re literally £3.60..
You’re shopping on the wrong sites. Go to the Raspberry Pi foundation’s site and from there go to their recommended suppliers for your country. Amazon is not your friend here.
Srsly I wouldn’t consider Amazon friendly in any way.
Definitely this – for small, cheap electronics like this its like amazon has a minimum price almost. You probably won’t get it as fast, but it will be cheap and you’ll be supporing RPi
They were manufactured in Japan as far as I know.
The Pico is, I think, currently made by Sony in Japan (not Wales)? They are £3.60 from UK supplier Pimoroni?
Ugh. They are made by Sony? I didn’t want to know that! Next you will be telling me what’s inside a hotdog.
Ratchet and/or Clank, depending on if it’s Kosher
Lol. so, Myanmar? Or Taiwan?
Where is everyone sourcing just the IC? I want to just buy the RP2040 without the board so I can roll my own.
[Luke Wren] works for the Raspberry Pi foundation
Well that makes sense then.
They should be available somewhere in the Q2 2021.
You mistake this toy (albeit with a large marketing budget) for a product. Products are buyable in 100ku. Toys are not
There’s a huge supply chain problem in silicon at the moment. Try and buy the latest Xilinx FPGA in qty 100k, it’s certainly not a toy but good luck getting those volumes
Tell that to Mattel. If you’re qualified to issue 100ku POs, they’ll fulfill them.
And there are many products for which the market would saturate far below 100 ku. Very large diesel engines for supertankers and advanced semiconductor photolithography projectors both come to mind…
If, however, you’re trying to denigrate this microcontroller by labeling it a ‘toy’… perhaps you’re merely outside Hackaday’s marketing demographic?
The rpi zero is still only available in single qty from most suppliers.
So just who is playing games with their toys ?
RS are selling reels of 480 due for dispatch at the start of March. I probably don’t have the right price showing as it’s more expensive per unit for the bare RP2040 than other retailers sell the retail board for.
RPi foundation do a great job producing dev boards. It would be nice to be able to buy the RP2040 as a microcontroller though
“The current timeline has RP2040 available to buy sometime in Q2 this year.”
(ref: https://www.raspberrypi.org/blog/keeping-secrets-and-writing-about-raspberry-silicon/#comment-1551214 )
Seems like you could make an MDA/Hercules->SVGA adapter from this. If it can run 640x480xRGB565, then it should be able to run 720x348x1. It might even be able to run it at 800x600xRGB332, if you could bring the clock could up to about 315MHz, and if there’s a little ram left. That could make a nice adapter to convert old videocard’s RGBI to SVGA.
They have already overclocked it from 133MHz to 252MHz (189% of nominal), 315MHz (237% of nominal) would probably need some major cooling to stop the tiny pieces of silicon from melting (0.0066 mm2 per m0+ core).
(ref: https://developer.arm.com/ip-products/processors/cortex-m/cortex-m0-plus )
Isn’t the stock clock 48Mhz and the 133MHz already an overclock?
Nope, it’s a dual-core Cortex @ 133 MHz.
Just insanely capable. I mean, I’ll be *shocked* if the actual microcontroller’s $4 when it’s available, but what with the ESPxxx being obscenely cheap my entire idea of what’s possible in the under-$5 space is just broken nowadays (if *only* it had the possibility for higher-speed USB…).
Yeah, the processing power you can get for less than $10 is mind blowing. Desktop CPUs are better value, but they are also expensive so it seems less impressive.
And the ESP32 Wrover chips with 8MB of RAM are $4.50 CANADIAN. It’s nuts.
And the Pi0 for $7.50 CAD is also damn impressive.
Depending on what you need or want, a dedicated USB 3 peripheral chip might suffice. The RP2040 can almost certainly supply the desired device functionality.
If you click through to the Github repo you’ll see some pictures of it running at 372 MHz to do 720p30
Are you already aware of https://github.com/hoglet67/RGBtoHDMI/wiki ?
Every time I look at the RP2040’s specs, I just want to cry. High speed core: awesome. Programmable interfaces: super-great. On board USB? Fantas… wait, what? Full-speed USB? Like… “slower than a decent UART” USB?
I just imagine it (and the PSoC 6) like hooking up a supercomputer cluster to a freaking dial-up modem.
Literally! Gigabit data output through the PIOs… and an 11 Mbps (half-duplex!) interface to a computer. *bangs head on desk*
Bitbang USB through the PIO ?
USB 2 requires extensive on chip hardware support, can’t expect miracles with first silicon from a new vendor. Modulate your expectations and your head wound will heal
I know, I know. The problem is that there’s such a massive jump from USB full speed to high speed throughput. Theoretically it’s nearly a freaking factor of 100 in throughput difference.
And pretty much the only player in the “~10 MB/s throughput to nearly arbitrary interface + smarts” space is like, the Cypress FX2, and it’s expensive, quirky as hell, and has huge reliability issues (enough so that I won’t use them again).
I mean, an FT2232 + low-cost FPGA with a softcore running on it is actually a good option, but then you’ve got to convince people “no, it’s fine, instead of using a nice simple IDE it’s OK to use a cooked-up SoC with documentation I wrote over the weekend.” So I usually end up with an FT2232HQ, an onboard microcontroller for the smarts, and a larger FPGA for the interface. Which is just… a mess.
ST has some parts with integrated HS PHY, and many more where you can connect one via ULPI. A HS PHY has very large driver transistors that take significant die space. Probably not too many non-bridge (USB to ethernet, USB to sata, USB audio, …) applications need the speed to make that worthwhile. The FX2 is also mostly a USB fifo…
For fpga I just attach an external phy to it. It costs 1 euro… There are many USB cores on the internet that work well.
“ST has some parts with integrated HS PHY”
Yes… but no programmable IO. Those chips have the *opposite* problem – a firehose of a connection and only limited ways to generate that data (I mean, kindof. Obviously they’ve got a slew of comms interfaces, but they really might as well be tinkertoys compared to the PIOs).
“For fpga I just attach an external phy to it. It costs 1 euro… There are many USB cores on the internet that work well.”
Yes, but USB inside the FPGA means you can’t program/debug it via USB. I mean… you *kinda* can, indirectly, if you have like a golden image/etc. thing. But an FT2232HQ’s just a few bucks and you’ve instantly got combination high data throughput + no need for a debugger/programmer.
PS this is a good chip with onboard usb hs: https://www.nuvoton.com/products/microcontrollers/arm-cortex-m4-mcus/m484-usb-hs-otg-series/?__locale=en
Even full speed USB is 12Mbit/sec, I’d love to know where you can find a UART running at that speed. It’s part of a 4$ microcontroller dev board. You want faster than that? Buy a Pi Zero instead, for a whole extra $. Ye gods, the entitlement of some folks.
“I’d love to know where you can find a UART running at that speed.”
Uh… every single FT2232HQ on my desk? And it’s full duplex! Halfway decent microcontrollers should have at least 4 Mbaud as well, and even 4 Mbaud full duplex with only 25% overhead-ish should easily challenge USB’s overhead.
“You want faster than that? Buy a Pi Zero instead, for a whole extra $.”
Wait, the Pi Zero has programmable I/Os capable of doing 100+ Mbit/s input/output? How have I missed this?
Last I checked 1920×1080 VGA/DPI over GPIO with VGA-Hat was doing 100+ Mbit/s output…
I have no idea how fast input can be, but likely about the same..
That’s hardcoded though… Built into the Broadcom silicon – it’s not something you can repurpose
PIC32MX will do 12Mbaud
It’s meant to be a microcontroller, not a computer. It’s supposed to flash some LEDs, read some sensors and maybe even turn some motors on and off. What are you going to do with faster USB?
Move or take data to/from a real computer?
Its not got enough memory of any sort on board to take noticeable to human scale time to empty or write it all (and you probably have to wait on the storage device not the usb link)…
And saturating that USB link with sensor output (or any other meaningful output the chip could create) would be really quite challenging.. Certainly possible, but seriously its not the point of the chip!
Wait, you think it’d be hard to saturate a link that maxes out at ~1 MB/s total throughput with a 133 MHz processor and 200+ kB of RAM? I could’ve done that 20 years ago with a processor 1/4 the speed!
Or did you mean you wouldn’t be able to saturate a high-speed link? Sure, obviously not. But there’s a factor of 100 gap between USB full speed and high speed, and the PIOs generate and consume data at or beyond USB full speed.
“Certainly possible, but seriously its not the point of the chip!”
It’s not the point of a microcontroller to be able to interface with devices and output that data efficiently?
Really, I get that it’s first silicon, and obviously it’s $4. But it’s essentially “cheaper/better PSoC” – USB 2.0 (even as a higher device option – which please please please let it be coming) would turn it into “OK never think about a PSoC again.”
Absolutely not the point of the chip. Pat what exactly do you think the use case is here for needing a gigabit connection out of this chip? And yeah of course you CAN saturate it but that doesn’t mean it is likely. This is a chip meant for running little led displays and shit, not for collecting and and transmitting huge swaths of data. You wouldn’t buy a Ferrari then complain it can’t pull a trailer even though it technically has the horsepower for it.
“Absolutely not the point of the chip. Pat what exactly do you think the use case is here for needing a gigabit connection out of this chip?”
Who said anything about a gigabit connection?! It’s got a *12 Mbit connection*. Of *course* you can saturate that!
Fundamentally, the chip’s very similar to a PSoC, which *also* only has USB full speed, and people (obv. including me) have been crowing about wanting a PSoC with USB high speed for *years*.
“This is a chip meant for running little led displays and shit, not for collecting and and transmitting huge swaths of data.”
Great! So you don’t think I can max out a 12 Mbit/s link for a giant LED array? Of *course* you can!
Yes, of course you can glom on additional hardware to get higher throughput. Duh. It’s just a shame that there’s a nice USB controller sitting there that’s chained to a tin can on a string, when there are these high-speed programmable IOs that could’ve been leveraged.
“Who said anything about a gigabit connection?! It’s got a *12 Mbit connection*. Of *course* you can saturate that!”
You’re the one who brought up gigabit speeds in the first place…
“Literally! Gigabit data output through the PIOs… and an 11 Mbps (half-duplex!) interface to a computer. *bangs head on desk*”
“Great! So you don’t think I can max out a 12 Mbit/s link for a giant LED array? Of *course* you can!”
No, I said LED array. Not “giant” LED array. Why would I use a $4 Pi for a giant array? I wouldn’t. Here’s a question, can you complain pointlessly about how a board is not capable of doing things it was not designed to do? Of *course* you can!
At the end of the day this is $4 pi is a technological marvel that drastically exceeds the requirements it aims to meet for hobbyists looking for a cheap powerful board for small projects. That’s all the damn thing is stop pretending it’s for industrial applications needing high speed IO. If there’s a better chip for YOUR application you should use that. Some of us are overjoyed at the Pico’s abilities.
Alright, certainly I was less clear than I’d hope by your response Pat.. I figured it was kinda obvious I meant useful/meaningful use for a pico that needs more USB speed..
Sure you can do it, but its challenging to find a use-case for which the pico is at all the right choice that needs faster USB connection.
Everyone that wants to use the RP2040 for the dinky little LED projects can just go back to Arduino.
You can flash LEDs, read sensors and control motors (and even bit-bang low-speed USB) using a 12 MHz chip if you’re not wasteful with your programming environment. Possibly even less, but those cheaper low-performance chips are hard enough to obtain and work with that chasing them doesn’t seem to make sense for a hobby project.
This thing, on the other hand, can run something like a hobby logic analyzer or oscilloscope; an MP3 player or a GSM feature phone is not out of the question either—and these are all nominally microcontroller applications. Hell, it seems powerful enough computation-wise to make a decent SysV or Win95 machine (though I think the lack of an efficient external memory interface means you couldn’t actually use it for this class of problems).
Well, using the PIO you could easily (if you are an assembler programmer, that’s it) obtain a 40Mbit/s UART (with three sampling points) and parallel 8 of them to have a custom 40MB/s channel (that would be monodirectional and about 18MB/s bidirectional, impressive enought, I’d say.
Ah, and more than that can be obtained if the chip will be overclocked.
Or just use 16 pins and make simple parallel 16bit interface. I’m working on using that for making simple 60fps game console with some tft lcd screens. That pio peripherial is just unreal. Maybe someone will actually interface a real gigabit ethernet phy to this.Or use usb3300 usb2 phy. It only needs 60mhz clock, 8 data lines and 4 control lines.
“Or use usb3300 usb2 phy. It only needs 60mhz clock, 8 data lines and 4 control lines.”
Yeah, that’s the same thing I was thinking when I first saw the full-speed limitation. I really do get “first silicon” but it would’ve been *really* nice to have something like the TM4C1294 has: an internal full-speed PHY with a ULPI interface option.
Maybe with the PIOs you can do something similar. Not sure. If you could that’d be super-cool.
Yes, but then I need a way to hook that custom weird interface up to a computer! So now I looking for a USBweird interface chip… and I’ve circled back to the original problem. :)
You are right but forget to take in consideration that not all computers are PC. For example that would be doable for a Beaglebone, so that you will obtain a desktop pc with an high speed Pi interface.
Look, I am not saying that you are wrong but that the bottleneck is more on the PC side of things. Obviously, if your only interface is USB 2.0 you want it on the processor but there are many solutions aside of having it on the micro, the first that comes to mind is the FT313H – Hi-Speed Host Controller; using it will give a 18MHz 16-bit R/W interface with just the USB line and a few passives and small enough to fit in the USB cable itself, that should be a pinch to implement using the PIOs.
Also, the usb3300 seems worth more than a look, I have enough toys but who knows…
“Look, I am not saying that you are wrong but that the bottleneck is more on the PC side of things.”
Why yes, the fact that modern PCs essentially only have USB is a bottleneck of sorts, but it’s also a massive convenience that the entire computer industry’s settled on.
“FT313H – Hi-Speed Host Controller; using it will give a 18MHz 16-bit R/W interface”
The FT313H’s a *host* controller, not *device* side. But yeah, I *can* do it. Any FTDI chip would work fine, you can push 30 MB/s through those trivially. But now the USB descriptors/etc. are set for you, and you can’t do things dynamically with the microcontroller like you could if it’s all onboard. And plus you’d likely need to implement some sort of bootloader on your own as well. And a PHY-only chip like the USB3300’s definitely doable but of course it requires the USB stuff in software, which doesn’t exist as far as I can tell.
Again I’m not saying you can’t *get* a firehose of data out of the thing. Obviously you can – but given that they already have so much of the USB interface *on* the chip it’s just a bit sad that it wasn’t more fully integrated with a higher-speed output, even if it needed to be off-chip through a PHY.
It’s really, really easy to understand the frustration looking at similar performance (not price) chips: the 120+ MHz Cortex-M4 scale chips (STM32s, Tiva C, etc.). They *frequently* have USB high speed via an external ULPI interface. Obviously these are a fair amount cheaper and have the *really* interesting PIO interface. Which is why they would’ve been market-breakers with that interface.
You soon may be able to use these PIOs with the SOC of your choice…
I mean… it’s a $4.00 hobby board. If you don’t like it buy a different one. Many of use are still very excited about our new dev boards.
There are better microcontrollers if you want DVI/HDMI.
But it is a proof of concept that it is quite capable of overclocking.
What microcontrollers support HDMI or DVI output? (genuine question). Any near the $1/ea price point?
The SMI? for output https://iosoft.blog/2020/07/16/raspberry-pi-smi/ or input http://tuxbabe.eu/raspalyzer.html
It seems awesome but poorly documented. If someone can make an example to replace a cypress fx2 where there are no gaps in the signal at full speed there are a ton of neat things that could be done with it.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)