Nominal Animal
Well-known member
Just out of technical interest, I've looked at a few different possibilities of connecting cheap 240×320/320×480 TFT display modules using 16-bit parallel connection to various Teensies.
The controllers are similar to ILI9341 and ILI9488, and can support much higher parallel data rates than via SPI. The problem is that because of the pins used on different Teensies, they really aren't that well suited for the 16-bit parallel connection (which really requires something like 19 I/O pins or more), and in many use cases a color look-up table is needed anyway, making DMA operation nontrivial.
I've looked at things like using an SRAM chip with two serial-to-parallel latching shift registers, where the SRAM output would be connected to the display in parallel, one serial would control the "palette" selection, and one would be used via SPI (MOSI/DO and SCK only) to emit the framebuffer data. For 8-bit framebuffer, one or two colors would be reserved for the 17-bit commands needed, leaving 254 or 255 colors for use. A second DMA could be used to emit just the palette selector for each pixel row, letting each row have their own palette. Alternatively, the display could be subdivided into rectangular regions with their own palettes. Chaining the two DMAs, with a few extra bytes per scan line (pixel data command parameters) would allow almost completely transparent DMA transfers.
Unfortunately, I could not find an option with the complexity and cost that would make sense to implement.
What I did find, instead, was a slew of cheap microcontrollers like ATSAMD51J20A, that could be used instead of the SRAM chips. All it needs to be a SPI slave at high clock frequencies for Teensies is a handful of jellybean capacitors, a 32768 Hz crystal, and a simple double-sided board any board fabricator like OSH Park, JLCPCB, and so on. The price for the components at Mouser in singles is on the order of 7-8€.
As I now have one (allegedly LG) 240x320 IPS panel with 16-bit parallel connection to its ILI9341 controller, and I really like designing boards in EasyEDA (noting that I am a bumblespork hobbyist only), I decided to look into how to make a carrier board for testing a SAMD51J20A, as a SPI slave for Teensy 3.0/3.1/3.2/LC/4.0 (me having all of those at hand).
Then, as usual, I got sidetracked. I found out about TPS82084, which is cheap but provides 3.3V from 3.3V-5.5V source very, very efficiently (90%+ at 1mA+ currents, 92%+ at 10mA+, according to TI Webench Power Designer), making it perfect component to provide a stable voltage from USB or single-cell LiPoly. (The linked "board" is a tiny 31mm by 11mm module that costs less than 3€ in parts from Mouser in singles.)
Unfortunately, I don't have a proper oscilloscope with the bandwidth or probes to find out how good that is in practice. (It uses a high frequency integrated shielded inductor, so it shouldn't spew EMI everywhere; I'd just prefer to check.)
I also realized that the SAMD51J20A has two 12-bit DACs, and I had those pins free, so I could add a simple headphone amplifier on it, and play with wavetable synthesis again (I was into music tracker software in late 90s, and know quite a bit of how they worked; SAMD51 would have ample power to implement a 8-bit/12-bit 8-channel tracker for music and sound effects). Capless headphone amplifiers are just a couple of euros in parts, and should work fine for this use case. Of course, I don't have any experience with analog audio and headphone amplifiers, so it'd take a bit of experimentation to see what kind of DAC voltage levels and biasing would produce the optimum audio levels and quality. Yet another sidetrack!
At this point, I am torn between whether to try and investigate the idea of SAMD51J20A as a pure cheap blitter/LUT/slave graphics processor for Teensies (connected via one or more SPI, I2C, and/or UART; with the framebuffer on Teensy, and the SAMD51 as just an accelerator/translator/blitter/helper), or instead see if I could make the SAMD51J into a really cheap handheld retro "console" instead. I'm not particularly interested in games, and don't intend to create any. It is this low-level tech that really interests me, and the design and testing as an investigation or exercise! My designs will be in public domain, and software libraries free/open source software (or CC0, I'm not fanatic although I prefer GPL in general).
So, my question is, is there anybody here interested in using a separate cheap -- complete cost including PCB in singles < 10€ -- microcontroller as an accelerator/blitter/translator between a Teensy and these 16-bit parallel displays, connected via SPI/I2C/UART? The same pinout can support 8, 9, 16, and 18-bit parallel. You'd have to buy the parts, order the boards, and put them together yourself; I won't be making any to sell.
The controllers are similar to ILI9341 and ILI9488, and can support much higher parallel data rates than via SPI. The problem is that because of the pins used on different Teensies, they really aren't that well suited for the 16-bit parallel connection (which really requires something like 19 I/O pins or more), and in many use cases a color look-up table is needed anyway, making DMA operation nontrivial.
I've looked at things like using an SRAM chip with two serial-to-parallel latching shift registers, where the SRAM output would be connected to the display in parallel, one serial would control the "palette" selection, and one would be used via SPI (MOSI/DO and SCK only) to emit the framebuffer data. For 8-bit framebuffer, one or two colors would be reserved for the 17-bit commands needed, leaving 254 or 255 colors for use. A second DMA could be used to emit just the palette selector for each pixel row, letting each row have their own palette. Alternatively, the display could be subdivided into rectangular regions with their own palettes. Chaining the two DMAs, with a few extra bytes per scan line (pixel data command parameters) would allow almost completely transparent DMA transfers.
Unfortunately, I could not find an option with the complexity and cost that would make sense to implement.
What I did find, instead, was a slew of cheap microcontrollers like ATSAMD51J20A, that could be used instead of the SRAM chips. All it needs to be a SPI slave at high clock frequencies for Teensies is a handful of jellybean capacitors, a 32768 Hz crystal, and a simple double-sided board any board fabricator like OSH Park, JLCPCB, and so on. The price for the components at Mouser in singles is on the order of 7-8€.
As I now have one (allegedly LG) 240x320 IPS panel with 16-bit parallel connection to its ILI9341 controller, and I really like designing boards in EasyEDA (noting that I am a bumblespork hobbyist only), I decided to look into how to make a carrier board for testing a SAMD51J20A, as a SPI slave for Teensy 3.0/3.1/3.2/LC/4.0 (me having all of those at hand).
Then, as usual, I got sidetracked. I found out about TPS82084, which is cheap but provides 3.3V from 3.3V-5.5V source very, very efficiently (90%+ at 1mA+ currents, 92%+ at 10mA+, according to TI Webench Power Designer), making it perfect component to provide a stable voltage from USB or single-cell LiPoly. (The linked "board" is a tiny 31mm by 11mm module that costs less than 3€ in parts from Mouser in singles.)
Unfortunately, I don't have a proper oscilloscope with the bandwidth or probes to find out how good that is in practice. (It uses a high frequency integrated shielded inductor, so it shouldn't spew EMI everywhere; I'd just prefer to check.)
I also realized that the SAMD51J20A has two 12-bit DACs, and I had those pins free, so I could add a simple headphone amplifier on it, and play with wavetable synthesis again (I was into music tracker software in late 90s, and know quite a bit of how they worked; SAMD51 would have ample power to implement a 8-bit/12-bit 8-channel tracker for music and sound effects). Capless headphone amplifiers are just a couple of euros in parts, and should work fine for this use case. Of course, I don't have any experience with analog audio and headphone amplifiers, so it'd take a bit of experimentation to see what kind of DAC voltage levels and biasing would produce the optimum audio levels and quality. Yet another sidetrack!
At this point, I am torn between whether to try and investigate the idea of SAMD51J20A as a pure cheap blitter/LUT/slave graphics processor for Teensies (connected via one or more SPI, I2C, and/or UART; with the framebuffer on Teensy, and the SAMD51 as just an accelerator/translator/blitter/helper), or instead see if I could make the SAMD51J into a really cheap handheld retro "console" instead. I'm not particularly interested in games, and don't intend to create any. It is this low-level tech that really interests me, and the design and testing as an investigation or exercise! My designs will be in public domain, and software libraries free/open source software (or CC0, I'm not fanatic although I prefer GPL in general).
So, my question is, is there anybody here interested in using a separate cheap -- complete cost including PCB in singles < 10€ -- microcontroller as an accelerator/blitter/translator between a Teensy and these 16-bit parallel displays, connected via SPI/I2C/UART? The same pinout can support 8, 9, 16, and 18-bit parallel. You'd have to buy the parts, order the boards, and put them together yourself; I won't be making any to sell.