Note
YouTube walkthrough + setup coming soon!
The goal of the TinyLlama project is:
Last year I released [version 1 of the TinyLlama][tinyllama1].
While I was very happy with it and it worked great, there were a couple of things I felt were still missing + a few bugs.
The two main new features in version 2 are:
Both the CH559 and the ESP8266 can be easily re-flashed/programmed in-place.
Look at Programming the CH559 and [Programming the ESP8266][wiki-wifi].
Full BOM (bill of materials) can be found [in the wiki][wiki-bom].
Solder all components onto the TinyLlama rev2.1 PCB. As always, it's easier to start with the low-profile ones first, like resistors and capacitors. If you're willing to spend slightly more, I recommended you let the PCB manufacturer pre-assemble most of the common components for you. Plus, some of the SMD components can be a bit tricky to solder. Take a look at the [wiki][wiki-assembly] for more in-depth assembly instructions.
hidman-binary
folder. Alternatively, get the latest source code from the [official repo][hidman] and compile it yourself.WCHISPTool_Setup.exe
from [WCH's website][wch]. Unfortunately, this tool only supports Windows. If you're on macOS or Linux, maybe try using virtualization software, or even another computer.WCHISPTool_CH54x-55x
application.When purchasing the SOM-128-EX module from DMP, its ROM chip comes preinstalled with an Arduino-like bootloader which isn't what we want. Also, the "crossbar" is configured for using the module with the 86Duino Zero/One boards - meaning its default pin layout is completely different from what we need for the TinyLlama.
Follow these steps to flash the ROM with the TinyLlama BIOS for the first time:
INITBIOS.IMG
from this repo to the USB drive. Use [Balena Etcher][balena-etcher], or the command line if you know what you're doing (macOS example):
$ diskutil list
(Find your USB drive, eg. /dev/disk2)
$ diskutil unmountDisk /dev/disk2
$ sudo dd if=INITBIOS.IMG of=/dev/rdisk2 bs=1m
C:\>anybios w initbios.rom
...and reboot.
For subsequent BIOS updates, you can use the ROM's built-in virtual floppy drive available from the boot menu (press F12).
When booted from this you'll only need a regular USB stick (formatted as FAT16/FAT32) containing the new BIOS file.
A note on selecting the DOS type:
I've gone with MS-DOS 6.22 for maximum compatibility.
If you prefer FreeDOS (or another DOS variant), prepare a bootable USB installer disk and use that instead of the built-in virtual floppy.
fdisk
from the command prompt to partition the SD/USB drive and set it to be Active
.format c: /s /u
to format the drive and copy over system files. Finally use fdisk /mbr
to make sure the Master Boot Record is correct and the drive should be bootable.DOS
folder from A: to C:.CONFIG.SYS
and AUTOEXEC.BAT
files to your liking, or more conveniently, just run the SETUP.BAT
script that'll do this for you. The provided config files lets you choose from a clean boot or a QEMM-based one with XMS, EMS and 631 kB of free conventional memory.CS4237B
and UNISOUND
folders from this GitHub repo over to your SD/USB boot drive and start the system.RESOURCE.EXE
command below and check that you get the same output:
C:\>cd cs4237b
C:\CS4237B>resource /f=0x120 /r=cs4237b.asm /e
Reading data from CS4237B.ASM Length = 292 Programming EEPROM Block: 1 2 EEPROM programmed
Verifying EEPROM: Verifying CS4237B.ASM against EEPROM . . . Verified OKAY
3. Make sure the correct `BLASTER` environment variable is set and `UNISOUND.COM` command is called from `AUTOEXEC.BAT`. Note that the 8-bit DMA channel is **1** and the IRQ is **7**:
SET BLASTER=A220 I7 D1 P330 T4 C:\UNISOUND\UNISOUND.EXE /V60 /VW60 /VF60 /VL60 /VP60 /VC0 /VM0
4. Reboot the system, and you should get the following output:
PnP card found: [CSC7537] CS4237B BLASTER environment var found! Loading settings... ADD:220 WSS:534 OPL:388 IRQ:7 DMA:1/1 MPU:330/I9 CTR:120 JOY:200 Initialization done. Crystal Mixer [VOL:85 WAV:80 FM:80 LIN:0 CD:0 MIC:0]
5. Feel free to experiment with the different volume levels, look at the `C:\UNISOUND\UNISOUND.TXT` file for further guidance.
6. Fire up a few games to test that Adlib, SoundBlaster FM and digital sound effects are working properly.
## MT-32 / General MIDI
If you've installed [mt32-pi][mt32-pi] on a Raspberry Pi Zero 2 and connected it to the TinyLlama, it should be ready to go using IO port 330. Use the third button from the left (labeled "SYNTH_SW" on the PCB) to switch between MT-32 and General MIDI mode.
If you want to play old games that require "MPU-401 Intelligent Mode" (Sierra games, Monkey Island 1, etc), try running [SoftMPU][softmpu]:
C:\SOFTMPU>softmpu /mpu:330 /sb:220 /irq:7
If you want to hook up an I²C OLED display to the mt32-pi, there's a pin header on the TinyLlama labeled "I2C_OLED". The order of the pins from 1 to 4 is: GND, VCC, SCL, SDA with pin 1 being the one closest to the 3.5mm audio jack.
## WiFi Connectivity
There's a [section][wiki-wifi] in the wiki dedicated to this, take a look.
## Wiki
For an in-depth discussion of the various components, installation, configuration, etc, take a look at the [wiki][wiki].
## Help
This project is indended for people with a fair bit of hardware- and DOS knowledge. If you have questions or need help, please look at the [wiki][wiki] and [FAQ][wiki-faq] section first.
## Roadmap
Coming.
In the mean time feel free to post [an issue][issues] if you have tips, suggestions or want to report an error.
## License
[GNU General Public License v3.0](LICENSE)
## Contact
Development thread: [Vogons][vogons-thread]
Mastodon: [@eivindbohler@techhub.social][mastodon]
Twitter: [@eivindbohler][twitter]
YouTube: [@eivindbohler][youtube]
## Acknowledgements
Many thanks to
- [Sergey Kiselev][sergeys-projects] for sparking my interest in designing and building computers.
- [Rasteri][rasteri-videos] for introducing me to the CS4237B chip.
- [The Vogons forum][vogons] for inspiration, help and support.
- [86Duino / DMP][86duino] for making a great and affordable system-on-module.
- [Dale Whinham / mt32-pi][mt32-pi] for making the best synth emulator software.
[tinyllama1]: https://github.com/eivindbohler/tinyllama
[hidman]: https://github.com/rasteri/HIDman
[wiki-alternative-gpus]: https://github.com/eivindbohler/tinyllama2/wiki/alternative-gpus
[bios]: https://github.com/eivindbohler/tinyllama2-bios
[wiki]: https://github.com/eivindbohler/tinyllama2/wiki
[wiki-assembly]: https://github.com/eivindbohler/tinyllama2/wiki/assembly
[wiki-bom]: https://github.com/eivindbohler/tinyllama2/wiki/bom
[wiki-faq]: https://github.com/eivindbohler/tinyllama2/wiki/faq
[wiki-wifi]: https://github.com/eivindbohler/tinyllama2/wiki/wifi-connectivity
[balena-etcher]: https://www.balena.io/etcher
[mt32-pi-oled]: https://github.com/dwhinham/mt32-pi/wiki/LCD-and-OLED-display
[wch]: http://www.wch-ic.com/products/CH559.html
[issues]: https://github.com/eivindbohler/tinyllama2/issues
[vogons-thread]: https://www.vogons.org/viewtopic.php?t=84880
[mastodon]: https://techhub.social/@eivindbohler
[twitter]: https://twitter.com/eivindbohler
[youtube]: https://youtube.com/@eivindbohler
[sergeys-projects]: http://www.malinov.com/Home/sergeys-projects
[rasteri-videos]: https://www.youtube.com/user/TheRasteri/videos
[vogons]: https://www.vogons.org
[86duino]: https://www.86duino.com
[mt32-pi]: https://github.com/dwhinham/mt32-pi
[softmpu]: http://bjt42.github.io/softmpu