Loading 3D model… large boards can take a moment.
I have an blog where I will post my progress and thoughts when I have some spare time: https://brorson.se
A overambitious project to build a usable computer from scratch. Based on bits and pieces from the interwebb, but with my own twists and turns. This main README will change frequently when I change my mind and decisions.
It's not the goal that matters, is the journey....and it's true. Getting your thoughts and ideas into circuits and code is an iterative process, and for each success you get satisfaction. For every failure.....you get a reason for a big drink and rethink your decisions, just to fix the issue and start an new iteration. Add oh boy, the satisfaction when your idea works...priceless!
Some decisions made from my part:
Initial hardware:
I keep it simple, and plan using the VBR register in the MC68010, so there is no shadowing or moving of ROM in my design.
| Address | Description |
|---|---|
| 0x00000000 - 0x000FFFFF | ROM ( 2 x 512K) |
| 0x00100000 - 0x001FFFFF | Onboard RAM (1 MB) |
| 0x00200000 - 0x00CFFFFF | Space for additional (14 MB) RAM |
| 0x00D00000 - | I/O space (2 MB) |
| 0x00D00000 - 0x00D0FFFF | DUART (64KB) |
I have switched to use https://github.com/tomstorey/m68k_bare_metal as base for my project instead of inventing all by myself. Sure, my linkerscript, Makefile and stuff was not bad, but was very bare bone. Even if there are a little more assembly, the structure is is more usable as defining exception vectors and stuff are easier. So instead of continuing and reinvent the wheel, I made the choice to use som clever stuff from github. Tom, you made me see a different (and more professional) way of doing stuff by the way you structured your code. Especially the linkerscript was an huge improvement over my amateur cocktail of C code.
All old firmware code are now in the /old_stuff folder and all new under /mb68k_bare_metal/mb68k My headerfiles used for my specific board is located under /mb68k_bare_metal/include
0.1.10 - Use of new approach for using C and design wise introducing buffers and more GALs
0.1.9 - A lot of reshuffeling
0.1.8 - Switched to PlatformIO for Arduino stuff
0.1.7 - Got the firmware to configure DUART and spit out stuff on the terminal in sim68000 using pure C. Hardware is tested in an sense that I can control the DUART from an Arduiono Mega, and the CPU stuff on the breadboard is free running, and are awaiting the pairing of DUART and firmware code.
0.1.6 - Cleaned upp some code and added some README stuff. All prototypes now in headers.
0.1.5 - Just cleaning stuff
0.1.4 - Milestone. Got my bare Firmware (just ending in an loop) running in sim68000
0.1.3 - Just a bunch of renaming and updates of README files. In essence, cleaning up my own mess
0.1.2 - Milestone. I finally got the grips on gcc, linkerscripts, .map files etc. Building an ELF and object dump an binary now generates binary file with an valid reset vector and correct sections copied to RAM. What a fun ride it have been.
0.1.1 - Milestone. Got a free running CPU stepping through memory and blinking leds, by tying databus to ground (all zeros) throug pulldown resistors
Currently using GCC on Ubuntu 20.04 cross compiled for m68k. In parallel building an LLVM toolchain for exploring the capabilities of using Rust and/or Zig instead of C. This is somewhat in an experimental phase, as some basic compilation efforts on LLVM and Rust/Zig is currently beeing tried out. My toolchains run in docker, and Dockerfiles can be found in the [toolchains] folder.
| Folder | Description |
|---|---|
| code | Code for firmware and other stuff goes in here |
| kicad | KiCAD 7.x schematics |
| digital | Digital simulator for messing with glue logic and generation WinCUPL code in the end |
| toolchains | Things related to toolchains. Docker files etc |
| tests | Arduino stuff used to test and program various parts of the design |
MC68000/10 memory mapping and external pheripherals are always an challenge. That said, the m68k has the most beautiful register/memory layout and assembler syntax known to man. If todays CPU's had this layout, ohh man... Normally external peripherals only use a few address lines and more importantly only half the data bus (unless on an MC68008). What this means is that you really need to understand how the processor address memory and in which order it's doing stuff. First of all, as you might have noted on the CPU there is no address line of 0. First physical address line is A1, which will cause som confusion to newbies (as it did to me!). To explain this we need to understand two other physical pins on the CPU: UDS and LDS. UDS means Upper Data Strobe, and LDS means Lower Data Strobe. These pins define if you are in the upper 8-bit or lower 8-bit of an word (16 bit).
Now, this is what caught me, since the CPU is Big Endeian, even adresses is always the upper 8-bits. Easiest way of explain this is by starting at at the lowest address in hex: 0x00000000. This is an even address, and accessing this address will assert the UDS-pin signaling that the upper 8-bits of the data bus will be read/written from/to (bit 15-8). When designing your memory map, things can be confusing. Let us say that memory 0x00000000 to 0x000FFFFF is your first MB of RAM, and you think that address 0x00100000 is the first byte in the I/O space, you would be wrong. Address 0x00100000 is the upper 8-bits of the 16-bit word, and if you have the pheriperal connected to the D0-D7, the effective address is actually 0x00100001!.
What this means is, that you need to take care when accessing 8-bit memory mapped peripherals. Let us take an simple example here using the MC68681 DUART chip as an example. It has an 4-bit addressing bus for it's registers that we normally connect to A1-A4, and an 8-bit address bus, connected to the A0-A7 physical bus. According to the documentation the registers are one byte in between on the chip itself.
But this is not true in the scope of the CPU, as the most significant byte is never seen by the chip. It sees A1, not A0(UDS). In effect, this means that your code needs to have an offset of two(2) whereas the chip has an offset of only one(1). In general, working with bytes is an pain as you need to think about alignment, and if possible use words....
No comments yet. Be the first to ask about this board.