Home Arduino Shows We Love Hacking: Parallel RGB

Shows We Love Hacking: Parallel RGB

0
Shows We Love Hacking: Parallel RGB

[ad_1]

You may need seen outdated show panels, from 3″ to 10″, with 40-pin FFC connectors the place each pin appears to be used for some knowledge sign. We name these shows parallel RGB, or TTL RGB, or DPI, and you will discover them in higher-power MCU, Raspberry Pi, and different Linux SBC tasks. You should know what to do with these – let’s have a look.

The thought is straightforward – this interface requires you to always ship a stream of pixels to the show, and it is advisable to ship these pixels via a parallel bus. You’ll be able to ship as much as 8 bits per coloration channel per pixel, which makes for twenty-four bits, and the 24-bit mode is certainly the usual, however in observe, many parallel RGB implementations don’t trouble with greater than 5-6 bits of coloration – two frequent sorts of parallel RGB hyperlinks are RGB565 and RGB666. The parallel RGB interface is a really easy method to sending pixels to your show, and in lots of instances, you can too convert parallel RGB to LVDS or VGA interfaces comparatively simply!

In case you’re new to it, the best approach you possibly can drive a parallel RGB show is from a Raspberry Pi, the place the parallel RGB interface is called DPI. That is how 800 x 480 show Pi HATs just like the Pimoroni HyperPixel work – they dissipate nearly all the GPIOs in your Pi, however you get a fairly high-resolution show with a low energy footprint, and also you don’t want any intermediate ICs both. FPGAs and a few higher-grade MCUs additionally usually have parallel RGB output functionality, and certainly, somebody might even use the RP2040 PIO as properly!

All through the final decade, parallel RGB has been used much less and fewer, however you’ll nonetheless encounter it – perhaps you’re working with an outdated recreation console just like the PSP and wish to put new guts into it, perhaps you’re enjoying with some tasty show that makes use of parallel RGB, or perhaps you’d wish to convert parallel RGB into one thing else whereas treating it with respect! Let’s undergo what makes parallel RGB tick, what instruments you’ve got to work with it, and some suggestions and methods.

Timing Makes All the pieces

So, you have got three main colours, and 5 to eight bits per coloration, requiring from 15 to 24 parallel traces – you push pixel bit values via these traces, one pixel at a time. There’s additionally a clock sign that lets the show know when it ought to seize the state of its parallel inputs, this sign known as a pixel clock, the place every clock rising edge signifies a brand new pixel. The clock charge is due to this fact more-or-less equal to display pixel width occasions pixel top occasions the refresh charge – say, for 1280 x 800 at 60 Hz refresh charge, you’d count on about 62 MHz. There’s additionally two extra pins that it’s a must to wiggle periodically – HSYNC and VSYNC, which sign an entire row and an entire display of pixels respectively. Need to be taught extra? Right here’s some MIT lecture supplies!

(diagram not 100% consultant of actual world alerts)

Right here’s an inventory of frequent frequencies per decision per refresh charge; on Linux, you possibly can enter cvt 1600 768 60 into the terminal to calculate the pixel frequency for a customized decision. You’ll be able to discover that for 1280 x 800, the proposed pixel clock frequency is 83.50 MHz, which is greater than we’d count on from a easy calculation, and there’s a bunch of additional numbers within the cvt output – that’s as a result of there’s a caveat. You’re anticipated to attend for a specific amount of clock pulses earlier than and after every HSYNC and VSYNC, so, earlier than and after every row, and earlier than and after every screenful of information. Additionally, whereas both VSYNC or HSYNC are asserted, you’re supposed to attend for a specific amount of clock pulses too – in fact, the clock is predicted to maintain wiggling always!

The particular inactivity intervals earlier than and after the sync pulse are referred to as front and back porch respectively. So, every show has six data-less intervals with sure durations – for each vertical and horizontal sync alerts, there’s again porch, the sync pulse itself, and entrance porch. More often than not, you may get away with probably the most normal durations used for many displays, or get the numbers from a calculator like cvt in case your decision or refresh charge are a bit non-standard. In case you’re working with a monitor that has an I2C EEPROM which shops EDID, you can too get this knowledge from EDID. Would you wish to be taught extra about these intervals? Right here’s a beautiful weblog web page, and there’s many extra too!

Some shows need very explicit intervals, like this show that Sipeed sells, the place they provide the datasheet so that you could get the precise parameters that the show is comfy with – the again porch durations they advocate are an actual quantity, and I don’t know if the show would assist a distinct one in actuality, so it’s all the time good to know the really helpful one for positive. In case you’re reverse-engineering an present show and you bought the gadget in a position to drive it, that is the kind of factor you could determine in-system with an oscilloscope. Aside from this knowledge, you’ll need the pinout – and, sadly, we don’t all the time have the posh of checking the datasheet on this one.

Adafruit DPI Show Kippah, a Raspberry Pi parallel RGB defend utilizing a typical 40-pin pinout

In fact, there’s standardized pinouts for parallel RGB shows! I don’t have a abstract useful for you, however somebody might actually compile a desk with a number of pinouts and say “these are the pinouts you’re 99% more likely to encounter”. However, you’ll discover fairly a number of pinouts that match from show to show, right here’s one you’re more likely to encounter on 40-pin FPC shows, and I encourage you to examine locations like Adafruit and Aliexpress to see which pinouts they’ve shows and breakouts for. Adafruit particularly has developed a considerable amount of parallel RGB show tech, so learning their choices will assist you a large number in terms of parallel RGB show intricacies. In case you’re reverse-engineering a show out of a known-working system, you possibly can all the time attempt to have it show a picture, then use a bench oscilloscope to seek out pixel clock/VSYNC/HSYNC alerts, and mess with the person pins to see which pins correspond for MSB and LSB of which coloration.

