[EN] TasmARI

Moderator: bbiernat

Post Reply
Online
User avatar
pancio
Administrator
Posts: 77
Joined: 18 September 2013, 23:02 - Wed
Location: SILESIA

[EN] TasmARI

Post by pancio »

TasmARI: Tasmota + Atari = The Universe Control Center

Introduction
I'd like to introduce you to my new, very simple device for the Atari XL/XE.
TasmARI is a simple connection between an ESP32 microcomputer running under Tasmota operating system and an Atari. This allows for a greater expanse of the Atari's capabilities in the broadest sense of the word, while also enabling our Atari to be part of a set of IoT devices. Thanks to the Tasmota OS, our Atari can communicate with other IoT components and manage our digital home using e.g. Home Assistant software. Now your Atari can become a control center... you can turn the lights on and off, make your morning coffee in the espresso machine, or play your favorite Internet Radio track on your Atari. The possibilities are limited only by your imagination and... the type of devices connected to the network...

It is also worth mentioning that initially TasmARI was supposed to be based on the ESP8266 chip, but I thought that since it was to be shown at the annual ABBUC HW competition, it would be necessary to use more powerful hardware :)

General description of the system.
The heart of the system is a module containing an ESP32 microcomputer – I chose the LoLIN D32 PRO version because it has an SD card port, a TFT display connector, an I2C connector, and a connector for connecting a battery. The module communicates with the Atari via a serial port, which is the easiest to use and allows for compatibility with the Atari OS and interoperability with other devices connected to the SIO connector. Proper operation also requires a voltage level shifter between Atari and ESP32. The remaining components are user-defined. These can include any sensors using the I2C, SPI, or OneWire bus – the only limitation is the type and version of the installed Tasmota OS software. For example, adding a PCF8574 chip provides an additional register that can be connected to, for example, PIA PORTB, allowing for control and management of the Atari's memory management. Another example is the use of EEPROM chips such as the AT24C256, the BMP280 – a digital barometer, thermometer, and hygrometer, and many other interesting sensors. Furthermore, the Tasmota OS allows remote access to all other sensors and controllers in network using the MQTT protocol.

TasmARI - version 1
In the first version, the project was implemented based on a pre-built LoLIN D32 PRO module and equipped with 74HC07 buffers. Basic software communicating with the Atari is written in the Berry scripting language, which is embedded part of the Tasmota OS software. Berry allows for simple peripheral management and also includes file management functions. This version of hardware was prepared for two very common modules ESP32: LoLIN and Dev-Kit:
tasmari-modules.jpeg
tasmari-modules.jpeg (1.38 MiB) Viewed 683 times
First version as few variants of TasmARI first tests, schematic and visualization:
tasmari-pcbfront..png
tasmari-pcbfront..png (169.8 KiB) Viewed 683 times
tasmari-pcb-visualization1.png
tasmari-pcb-visualization1.png (459.18 KiB) Viewed 683 times
tasmari1r4.png
tasmari1r4.png (347.84 KiB) Viewed 683 times
tasmariv1r4-pcbfront.png
tasmariv1r4-pcbfront.png (501.12 KiB) Viewed 683 times
tasmari1r0-pcb1.jpeg
tasmari1r0-pcb1.jpeg (874.79 KiB) Viewed 683 times
tasmari1r0-pcb-run.jpeg
tasmari1r0-pcb-run.jpeg (988.71 KiB) Viewed 683 times
This hardware version supports an OLED display over the I2C bus, which can also contain four buttons (also operated by a PCF8574 connected to I2C). Music can also be played by using two DACs and feeding them into the Atari's AUDIO input. I also equipped TasmARI with a LED bar graph indicator - also supported by PCf8574.

In subsequent hardware revisions, there was always something that needed fixing. For example, I'd get the GPIO number wrong or forget that some signals could only function as inputs or outputs. They could also be used as strapping pins—used during ESP32 bootup. There were several fixes, a lot of testing, and disappointments...

And icing on the cake... I decided to add a regular pin header because SIO sockets are terribly expensive and terribly annoying to install :-)

However, the modules used have their limitations - especially when it comes to the number of GPIO signals and their versatility... so I decided to replace the ESP32-WROOM with the ESP32-S3-WROOM-1 and that's how the second version of TasmARI was created.

TasmARI - version 2

The second version of TasmARI has been slightly 'trimmed'... the LED bar graph has been removed and replaced with a pin header for SPI displays. I figured I could always present results on a larger, color display instead of just a few LEDs. There's also a pin header for the PCF8574 multiplexer and control for a WS2812b-based LED strip. However, I've retained compatibility with OLED displays (along with the four buttons). Using the ESP32-S3 has a huge advantage over the ESP32, including more GPIOs, support for 16MB of flash and 8MB of PSRAM. You can also easily connect a microSD card reader. And all this without interfering with any SIO signal handling. Unfortunately, I also had to give up audio support, as the ESP32-S2 lacks 8-bit DACs. But don't worry, you can always connect an external DAC :-)

