Blink Demo

Posted on zo 29 april 2018 in Retro-uC

Intro

In order to show the progress I made on the Retro-uC a short video is presented with a demo with the Retro-uC running on an FPGA.

For the demo an Alorium XLR8, a Velleman VMA201 proto shield and a Dangerous Prototypes BusPirate V3.6 were used. On the proto shield LEDs and accompanying resistors have been soldered on the D2-D9 Arduino IOs.

The Retro-uC core used has the Z80 and the MOS6502 and a JTAG interface. In the video below a demo is giving by blinking the LEDs on the proto shield in four different ways:

  1. The LEDs are blinked using the JTAG boundary scan method. This is a standardized way of accessing the IOs on a chip through the JTAG interface. This feature will also allow to easily test PCBs in a standard way that contains the final Retro-uC chip.
  2. The LEDs are blinked by writing to the memory locations where the IOs are memory mapped. The JTAG interface in the Retro-uC has custom memory access commands and these can be used to write in the memory locations. On the Retro-uC the IOs are memory mapped and their state can be changed this way through the JTAG interface.
  3. The LEDs are blinked by a Z80 program. The Retro-uC will have on-chip SRAM and on the XLR8 MAX10 block RAM is used. The JTAG memory access commands are now used to load the program in the on-chip RAM and enable the Z80 core. The Z80 is compiled from a C program using the SDCC compiler.
  4. The LEDs are blinked by a MOS6502 program. The same C program as before has now been compiled using the cc65 compiler.

Finally the Retro-uC is reset by pressing the Reset button.

The Binaries and the Source

The source code for the demo is available on the Retro-uC gitlab repo and the XLR8BlinkDemo_20180429 tag corresponds with the state of the code as used for the demo. The file XLR8BlinkDemo_20180429.tgz attached to the tag contains the release files that allows to redo the demo on your own.

Some more detail on how the different files are generated (all files are referred to the top of the Retro-uC gitlab repo and commit of the tag):

  • The bitstream for the MAX10 Altera FPGA on the XLR8 is generated with Quartus Prime Lite version 17.1.0. The project files are located in boards/XLR8/quartus with Retro-uC.pqf the top project file to be loaded in Quartus. The code uses a few git submodules (links also refer to commit as used for the demo):

    • T80: Z80 RTL code
    • T65: MOS6502 RTL code
    • C4M::JTAG: my own developed JTAG RTL code. Plan is to give more details on this code in one of the next blog posts.

    This is combined with Retro-uC specific code:

    • rtl/vhdl: Generic Retro-uC RTL code, containing wrappers around the mentioned submodules and the top control module.
    • boards/XLR8/rtl/vhdl: The XLR8 specific code, containing the top module that mainly maps the XLR8 specific IO pins to the generic one from Retro-uC.
  • boards/XLR8/demo: The demo files.

    • buspirate.cfg & playsvf.sh: Support files for using OpenOCD to access the JTAG interface
    • blink_boundaryscan.svf & blink_memmap.svf: hand written SVF files
    • In leds_c the C code is available together with the compile.sh scripts the generates the two other svf files using the two C comilers mentioned earlier.

If you want to redo the demo from the release tarball the included README details how to program the XLR8 and run the tests. One warning though: when the Retro-uC core is programmed on the XLR8 it can't be accessed anymore through the Arduino IDE and needs to be accessed through the JTAG pins. So only do the demo if you feel comfortable with this.

Feedback

I am interested in all feedback; be it questions & comments or ideas, tips, tricks etc. Feedback can be given on the log on the Retro-uC Hackaday project page or through an email.