Close
0%
0%

8-bit in style: the PIC18 computer

My attempt to create a fully expandable 8-bit system built around a modern architecture

Public Chat
Similar projects worth following
I have been contemplating an 8-bit system for quite a while now and finally decided to get on with it. It is not the first 8-bit computer that I am creating, but (potentially) could be the last. That’s why this time I wanted to put more attention to every little detail in the concept.

The Base18 computer is a fully open and expandable system built around the 8-bit PIC18 core.

This is an ongoing project. I am currently making the early prototype for the hardware. The software is still in pre-work stage.

During the development I had to make several difficult decisions:

1. The platform

I had a number of contenders initially for the choice. Quickly dismissed all the “old-school” such as the ones from Zilog, Motorola, Intel, as well my favourite 6502. There are hundreds of systems (including some of mine) already built around them, so there won’t be anything new with just another one. In addition to that, some parts are getting obsolete and very difficult to find. And finally, there won’t be any educational benefit to anyone in a system that uses architecture which has not been mainstream for many years already.

I then went through all other current 8-bit platforms and in the end narrowed the choice down to two options – PIC18 or AVR8. The latter is arguably the best 8-bit architecture every created and presents a really attractive option. I however decided to build the computer around PIC18 because no one has ever made a decent open and expandable system around it, and it also offers more fun in the process.

As much controversial and unloved the 8-bit PIC architecture is, it is also the most used one. The number of PICs currently ticking worldwide dwarfs any other 8-bit platform, and is many times greater than all systems with all the original “dinosaurs” put together. No one knows everything of course, but there is no excuse to anyone not to know the 8-bit PIC architecture :-)

Besides, programming for PIC with all its limitations and quirks has its own charm and fun that one can’t find while developing on a more sophisticated core.

I had hard time finding a suitable chip that won’t be too limited for the purpose. The number of PIC18s that can address external memory is counting on the fingers of one hand. Finally, I chose the excellent PIC18F87K22. It is an amazing piece of tech that ticks all the boxes – 8-bit PIC18 core, active market product, external memory bus, can operate as open system microprocessor instead of closed system microcontroller, not full of internal peripheries, reasonable package, and finally – no USB. About the last one - I personally consider the USB an insult to all engineers, hardware and software, so finding a good chip that doesn’t have it - I could not be any luckier than that. The PIC18F87K22 is a modern 8-bit chip that fits exactly my needs for this project!

2. The system architecture

Unlike all previous computing systems that I have built, this one is not a single-board computer. Instead, it is a hybrid in which the main board can still be operational on its own, but offers only the most basic functionality while everything else needs to be added on a system bus as controller boards. This model creates maximum flexibility in terms of hacking potential. My inspiration and benchmark for this system came both from the excellent RC2014 computer, and the “master of them all” – the original IBM PC (although technically it is considered a 16-bit machine), however I put a slightly different goal ahead with an attempt to create a true 21st century 8-bit system that appeals not only to the 40+ generation while still maintaining the “retro” style.

I also wanted to stick to maximum simplicity in every move, so the system bus has the basic control lines, but no complex glue logic or anything of the sort. There is also the PIC18 on the main board, however a controller can disable it and install a different processor, or work alongside to create a multiprocessor system. Disabling the on-board PIC is done in the simplest possible manner – a controller simply needs to hold the MCLR line low (that doesn’t affect the main bus RESET line).

The PIC18F87K22 chip is a weird case of an 8-bit architecture with 16-bit external data bus (exactly the opposite of Intel 8088!). Fortunately there is the possibility to configure the external bus to use 8 bits only. I took that route for simplicity. The chip also comes with a small number...

Read more »

Base18 entry pack.zip

Full manufacturing pack of Base18 and some cards as well as firmware as of 31 October 2019

x-zip-compressed - 17.29 MB - 10/31/2019 at 16:45

Download

B18 Proto 32x18.zip

Full manufacturing pack for the 32x18 holes prototype card

x-zip-compressed - 3.14 MB - 07/22/2019 at 10:55

