Phoenix Air - WiFi for the H5 Phoenix

All the good stuff hardware and software wise for the Phoenix H5 series motherboards.
Post Reply
User avatar
exxos
Site Admin
Site Admin
Posts: 29920
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Phoenix Air - WiFi for the H5 Phoenix

Post by exxos »

ST_WIFI_3A_3D_iso.png
ST_WIFI_3A_3D_iso.png (551.33 KiB) Viewed 97 times

I have been working on a new board for the H5 Phoenix, and it now has a name, Phoenix Air. It is a WiFi board for the Atari, designed with TLS support from the start, so things like HTTPS and secure mail are possible without a PC doing the hard work in the background.

It plugs into one of the 68k IO sockets on the Phoenix. Those sockets are copies of the 68000 CPU socket, so the board sits right on the full 16-bit bus. It does not use the cartridge port at all, so cartridges can still be plugged in and used at the same time.

The hardware is fairly simple. Two ATF1502 CPLDs handle the address decoding and the data side, and talk to an ESP32-S3 module over SPI. The module is the WROOM-1U version with 16MB of flash and 8MB of PSRAM, which gives TLS enough room to work in. It has a u.FL socket rather than an antenna on the module, so an external antenna on a short lead is needed. All the parts are on the top side, and the whole board fits inside the outline of the 68000 DIP64 footprint, about 81 x 25mm, on a 4 layer PCB.

On the software side, the ESP firmware is my own, and so is the network driver on the Atari. The driver will be STiNG and STiK compatible, the aim being that existing network programs work without any changes. The ESP does all the TCP/IP and TLS work, and the Atari just moves the data in and out, which keeps the load off the 68000.

As for speed, on paper the bus side works out at around 1.1 to 1.3MB/s in each direction on an 8MHz machine, and the limit there is the 68000 copy loop rather than the board itself. That is a calculated figure, not a measured one, so I will post real numbers once the boards are running.

Test boards have been ordered from JLC. The CPLD logic, the ESP firmware and the driver are all still to be written, so there is a fair bit of work to do yet. I will post updates as it comes together.
User avatar
PhilC
Moderator
Moderator
Posts: 7755
Joined: Fri Mar 23, 2018 8:22 pm

Re: Phoenix Air - WiFi for the H5 Phoenix

Post by PhilC »

Added to my want list :dualthumbup:
If it ain't broke, test it to Destruction.
User avatar
JezC
Posts: 2922
Joined: Mon Aug 28, 2017 11:44 pm

Re: Phoenix Air - WiFi for the H5 Phoenix

Post by JezC »

Me too - and I might even get an H4/H5 board to the point where it is ready to use it! :lol: :roll:
User avatar
exxos
Site Admin
Site Admin
Posts: 29920
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Phoenix Air - WiFi for the H5 Phoenix

Post by exxos »

I see soldering and firmware in my future...

wifi.jpg
wifi.jpg (122.88 KiB) Viewed 49 times
User avatar
exxos
Site Admin
Site Admin
Posts: 29920
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Phoenix Air - WiFi for the H5 Phoenix

Post by exxos »

Both ATF1502s showed up on the JTAG chain first time, which is always a relief. Getting the firmware to actually fit was another matter. The address decode chip went in without a fuss, but the data/SPI chip took four attempts before the fitter would place it. The logic was fine, it just ran out of routing inside the chip, so it needed a bit of rearranging until everything had a path. It now fits and passes the full simulation.

I then ran a small test program on the ST to check the CPLD side without any ESP firmware. It checks the control register, switches the ESP chip select on and off, does a load of data reads and writes to make sure every access gets DTACK back, and then times raw transfers.

Everything passes, including from a cold boot. The raw speeds in a tight loop came out at about 1190KB/s for writes and 1365KB/s for reads. That is just the bus side in an unrolled loop, so real copy loops and the network side will be slower, but it shows the hardware interface is doing its job.

Screenshot of the test results and some pictures of the board attached.

Next up is the ESP32 firmware. Of course some dumbass forgot to put a USB socket on the PCB to actually program the WiFi module. There are pads on the bottom to solder to, so I have had to order a USB breakout board to hack it together. Once the first firmware is on it, it should be able to update itself over WiFi, so with any luck that is a one-off.

I have also ordered an antenna, as the module uses an external one on a U.FL connector. Hopefully both turn up tomorrow and I can get some actual WiFi traffic going.

IMG_5527.JPG
IMG_5527.JPG (295.69 KiB) Viewed 34 times
IMG_5528.JPG
IMG_5528.JPG (70.51 KiB) Viewed 34 times
User avatar
Icky
Site Admin
Site Admin
Posts: 4456
Joined: Sun Sep 03, 2017 10:57 am
Location: UK

Re: Phoenix Air - WiFi for the H5 Phoenix

Post by Icky »

exxos wrote: Mon Nov 30, 2026 4:02 pm I see soldering and firmware in my future...
I see :fire: :hide:
User avatar
exxos
Site Admin
Site Admin
Posts: 29920
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Phoenix Air - WiFi for the H5 Phoenix

Post by exxos »

Phoenix Air update, or how a five minute job took all evening.

So the plan was simple. Parts arrive, wire a USB lead to the board, flash the ESP32, done. What could possibly go wrong.

First problem, some genius (me) designed the board with no USB socket on it. There are pads for it on the bottom, so technically it can be programmed, in the same way that technically you can drive to Scotland in first gear. Next board gets a proper socket. While I am at it, the JTAG header is going to move a couple of mm away from the 68K pins as well, because I managed to short both headers while soldering the JTAG header on. Lovely.

So I ordered a little USB breakout board and wired it to the pads on the underside of the PCB.