A Raspberry-Scented Testbench

You bought the timing parameters, you bought the pinout – let’s discuss observe. There’s a complete bunch of issues you possibly can connect a parallel RGB LCD to – MCUs with parallel RGB interfaces, FPGAs, and fairly a number of SBCs. I’d say that the best approach for a median newcomer to drive parallel RGB shows, is a simply Raspberry Pi board with a 40-pin GPIO header! I do imply a Linux-running Raspberry Pi, and I don’t imply a Pi Pico working Linux via RISC-V emulation – although, and not using a shred of a doubt, a few of yall might make that work too.

Two dozen pins, all with collection resistors? That’s a parallel RGB show alright!

On a Pi, a parallel RGB show could be related via the DPI interface, which can take up a complete bunch of GPIOs, however you possibly can lower the GPIO quantity by working the LCD in 565 (16-bit) or 666 (18-bit) mode and releasing a good few; it will restrict your coloration vary, however you would possibly worth the additional GPIOs extra. Decrease-bit modes should not a nasty thought both – an amazing majority of outdated laptop computer shows have traditionally been pushed in 565 mode and it hasn’t been a lot of an issue, not less than, contemplating that these shows weren’t of stellar high quality both. When wiring up the show for modes lower than 24-bit, you’ll wish to floor the pins for the least vital bits you’re not utilizing, for example, floor D0-D1 in 666 mode.

Now, the software program! On the Pi, the parallel RGB aka DPI interface has a good bit of documentation and success tales, in contrast to the DSI interface, which is proprietary and makes use of that one FFC connector close to the SD card slot. It may be straightforward to confuse them, so right here’s a straightforward mnemonic – DPI is Pretty hacker-friendly, and DSI is, Sadly, outlined by the MIPI Alliance.

If the show parameters, it may be sufficient to put them into config.txt and go – there’s sufficient documentation on the parameters required, so, even when the low-level workings of the DPI peripheral aren’t uncovered, you’ll do wonders with the output of cvt alone in the event you stick with one of many required pinouts. One bizarre little factor is the side ratio parameter. In case you’re going through a show with a wacky decision and side ratio, just like the 1600×768 Sony Vaio show I’m about to poke at, that may be a headscratcher. Nevertheless, it doesn’t look like a giant problem – right here’s somebody making a 720×720 show work, they usually simply used a side ratio parameter that was shut sufficient.

After you’ve put your parameters in, your show ought to Simply Work. If it doesn’t and your parameters are shut sufficient, let’s see if there’s another wiring necessities you may need missed.

Ending Touches

Some shows count on you to drive their backlight LEDs your self – whereas typically it may be so simple as only a few separate LEDs, extra usually it’s a string of LEDs that requires upwards of 12V at sure (low) present to drive it. There’s sufficient backlight driver circuits and particular chips on-line, lots of them fairly low cost, and a collection resistor will do in a pinch when you have a voltage supply excessive sufficient. Nevertheless, some shows are very explicit – for example, I’m at the moment coping with a show that has LEDs in a 4-channel 8-series configuration, which forces me so as to add a separate boost-capable backlight driver circuit on the adapter board. That mentioned, Mouser has nice search filtering for such drivers, and LCSC has a very good quantity of choices in the event you’re prepared to undergo the search outcomes, so that you shouldn’t have any trouble. Different shows may need a backlight driver on the panel, and can solely count on a digital PWM sign for brightness management from you.

Some shows will even include a contact panel that has its personal FFC, and a few will provide you with touchscreen controller IC alerts (sometimes I2C) on the identical FFC that carries the information pins. Cautious – in the event you solely get uncooked captouch panel alerts, like on this iPad CM4 rebuild mission, you will have to deliver your personal controller! Not that it’s not doable – the following worklogs of that mission have some nice pointers. Some shows will want excessive voltages for the TFT internals – different shows will solely want 3.3V or 5V, producing any excessive voltages on their very own with a booster circuit, and a few can have the circuit however will count on you to wire up a capacitor or two to the FFC in order that the booster circuit can work. A datasheet helps with all of those, and an internet site like Panelook would possibly simply assist with the extra obscure panels, particularly when you have an e mail tackle on a customized area title. In fully unrelated information, sharing is caring!

Most certainly although, you’ll get one of many fairly normal 40-pin footprints, and likelihood is, you’ll be capable of use an Aliexpress board with it. What if it is advisable to design your personal board? For Raspberry Pi use, it’s so simple as pulling wires from the GPIO header onto the FFC header, dealing with the backlight and another necessities, and choices in the event you’re so inclined. Theoretically, you’ll wish to length-match the parallel alerts, which is to say, get all of the RGB & clock & sync tracks to be the identical size utilizing wiggles, however the solutions on this Stackoverflow web page unequivocally that you simply don’t actually need to do this. It’s not like it would harm, however don’t really feel responsible for omitting size matching at these frequencies, both. A greater thought is having collection resistors on the receiving finish, one thing from 10 to 100ohms – these ought to assist quell reflections which are sure to occur at DPI switching speeds.

If, nevertheless, coping with 20-30 tracks at a time is an excessive amount of for you, you’re in luck – the following article will discuss LVDS and eDP, which boil down all the parallel RGB alerts into only a few diffpairs, whereas reaching approach higher throughput! LVDS particularly is an interface the place understanding the parallel RGB historical past pays off – as you will notice, it’s principally parallel RGB in a trenchcoat.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here