Download

B18 Card Template.zip

Altium format PCB file

x-zip-compressed - 1.65 MB - 07/21/2019 at 19:42

Download

Base18 Card.pdf

Bus connector schematic

Adobe Portable Document Format - 153.77 kB - 07/21/2019 at 19:42

Preview
Download

Base18 Card 3D.pdf

3D PDF rendering

Adobe Portable Document Format - 109.39 kB - 07/21/2019 at 19:42

Preview
Download

  • 1 × PIC18F87K22-I/PT Microprocessors, Microcontrollers, DSPs / Microcontrollers (MCUs)
  • 1 × SN74LVTH573NSR Logic ICs / Buffers, Drivers, Transceivers
  • 1 × OKL-T/3-W12P-C Power Management ICs / Power Supply Modules

  • GitHub

    Kn/vD07/11/2020 at 10:22 0 comments

    Just made all files available on Github.

    https://github.com/knivd/Base18

  • First release

    Kn/vD10/31/2019 at 16:55 0 comments

    Ok, the time has come to start releasing some files :-)

    This link contains everything needed to build a simple Base18 system with RAM and SD card, and program it with the firmware as it is on 31 October 2019.

    Of course, the hardware is still pretty much in alpha stage, some things may work, some may not. I am still testing and will be providing updates in due time. The firmware is almost at "release" stage and I will release the sources once there is enough third-party evidence that the system actually works elsewhere away from my desk.

    In the final hours I decided to through in a simple PIC18 disassembler built into the system monitor. That went quite well, but unfortunately on the expense of a few KB from the IFS: drive. So, IFS: is down to the absolute possible minimum now, but at least still there.

    My plan for finalising the development of the firmware includes some sort of absolute bare bone scripting automation so files can be started automatically on power on, or from other files. Maybe a few extra entries in the BIOS function table as well.

    That's for now...

  • First Youtube video!

    Kn/vD10/19/2019 at 20:31 0 comments

    Behold! The first and only native working PIC18 computer :)

  • First assembled look

    Kn/vD09/15/2019 at 16:26 0 comments

    Here it is, plus two boards for SD interface and 128k memory.

    Still some work left on the software before it becomes an actually presentable system, but slowly getting there. I think it will turn out well (we'll see)...

  • Prototyping card

    Kn/vD07/22/2019 at 09:33 0 comments

    I should have started with this one probably, but here we are anyway - a nice and round 32 x 18 sea of holes card for Base 18 :-)

  • Template for Base 18 cards

    Kn/vD07/21/2019 at 19:40 0 comments

    Before I started designing various cards, I made this template which removes for me the boring parts in the job. I use Altum in my designs, hence the file here is for Altium, but it can (probably) be exported to another software as well.

    This is what a blank "standard" card for Base 18 looks like:

    And looking from the side:

    A standard vertical through-hole header slides into the PCB and is soldered in surface mount way. 

    The template card has dimensions 86 x 55mm.

    The best PCB thickness for this method is 1.8mm, but the standard 1.6mm works perfectly fine too. I have specified some header model from Samtec, simply because they have an excellent configuration tool. In reality any 60-pin dual row header, ideally with 5.84mm contact height, will do exactly the same job. I had difficulties finding exactly 60-pin headers, but the 80-pin ones are quite common and cheap on Aliexpress and everywhere else, so I took a bunch of those instead to cut them to size whenever that will be needed.

    Pin one is on the top side of this board and where it is marked with a straight angle instead of rounded like elsewhere.

    The schematic for the bus connector:

    The bus has two separate reset signals - MCLR# and RESET#.

    The first one applies to the PIC18 on the main board only, while the second one is general for the entire system. The RESET# signal also takes precedence over MCLR# in such way so when RESET# is brought low, MCLR# also becomes low, but if MCLR# is low, it does not affect the state of RESET#. Thus a controller card could disable the on-board PIC18 by simply holding the MCLR# in low and then take over the entire bus by installing a different processor instead.

    Another part to mention are the unoccupied pins 3 and 4. The reason for that is to mitigate any potential harm coming from reverse installed cards. In this case - the "dangerous" lines carrying the raw input voltage (anything between 5V and 14V) will fall into the unconnected slots.

    Pin 55 on the bus also has the specific purpose to prevent reverse connected cards. Its 180 degree counterpart is exactly the RESET# signal, so any (assuming properly designed) card that is connected reverse on the bus will cause the signal RESET# being kept permanently low, thus preventing any unwanted damages to the main board or the controller card.

    I am currently making the first generation prototypes of the main board and several cards. Once they turn up here and hopefully work, I will start publishing more detailed schematics.

    And finally, the PCB drawing for the card template:

    This template is available as Altium PCB file in the project files section.

  • 8255 PIO 5V card

    Kn/vD07/21/2019 at 10:46 0 comments

    For support of all those retro interfaces at 5V here is a card based on the popular 8255 controller. Since this is a 5V card, it will require the 3V-5V voltage translator.

  • 5V interface card

    Kn/vD07/20/2019 at 18:00 0 comments

    The main concept of Base 18 is to use modern components (without compromising human-friendly solderability), and that is in the core of its 3.3V logic main bus. There are still number of old parts out there that work on 5V bus only. I want to connect the two worlds and that's why I designed this 3V-5V interface plugin. It converts the B18 bus to 5V levels along with bus supply of 5V, instead of the original 3.3V. 

    A B18 card in standard format can now connect on top just like any normal card. This one is solderable by hand but requires a bit more skill since the level shifters are SOP 0.65mm pitch, and in addition to that - there is another header to be soldered on the bottom side of the PCB. The passive components are still 1206 size, though.

    I am making prototype PCBs and will be posting further updates in due course.

  • RTC card

    Kn/vD07/19/2019 at 09:22 3 comments

    This one is done "the proper way" :)  Not I2C or SPI, but with address decoding and mapped into the main address space. Unfortunately there are not many manufacturers who still make RTC ICs with parallel bus. In fact, except Maxim there are hardly any others. Fortunately this good chip from TI is perfect for the need. Not the cheapest option on the market, but still bearable price.

    Sending this one the factory way too, for prototype PCBs.

  • External RAM 128K

    Kn/vD07/18/2019 at 11:00 0 comments

    Just finished my new B18 card. This one is a cheap external RAM 128k that occupies the bus addresses 0x20000 - 0x3FFFF.