PAIR02.jpg
PAIR02.jpg (119.98 KiB) Viewed 6 times
PAIR03.png
PAIR03.png (295.76 KiB) Viewed 6 times

Then I needed an A to A USB cable to get from that to the PC. Could I find one? Of course not. So two cables got the chop and became one Frankenstein cable, wired straight through.

PAIR01.jpg
PAIR01.jpg (193.83 KiB) Viewed 6 times

Plugged it in and Windows actually saw the ESP straight away, so the wiring was right first time. Then Windows 7 decided it had no idea what it was and refused to install any drivers.

PAIR04.png
PAIR04.png (32.5 KiB) Viewed 6 times

Fine, there is a tool called Zadig for exactly this sort of thing. Except you tick "list all devices", pick the ESP interface, the list jumps about, and it very helpfully installed a USB driver on my keyboard instead. Keyboard dead. Excellent.

So then I am poking around Device Manager with a mouse trying to find my keyboard, chasing an "unknown device" which turned out to be nothing to do with it, before finally finding the keyboard hiding under "TOP PROGRAMMER", which is the driver group for my chip programmer. The programmer was not even plugged in.

PAIR05.jpg
PAIR05.jpg (368.86 KiB) Viewed 6 times

Uninstalled that, deleted the driver, plugged the keyboard back in and it came back to life. *phew*

Next attempt, Espressif's own driver package. That pops up wanting to install itself as "TOP PROGRAMMER" as well, which after the keyboard incident filled me with confidence.

PAIR06.png
PAIR06.png (115.72 KiB) Viewed 6 times

It only covers half of the ESP's USB port anyway, the JTAG side, and still no COM port. Turns out Windows 7 needs a separate little INF file for the serial side, which finally gave me COM4. Windows 10 apparently just does all of this by itself. Windows 7 does not, and it was not going to let me forget it.

PAIR07.png
PAIR07.png (22.76 KiB) Viewed 6 times

After all that, the actual flashing took about one second. Typical.

PAIR08.png
PAIR08.png (24.57 KiB) Viewed 6 times

The good news is the board then works properly. With test firmware on the ESP, the ST talks to it through the CPLDs and everything passes. Data goes both ways with no errors, a command and its reply takes about 225us, and it is doing about 517KB/s to the ESP and 602KB/s back, with a full 512KB each way. Most of that time is the 68000's copy loop rather than the board, so there should be more speed to come in the proper driver.

PAIR09.jpg
PAIR09.jpg (166.42 KiB) Viewed 6 times

Next job is updating the ESP firmware from the ST itself over the same link, so the USB lead should never be needed again (hopefully). Then I can find out if it can even see the WiFi, and more to the point the internet.

All that for a missing USB socket. Lesson learned. Probably.

:dizzy:
User avatar
exxos
Site Admin
Site Admin
Posts: 29920
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Phoenix Air - WiFi for the H5 Phoenix

Post by exxos »

Phoenix Air update, part two. Same evening, fewer casualties.

With the USB lead finally sorted, the plan was to make sure I never need it again. So the ESP firmware can now be updated from the ST itself. You put the new firmware file on the ST, run a little program, and it sends it to the ESP over the same link the ST talks to it on. The ESP writes it into a spare slot, checks it, and only then switches over. If anything goes wrong part way, it just carries on running the old one.

Naturally the first thing I did was run the updater before putting the firmware on that actually understands updates. To be fair to it, it spotted that straight away and refused to do anything, which is exactly what it should do.

POST2_01.jpg
POST2_01.jpg (91.83 KiB) Not viewed yet

So one last flash over the dodgy USB lead, and that is hopefully the last time it gets used.

POST2_02.png
POST2_02.png (37.7 KiB) Not viewed yet

Then the real test, updating the ESP from the ST. Out it went, the ESP checked it, restarted into the other slot and kept it.

POST2_03.jpg
POST2_03.jpg (121.27 KiB) Not viewed yet

This is how it currently looks, sat in the 5V bus IO port on the H5 Phoenix, with the USB breakout still hanging off it on a bit of wire just in case.

POST2_08.jpg
POST2_08.jpg (236.61 KiB) Not viewed yet

Next up, the bit I was most worried about, can it actually see the WiFi? New firmware went on from the ST, no USB needed, and it found my network straight away along with a couple of the neighbours. Names blacked out, as I would rather not advertise who lives where.

POST2_04.jpg
POST2_04.jpg (75.06 KiB) Not viewed yet

Picked my network, typed in the password, it joined, got an address from the router, and then looked up exxosforum and connected to it. So the ESP is officially on the internet. My password is blacked out in the photo as the first test program showed it on screen in full. The newer one shows stars instead, lesson learned.

POST2_05.jpg
POST2_05.jpg (111.28 KiB) Not viewed yet

Then I wanted proof that real data comes back, not just a connection. So I put a little text page on the forum server and had the ST download it over HTTPS. First attempt got a "301 Moved Permanently" back, because the forum redirects to the www address and the firmware does not follow redirects yet. At least that proved the secure connection to the server was working, which is the hard part.

POST2_06.jpg
POST2_06.jpg (151.61 KiB) Not viewed yet

Pointed it at the www address instead and there it is, the test page on the ST screen, downloaded over WiFi with HTTPS and checked by the ST.

POST2_07.jpg
POST2_07.jpg (134.67 KiB) Not viewed yet

One odd moment along the way where the ESP did not answer after a reset and was fine after another reboot, so that is one to keep an eye on.

So in one evening it has gone from a board that could not be programmed without a hacked up cable, to an ST pulling a web page off the forum over WiFi. Not bad for a board that was ordered without being checked.

Next job is the proper network driver so normal STiNG programs can use it, and teaching the firmware to follow redirects.
Post Reply

Return to “PHOENIX ZONE”