For the reasons described above, both versions were no longer compatible with each other and I focused on developing only the second version.

Several hardware revisions were also made for TasmARI v2 because I kept encountering issues. Ultimately, testing is currently being conducted on version 2.0R0, with version 2.1R2 in production – and this is the version covered in the rest of this description.

Schematic
TasmARIv2.1R2-schematic.png
TasmARIv2.1R2-schematic.png (333.5 KiB) Viewed 264 times
Brief description:
  • The dark blue GPIO pins are responsible for connecting to all SIO signals in the Atari. The most important are GPIO17 (TX -> DATA_IN) and GPIO18 (RX <- DATA_OUT).
  • The green GPIOs are assigned to the SPI bus and are primarily used to control the color display.
  • The two turquoise GPIO pins: GPIO8 and GPIO9, are the SDA and SCL signals of the I2C bus, respectively. They are used for communication with the OLED display and the PCF8574 multiplexer. They are also connected to a separate pin header, allowing connection to other I2C-enabled systems.
  • The red pins are GPIOs used by FLASH and PSRAM memory. Using them requires careful consideration, and if you decide to use them, you must disable support for additional memory.
  • Also marked in red are the stripping pins. They can be used, but remember that they are used to configure the ESP32-S3 during startup. Their state must be precisely defined at power-up. I decided against using these signals, and the DevKitC module is responsible for their proper configuration.
  • The brown GPIO pins are used for communication with USB, serial port and microSD card.
ESP32-S3-DevKitC.png
ESP32-S3-DevKitC.png (147.06 KiB) Viewed 248 times

Board - prototyp
For now, the PCB is the same size as in the first version, but I plan to reduce it to such a size that it will perfectly fit the case of our friend @Beetle (he made a great case for FujiNet modeled after the Atari 800XL).
TasmARIv2.1RC2-front-visualization.png
TasmARIv2.1RC2-front-visualization.png (354.45 KiB) Viewed 253 times
TasmARIv2.1RC2-right.png
TasmARIv2.1RC2-right.png (581.3 KiB) Viewed 253 times
The prototype I'm testing on:
TasmARIv2.0RC0-proto.jpeg
TasmARIv2.0RC0-proto.jpeg (1.34 MiB) Viewed 238 times

Tasmota OS configuration
For our interface to work with the Atari, it needs to be configured. The same applies to the display. Let's start with configure GPIOs for LCD and WS2812b:
TasmotaOS-display-ws.png
TasmotaOS-display-ws.png (205.99 KiB) Viewed 228 times
The display can be configured in various ways, but I chose to use the Universal Display and Universal Touch drivers (uDisplay/uTouch) included in newer versions of TasmotaOS. Configuration involves "guessing" the display driver and entering the appropriate configuration string into the display.ini file and saving it in the TasmotaOS filesystem:
tasmota-cfg1.png
tasmota-cfg1.png (77.03 KiB) Viewed 230 times
TasmotaOS-display.ini.png
TasmotaOS-display.ini.png (80.74 KiB) Viewed 228 times
TasmotaOS-filesystem.png
TasmotaOS-filesystem.png (85.53 KiB) Viewed 226 times
If you have other display (different display driver) you need to find proper configuration on Tasmota GitHub page or write your own. Refer to uDriver Page

Example for ST7735 driver with 128x16 (display.ini):

Code: Select all

:H,ST7735,128,160,16,SPI,1,*,*,*,*,*,*,*,40
:S,2,1,1,0,40,20
:I
EF,3,03,80,02
CF,3,00,C1,30
ED,4,64,03,12,81
E8,3,85,00,78
CB,5,39,2C,00,34,02
F7,1,20
EA,2,00,00
C0,1,23
C1,1,10
C5,2,3e,28
C7,1,86
36,1,48
37,1,00
3A,1,55
B1,2,00,18
B4,1,04
B6,3,08,82,27
F2,1,00
26,1,01
E0,0F,0F,31,2B,0C,0E,08,4E,F1,37,07,10,03,0E,09,00
E1,0F,00,0E,14,03,11,07,31,C1,48,08,0F,0C,31,36,0F
11,80
29,80
:o,28
:O,29
:A,2A,2B,2C,16
:R,36
:0,C0,00,00,00
:1,A0,00,00,01
:2,00,00,00,02
:3,60,00,00,03
:i,20,21
#

You've probably noticed there are a few other files in the folder... some of them are my tests, but one is quite important: autoexec.be. This file is executed immediately after TasmotaOS boots. In it, you can define all your TasmotaOS functions and behavior, configure Atari transmission, and so on. In this file, I simply clear the display and display a banner for 5 seconds :-)
TasmARI-banner-autoexec.be.png
TasmARI-banner-autoexec.be.png (94.53 KiB) Viewed 19 times








t.b.c.

Post Reply