After building the AVR 65C02 Simulator, I wanted to look for a board that ran much faster to port the code to. Speed is good, right? I bought an ARM dev board and tried the C code out on it. I ran faster than the AVR, but not by much. I had a Raspberry Pi and thought, this is a cheap and readily available platform that has all kinds of interface potential, and it was faster than my ARM board.
I started on the Pi B model, which has a single core and runs at 700Mhz by default. The C code ran at about 8 MHz. Terrible given the speed ratio. I took the plunge and dug into ARM assembly language. There is a huge bare metal Pi following and I started by looking at examples from those. In short time, I had a booting Pi into ARM assembler and ported the AVR assembly to the Pi.
Long story short, I got the caches and memory management unit working after much headache and was seeing speeds around 100MHz! Now that was more like it! I had my SBC Monitor running and talking through the built-in UART via terminal commands.
My next step was to try to get a video interface working. All the examples I could find were in C. So, I worked on porting the C code to ARM assembly. I also moved to the Pi 2, which has 4 cores.
As of this writing, I have my simulator running on the Pi 2 at about 98 MHz in core 0 and a video display working in core 2. The Pi has a mailbox system for the cores to intercommunicate on, so I set up one mailbox to pass point setting commands. I then worked up a screen saver from the SBC-3 in 65C02 assembly to run on the simulator. Here is a link to a short demo. Saver video clip
Not too bad. I plan to build a set of commands to allow for line, box, circle, and triangle plotting using core 2 so that the 65C02 can simply sent commands and let the ARM do the heavy lifting.
I have reconfigured the code to run in the Pi3B+ model. It runs at about 98MHz. I discovered that forcing turbo mode increased the ARM and video core clocks speeds which resulted in 220MHz speeds. Turbo mode causes extra heat in the IC's also, so use heat sinks and fans to keep it cool.
Next will be to get the USB controllers links so I can access the SD card, Ethernet, keyboard and mouse. Audio access also is on the radar. I am moving pretty slow, so do not get too excited yet.
I have added the ability to use you own ROM image in the simulator. You place a file named "sbcos.rom" in the root directory of the SD card and the simulator will try to load it. This is only on the Pi2 right now. I will eventually get it to the other versions as well. For those interested, here are links to the files you need to run the simulator on a Pi.
|Pi Models supported||Boot Files||Description|
|Pi A, Pi B, Pi Zero||pi1.zip||This is the simulator for the single core Pi's using UART0.|
|Pi 2||pi2sd.zip||This is the simulator for the 4 core Pi 2's. Supports serial terminal on UART0 and 320x200 display and ROM image loading from SD card|
|Pi 3B+||pi3.zip||This is the simulator for the Pi 3B+. Supports serial terminal on UART0 and 320x200 display. Non-turbo 95Mhz|
|Pi 3B+||pi3t.zip||This is the simulator for the Pi 3B+ running in Turbo Mode. Supports serial terminal on UART0 and 320x200 display. 220MHz!|
|Pi 3B+ SD||pi3sd.zip||This is the simulator for the Pi 3B+. Supports serial terminal on UART0 and 320x200 display and ROM image loading from SD card. Non-turbo 95Mhz|
|Pi 3B+ SD||pi3tsd.zip||This is the simulator for the Pi 3B+ running in Turbo Mode. Supports serial terminal on UART0 and 320x200 display and ROM image loading from SD card. 220MHz!|
|Pi 2, 3||saver.zip||This is the screen saver written in 65C02 assembly. Run the 'U' command in the simulator to load and run it.|