I've ported the code to a different device in the PIC24 family, added support for interrupts and a few bug fixes. I found some nice Arduino shield shaped PCBs with a bread board style layout on ebay for my latest prototype. The UART is connected to the usual Arduino RXD/TXD pins (lower right corner) so I will be able to stack my terminal shield on the top to add a display and keyboard.
Attachment:
File comment: Emulator on prototype shield
DSCN1529.JPG [ 2.08 MiB | Viewed 7995 times ]
The only components needed to make this work are two decoupling capacitor, a tantalum for the core voltage regulator and a pull up resistor on the reset - Two more resistors are needed for the ICSP programmer. I'm using the internal fast RC oscillator and the PLL to increase the speed to 70MIPs.
At the moment I'm using a USB CDC adapter to connect it to my laptop. I've written an emulation of key parts of Acorn MOS 1.20 so that I can get BBC BASIC working. This device only has 8K of RAM so the recursive part of the bench test does not work yet - I'm waiting for a chip that will allow 16K of RAM to be delivered and later in the year there will be a device that will support 32K.
The results from the bench test so far are:
Code:
>RUN
BBC BASIC CPU Timing Program
Real REPEAT loop Speed: 5.16MHz
Integer REPEAT loop Speed: 5.21MHz
Real FOR loop Speed: 5.36MHz
Integer FOR loop Speed: 5.23MHz
Floating-Point Test Speed: 5.99MHz
Ackermann Recursion
No room at line 180
>
The emulator supports all the 65C02 instructions and has a fully functioning decimal mode. Interrupts are trapped by the host and passed to the emulation for handling. Currently I'm only using a 100Hz timer interrupt but I will be adding a UART RX handler.
I use the 65C816 opcode (COP $02) to access the host processor. I currently have six functions (get last interrupt source, read memory, write memory, bit set, bit clear, get RAM size). You can see how these are used in the MOS listing.
All the unused I/O pins are available for use. Some changes are needed to the firmware to enable peripherals and select the pins that they will use.