View all 11 project logs

Enjoy this project?

Share

Discussions

freefuel wrote 03/15/2022 at 21:22 point

Can you fit the processor on it's own card? In doing so a passive backplane could be used for the expansion cards. thus only a single investment could be reused as the design evolves. 

  Are you sure? yes | no

Kn/vD wrote 03/16/2022 at 08:44 point

Of course, that is quite an easy thing

  Are you sure? yes | no

freefuel wrote 03/17/2022 at 06:52 point

Have you had a look at early UNIX source code, or other POSIX compliant operating systems? 

  Are you sure? yes | no

crun wrote 07/02/2020 at 03:36 point

Flashforth gives you a PIC18 high level language running on it. It's pretty extensive, and giving you an onboard assembler as well. http://flashforth.com/pic18.html

  Are you sure? yes | no

freefuel wrote 07/02/2020 at 02:29 point

I'm interested in this project, however I'd like to build it out on a 16 bit ISA card for use in a passive back plain, there are a number very useful video and sound cards already in existence for that bus.  

  Are you sure? yes | no

Kn/vD wrote 07/02/2020 at 08:23 point

That sounds like a good idea, however without further examining I am not sure if the PIC will be able to maintain proper timings for third-party ISA cards... One thing that I learned from this project is that the external RAM should be on a 16-bit bus for itls optimal performance, otherwise the speed of the RAM is not enough to cover two PIC18 cycles

  Are you sure? yes | no

freefuel wrote 03/17/2022 at 07:01 point

I'm still working towards a tool for matching up bus interfaces. where you can select drop down ticbox options and have the conflicts highlighted. 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates