hash6iron / powadcr

TAP/TZX Digital cassette recorder for 8-bit machines
GNU General Public License v3.0
23 stars 10 forks source link

POWADCR

TAP/TZX/TSX/CDT Digital cassette recorder for 8-bit machines

20241120_172544

This project pretend to implement a Digital Cassette Recorder (for TAP/TZX files playing and recording on TAP) for ZX Spectrum machines based on ESP32 Audio kit development board and using HMI over touch 3.5" screen.

20241114_094902 The launcher was this board, ESP32 Audio Kit equipped with ESP32 v3 microcontroller and ES8388 Audio proccesor made by AI-Thinker Technology.

https://docs.ai-thinker.com/en/esp32-audio-kit

The summary of specifications is.

So, it's a beautiful develop board with a big possibilities.

To begin with is necessary use the Phil Schatzmann's libraries for ESP32 Audio Kit v.0.65 (https://github.com/pschatzmann/arduino-audiokit) where we could take advantage of all resources of this kit, to create a digital player and recorder for ZX Spectrum easilly, or this is the first idea.

This project need set PCB switches to

Switch Value
1 On
2 On
3 On
4 Off
5 Off

LCD Screen Display

The LCD touch screen display chosen for this project is a TFT HMI LCD Display Module Screen Touch connected with 2 serial pins (TX and RX) to the board.

About Sinclair ZX Spectrum TAP structure.


About loading proccess in Sinclair ZX Spectrum

I recomend the Alessandro Grussu's website with an interesting information about the loading process and processor timming for this goal. https://www.alessandrogrussu.it/tapir/tzxform120.html#MACHINFO

Now, I'd like to show you how the signal generated from TAP file that Sinclair ZX Spectrum is able to understand. The mechanism to read the audio signal is based on squarewave peaks counting, using the Z80 clock timming, then:

The sequence for ZS Spectrum, is always for standard loading:


Where: LEADER TONE (2168 T-States) is two kind of length.

What means T-State?

Well, this concept could be difficult to understand, but it's not far of reallity, as summarized full pulse (two peaks one to high and one to low) has a period equal to "2 x n T-State" time, where T-State = 1/3.5MHz = 0.28571 us, then for example: LARGE LEADER TONE.

How many peaks has the LARGE LEADER TONE pulse train?

What's the signal frequency?

About POWADCR Device.

In this section we are going to describe parts to be needed to assemble the PowaDCR device.

Bill of material

Hacking the Audiokit board.

This board is build from the same design from AC101 audio chip version, but with ES8388 chip. In this case both mic and line-in are mixed. Not possible to select by independ way mic or line-in then the environment noise come in when the ZX Spectrum signal is capturing. So, it shall be removed both integrated microphones.

image

How PowaDCR parts are connected?

(in progress)

How .bin firmware is uploaded in ESP32-A1S Audiokit?

  1. Download ESP32 Flash Downloading Tool - https://www.espressif.com/en/support/download/other-tools?keys=&field_type_tid%5B%5D=13

  2. Unzip file and execute - flash_download_tool_x.x.x.exe file

    See example image below.

    image

  3. Select ESP32 model.

    • ESP32
    • Develop And press "OK" button
  4. Setting and begin the flash proccess.

    • Select .bin file or type the path of it (from /build)
    • Select all parameters exactly at the image below.
    • Connect ESP32-A1S Audiokit board from UART microUSB port (not power microUSB PORT) at PC USB port.
    • Select the available COM for this connection in COM: field on ESP32 Flash Downloading Tool.
    • Select BAUD: speed at 921600
    • Disconnect the Touch Screen cable in order to release serial port (Audiokit sharing USB and UART communications)
    • Press START button in ESP32 Flash Downloading Tool. Then downloading proccess begin, and wait for FINISH message. Enjoy!

      NOTES: If the proccess fail.

      • Try to download again.
      • Try to ERASE before START proccess.

    Show image below.

    image

How custom firmware is uploaded in ESP32-A1S Audiokit?

  1. Install VSCode
  2. Install PlatformIO for VSCode
  3. Open powaDCR project into VSCode
  4. Connect the ESP32 Audiokit USART USB port to any USB PC port
  5. Press BUILD (arrow icon) from PlatformIO toolbar.

How firmware is loaded in TJC LCD?

Upload the file "HMI/../build/powadcr_iface.tft" to the root of the SD and insert this into powaDCR. Power on the powaDCR and Wait until firmware is uploaded.

If you enjoy with this device and you want to colaborate, please.

thxs.