#ATtinyHacks #PeripheralsHacks #SecurityHacks #Attiny85 #Capslock #Hd44780 #Mooltipass #Passwordkeeper #USBHIDKeyboard
When Clever Hardware Hacks Bite Back: A Password Keeper Device Autopsy
MiniDexed Raspberry Pi IO Board
I’ve been toying with the idea of some kind of IO board for my MiniDexed experiments for use with a Raspberry Pi. I initially wanted something fully self-contained – i.e. just pop it on a Raspberry Pi and you’re good to go. But then it was pointed out that having all the IO connections on one side is much more friendly from a “putting it all in a case” point of view.
In the end, I used many of the same circuit elements and came up with two designs.
Update: Here are links to the build guides for these PCBs:
There is a version for the Raspberry Pi V1 here: MiniDexed Raspberry Pi V1 IO Board and my pseudo TX816 can be found here: MiniDexed TX816.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
If you are new to microcontrollers and single board computers, see the Getting Started pages.
Basic Requirements
I wanted a board to do the following:
As I mention above, I was initially after something that would fit within a normal “HAT” type footprint for a Raspberry Pi, which is pretty constraining, but following on from the Clumsy MIDI board, should be possible with a small SSD1306 OLED display.
But I was also keen to try to build something that would allow all the IO to line up along the back, so I’ve also designed a larger board that overhangs the Pi and allows for a full three MIDI din sockets. This larger board can accommodate a HD44780 LCD display as used in the original MiniDexed setup.
I’m happy for the whole thing to receive power via the Pi and of course USB and ethernet connections are also available on one side.
MiniDexed RPi IO Board (SSD1306 Version)
Starting a new project in KiCad, there is already a “Raspberry Pi 40-pin Extension Board” template which provides the basic outline, PCB footprint for the GPIO, and cut-outs for the display and camera.
Here is the schematic I’m working to.
Points worthy of note:
This is the GPIO map used:
If the rotary encoder seems to be “backwards” then swap RE_A and RE_B in the configuration. Note that at the time of writing, I2C SSD1306 displays are in development but hopefully will be available in MiniDexed by the time you read this.
Here is the board that has been sent off for manufacturing.
Design notes:
Here is an early “space test” (without the buttons) with a paper printout to give you an idea of what I’m aiming for.
And an image of the Gerbers as sent off for manufacture:
MiniDexed RPi IO Board (HD44780 Version)
Again starting a new KiCad project from the Raspberry Pi 40-pin extension board template, this is the circuit I’m working with for this one.
Schematic Notes:
To simplify the routing of the PCB, the pinouts for the various components have changed. Here is the pinout being used (this is now quite different to the original MiniDexed pinout).
So this is the design for the pcb that has been sent off for manufacture:
Design notes:
Manufacturing
Both boards should be built using the standard, cheapest manufacturing options. Both are fine with a 6/6 mil constraint on track width and separation.
The second board is somewhat larger than the common “cheap” tier. For me, all my other boards were $4.60 plus postage for 10 boards, but the larger one has jumped up to around $27 plus postage.
On the back of my first blog post, having used Seeed Fusion to produce my first boards, they sent me some money off vouchers, so I’ve used them once again here. That was particularly welcome given the increased cost of the larger board!
I still don’t really have a space to store these designs. But I’ll update this post when I do!
Closing Thoughts
Although either of these designs could potentially be used in a case to make a nice, small, self-contained unit, I can’t guarantee that the spacing of connectors and components will really allow it. I’m also not sure what will be required in terms of cooling for the Pi, so I’ll have to see how I get on. It may be that I’ll need more spacing between the Pi and the IO board.
I’m still learning with KiCad, so am fully expecting continued mistakes or odd design choices, but I think both of these will be interesting to try.
Update: mistakes already spotted since sending them off:
So that is the walk-through of the design of these boards. Of course I won’t really know if they are successful until I get the boards back from manufacturing!
Kevin
#hd44780 #midi #minidexed #pcb #pcm5102 #raspberryPi #ssd1306
Small Microcontroller Displays
I found myself wanting several small displays connected to a microcontroller, so was doing a bit of a trade-off between various options, and was starting to lose track, so this post collects some of those thoughts together.
It is not meant to be a comprehensive discussion of choosing small displays for projects, but more of a reflection on the displays I already have kicking around in my parts boxes!
Most displays tend to be categorised by the driver chip they use. And then by the bus type used for their connection. So that is how I’ve grouped them here.
A really good reference for many of the displays shown here is: https://www.lcdwiki.com/Main_Page
I2C SSD1306 OLED
This is usually my “go to” set of small displays. They are generally well supported and pretty easy to use.
I generally have two variants to choose from:
On the left is the 0.91″ 128×32 OLED SSD1306 and on the right is the 0.96″ 128×54 OLED SSD1306. Common properties of both displays:
Software support:
Typical Connections:
Known “gotchas”:
Summary:
Other I2C Variants
There are some variants of the SSD1306 that sometimes pops up too for slightly larger displays:
SPI ST7735/89/96 TFT
Whereas the SSD1306 I2C is pretty ubiquitous for monochrome displays, I’ve tended to find that SPI ST77xx displays fill a similar niche for small, full colour, non-touch, TFT displays. And there are loads of variations on the theme when it comes to these displays.
The 7735 supports lower resolution, smaller displays, typically up to 170×320, with the 7789 for those of 240×240 or 240×320 and similar. There is also a ST7796 which I believe uses the same driver libraries for a higher 320×480 display.
Two 7735 Displays:
These two ST7735 displays that I have are labelled:
These ST7789 display I have is labelled:
I also have a display that was bought as a ST7789 labelled “TFT 2.8″ 240×320 SPI” which comes with a touch screen, but I can’t get this to work.
Common properties:
Software support:
Typical Connections:
Known Gotchas:
Note, unlike the monochrome displays, these have their own pixel framebuffer so memory use is much more efficient, even when used as a full colour display.
Summary:
OLED SH1122 SPI
There are actually both I2C and SPI versions of SH1122 displays, but I’m considering the SPI version here. The display I have is a 256×64, monochrome OLED display.
Software Support:
Example:
U8G2_SH1122_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);Typical Connections:
The _F_ constructor requires a full frame-buffer so is unlikely to work on resource constrained devices (e.g. the Arduino Uno/Nano). The _1_ constructor provides a pageable interface which allows for the updating of the display in pages, which takes longer but allows it to be used with more devices.
There are also software SPI versions that allow the use of any GPIO pins.
Summary:
ILI9341/9488 TFT
Cheap larger displays are often driven by one of the ILI9341 or ILI9488 chips. The former supports 240×320 in full (16-bit) colour whereas the 9488 tends to support larger displays of up to 320×480 in full (24-bit) colour. Both support either a parallel (at least 8, 9, 16-bit) or serial (3 or 4 wire SPI) bus interface.
I don’t have a lot of detailed information for this post yet, but instead will refer to:
The ILI9341 is well supported by the Adafruit graphic libraries, but the ILI9488 is likely to require something else, as described in the above post.
These displays are often used with touch support and will often expect to run at 3V3 logic levels.
LCD 1602 HD44780
This is another very common monochrome, but text only, display. They have a 4 or 8-bit parallel interface, but it is also quite common to use the with an I2C “backpack” based on the PCF8574 I2C IO expander. Boards can be cheaply bought with or without a backpack, and the backpacks are available separately too for retro fitting to displays without them.
They are often called “1602” displays as they are two rows of 16 characters. By using custom blocks it is possible to have some simple graphics. There are LCD2004 modules too with four rows of 20 characters.
They often come with a choice of backlight colours. White or red are particularly striking! There are some variants that come with an additional I2C controller chip built in to control the backlight and some even come with a full RGB backlight capability.
Typical Connections:
There are core Arduino libraries to support the most basic versions of these displays:
Typical Gotchas:
Summary:
Others
So I don’t forget when considering the above, I also have:
I’ll add to the list for my own reference as I remember other odds and ends.
Kevin
#hd44780 #ili9341 #ili9488 #include #lcd1602 #oled #ssd1306 #st7735 #st7789 #tft
Then I wondered: Can you actually reprogram a character while it is being displayed? Like you may expect in such an old chip, the #HD44780 does *not* latch the customized character anywhere. Instead, every time it scans out the characters to the LCD, it reads the bitmap from RAM again.
That means that if one of the customized characters is in use, it updates immediately on the display when changing it via the parallel #Programming interface.
I don't think anyone has ever these displays to show a 40-band live spectrogram of the music playing on their laptop, but I did now.
3/3
Some of you who are deeper into it may also know that these are based on the #HD44780 IC by Hitachi. They are quirky (for example, in this four-line display, the second row has a higher address than the third row) and the font is baked into the ROM of the chip. Most of the displays you can get use the A00 character set, which is clearly not designed for the European market: the upper half of the 8-bit codepage is dedicated to Japanese symbols.
However, less well-known is that on 5x8 pixel-per-character displays like these, you get 8 characters in the HD44780 RAM you can program freely.
That can be useful in some applications. I once designed a programmable remote camera shutter which would use this to display the battery level, such as seen in the photo below.
2/3
I really hate breadboards and the most, the wires - they are everywhere!
So after it seemed to worked on breadboard, I now soldered my first prototype of my idea having a #ESP01 with a #HD44780 as network display.
It was kind of difficult to get the right #LiquidCrystal_I2C, since its years old and doesnt work with later modules. And now: lets do some coding!
It seems that there would even be uses for #homeassistant integrations. Just stumbled across this #hackaday article and the referenced forum post. Scream people have taken this approach but I've not stumbled across published source code. So thinking about publishing mine as open source software...
https://hackaday.com/2024/01/19/alarm-panel-hack-defeats-encryption-by-ignoring-it/
⬇️
https://community.home-assistant.io/t/dsc-neo-integration/169078/13
So I really should have tagged this #lcd #hd44780 #LcdSniffer #LcdSpy. 4/