External communication with the X16 (UART, NIC, FlashAir?!)
Posted: Sat Jan 20, 2024 4:38 am
Many of us are still waiting for a hardware solution to communicate remotely with an X16. This is one of those thing where (at least in my opinion) it is harder for an emulator to be used to help develop. So it is great more folks are getting their hands on hardware, to start tinkering with ideas for peripherals.
External communication isn't just about web-surfing on an 8-bit, such as with an on-system web browser or hosting a server. Personally I don't see the need to even try to render any portion of a modern web page in 640x400. Rather, the interest here is for two main motivations:
(1) As a way to more easily "push" new software onto the system or do updates on versions of existing software. As lazy as it sounds, shuffling files manually across an SD card isn't fun (and it's also arguably error prone as each time removing/inserting the SD card is wear and tear on the equipment; but also a small things like you lose your CWD when you remove the SD).
(2) The joy of using an 8-bit for as a client to IRC and visiting the BBS'ing experience. There are a few "authentic" original BBSs still hosted on their original systems - many BBS's are really just a special form of telnet that happen to use ANSI codes and accommodate 80x25 screens.
NOTE: while a classic 8-bit, or the X16 itself, could host a BBS - it would probably be limited to one or very few users at the same time -- that's generally how you can tell if you are connecting to an "authentic" BBS: if you get a "busy" signal or it says some user is already connected. And as silly as a limitation as that sounds, philosophically I think it is a defining aspect of pre-internet era - that of limited resources, forcing for those who couldn't get a connection to go do something else (and that is also why BBS's had daily usage limits for users in minutes - so they couldn't hog the whole system for the entire day; a concept that I wish certain social media sites would adopt; I was a BBS SysOp for many years).
NOTE: One of my favorite still-active BBS's is aBSiNTHE BBS (which is ran on an Amiga and is quite a custom piece of software). One quaint thing about it is as you log off, you have an option to add a paragraph or portion to a story. We did things like that in middle school, we'd pass a journal around and people add a sentence or two, and (usually) you end up with a comical story. It's a special aspect that only a BBS can offer, as modern 24/7 social media has no concept of "logging off" or ending your session for the day.
Anyhow, some notes in where we're at on external communication capability:
#1) Onboard user-port: VIA #2 now has a NMI option. This should be more feasible to port over the RS232 code, such as what is located here: (or the rs232_userport.s)
https://github.com/mist64/ccgmsterm/blo ... 2_up9600.s
The X16 Technical Reference notes on the VIA port-mapped addresses is described here:
https://github.com/X16Community/x16-doc ... ramming.md
While it won't be the most glorious high speed connection, the point is that it is very minimalistic: no additional hardware and should be able to communicate across using just 3-wires. And you can communicate with other ancient systems, including even PDP-8's and Altair's.
#2) Expansion board UART: This will come eventually. In a nutshell, UARTs offer "hardware accelerated" buffering, even if just a few bytes it makes a big difference in offloading the CPU to handle other things while TX/RX'ing serial data. The original IBM PC 5150 had no onboard serial solution, it depended on the IBM serial card with an 8250, achieving only up to 9600 baud.
#3) NIC solution: Onboard TCP/IP will be a challenge. There is an ip65 github repo (associated with cc65), but looks like it hasn't been touched since 2012.
https://cc65.github.io/ip65/
Note that M. Brutman has made a suite of TCP/IP client utilities for 16-bit x86, most fitting within 64K. While it is x86 code, point is that it shows an 8-bit up to the task. He's still active and might be a good source of ideas and info on implementing this on a resource-limited system:
https://www.brutman.com/mTCP/
These are great tools for on-system telnet, ftp (client and server), sync'ing time across internet (SNTP), etc.
But obviously that needs some hardware support to go with it, and the mTCP suite does depend on routines from both MS-DOS (ilke for file i/o) and a 3COM driver.
#4) I've started experimenting with the Toshiba FlashAir WiFi SD card on the X16.
I don't yet recommend it. First note: Avoid the 8GB (W-02) version, I can't find any firmware update software for that. That version did let me read the SD card files over WiFi (from its own built in browser-interface), but not write (and only using a limited web interface). Per the article below, the newer W-03 and W-04 models can be firmware updated for more seamless file-explorer type access:
https://mattshub.com/blogs/blog/flashair-sd-card
I'm waiting for my 16GB FlashAir W-04 to show up. Another issue with the W-02 8GB version was it used 8.3 length filenames - so hopefully that won't be the case on the W-04 version. (i.e. maybe it was an assumption that the web interface on the W-02 had, but across a proper file explorer long names will be supported? TBD).
I'm going to skip the EZ SHARE SD card, as so far I haven't seen any review that suggest it has a file explorer type interface. But I'll report more on the FlashAir once I'm able to test it further. These devices use the power off SD pins to host their own WiFi SSD. Toshiba and other companies have stopped making them for now, so they can be hard to find.
Eventually an expansion card with a UART will be more widely available, but will still require its own software API (maybe a ROM slot can be reserved for that API once the h/w becomes more formalized - that's essentially how the Deluxe RS232 on the ColorComputer worked, it had some onboard ROM API to help software do TX/RX of bytes, using a 16450 UART I think).
External communication isn't just about web-surfing on an 8-bit, such as with an on-system web browser or hosting a server. Personally I don't see the need to even try to render any portion of a modern web page in 640x400. Rather, the interest here is for two main motivations:
(1) As a way to more easily "push" new software onto the system or do updates on versions of existing software. As lazy as it sounds, shuffling files manually across an SD card isn't fun (and it's also arguably error prone as each time removing/inserting the SD card is wear and tear on the equipment; but also a small things like you lose your CWD when you remove the SD).
(2) The joy of using an 8-bit for as a client to IRC and visiting the BBS'ing experience. There are a few "authentic" original BBSs still hosted on their original systems - many BBS's are really just a special form of telnet that happen to use ANSI codes and accommodate 80x25 screens.
NOTE: while a classic 8-bit, or the X16 itself, could host a BBS - it would probably be limited to one or very few users at the same time -- that's generally how you can tell if you are connecting to an "authentic" BBS: if you get a "busy" signal or it says some user is already connected. And as silly as a limitation as that sounds, philosophically I think it is a defining aspect of pre-internet era - that of limited resources, forcing for those who couldn't get a connection to go do something else (and that is also why BBS's had daily usage limits for users in minutes - so they couldn't hog the whole system for the entire day; a concept that I wish certain social media sites would adopt; I was a BBS SysOp for many years).
NOTE: One of my favorite still-active BBS's is aBSiNTHE BBS (which is ran on an Amiga and is quite a custom piece of software). One quaint thing about it is as you log off, you have an option to add a paragraph or portion to a story. We did things like that in middle school, we'd pass a journal around and people add a sentence or two, and (usually) you end up with a comical story. It's a special aspect that only a BBS can offer, as modern 24/7 social media has no concept of "logging off" or ending your session for the day.
Anyhow, some notes in where we're at on external communication capability:
#1) Onboard user-port: VIA #2 now has a NMI option. This should be more feasible to port over the RS232 code, such as what is located here: (or the rs232_userport.s)
https://github.com/mist64/ccgmsterm/blo ... 2_up9600.s
The X16 Technical Reference notes on the VIA port-mapped addresses is described here:
https://github.com/X16Community/x16-doc ... ramming.md
While it won't be the most glorious high speed connection, the point is that it is very minimalistic: no additional hardware and should be able to communicate across using just 3-wires. And you can communicate with other ancient systems, including even PDP-8's and Altair's.
#2) Expansion board UART: This will come eventually. In a nutshell, UARTs offer "hardware accelerated" buffering, even if just a few bytes it makes a big difference in offloading the CPU to handle other things while TX/RX'ing serial data. The original IBM PC 5150 had no onboard serial solution, it depended on the IBM serial card with an 8250, achieving only up to 9600 baud.
#3) NIC solution: Onboard TCP/IP will be a challenge. There is an ip65 github repo (associated with cc65), but looks like it hasn't been touched since 2012.
https://cc65.github.io/ip65/
Note that M. Brutman has made a suite of TCP/IP client utilities for 16-bit x86, most fitting within 64K. While it is x86 code, point is that it shows an 8-bit up to the task. He's still active and might be a good source of ideas and info on implementing this on a resource-limited system:
https://www.brutman.com/mTCP/
These are great tools for on-system telnet, ftp (client and server), sync'ing time across internet (SNTP), etc.
But obviously that needs some hardware support to go with it, and the mTCP suite does depend on routines from both MS-DOS (ilke for file i/o) and a 3COM driver.
#4) I've started experimenting with the Toshiba FlashAir WiFi SD card on the X16.
I don't yet recommend it. First note: Avoid the 8GB (W-02) version, I can't find any firmware update software for that. That version did let me read the SD card files over WiFi (from its own built in browser-interface), but not write (and only using a limited web interface). Per the article below, the newer W-03 and W-04 models can be firmware updated for more seamless file-explorer type access:
https://mattshub.com/blogs/blog/flashair-sd-card
I'm waiting for my 16GB FlashAir W-04 to show up. Another issue with the W-02 8GB version was it used 8.3 length filenames - so hopefully that won't be the case on the W-04 version. (i.e. maybe it was an assumption that the web interface on the W-02 had, but across a proper file explorer long names will be supported? TBD).
I'm going to skip the EZ SHARE SD card, as so far I haven't seen any review that suggest it has a file explorer type interface. But I'll report more on the FlashAir once I'm able to test it further. These devices use the power off SD pins to host their own WiFi SSD. Toshiba and other companies have stopped making them for now, so they can be hard to find.
Eventually an expansion card with a UART will be more widely available, but will still require its own software API (maybe a ROM slot can be reserved for that API once the h/w becomes more formalized - that's essentially how the Deluxe RS232 on the ColorComputer worked, it had some onboard ROM API to help software do TX/RX of bytes, using a 16450 UART I think).