• Pico adventures

    adam.klotblixt02/13/2021 at 19:37 0 comments

    I bought a Raspberry Pi Pico, couldn't help myself! The RP2040 is a very nice micro-controller, and the $4 is extremely cheap for what you get!

    I've spent some time reading the very good datasheet to get a fuller understanding of what it can do, and I am sure that I will spend more time in the near future to try out PZ1 6502 emulation on the Pico. Such a cheap chip might be a very good fit for a nice portable 6502-computer :D

    Of course I spent a lot of time coding the PIO, which is a very simple but good accelerator for doing various I/O stuff. It might be nice to create a proper VGA output from the PZ1, maybe as an add-on card...

  • Even more real HW

    adam.klotblixt01/21/2021 at 10:24 0 comments

    This is the latest incarnation of PZ1:

    • W65C02 cpu
    • 512KiB SRAM memory
    • 2x 74HC670 used as bank register
    • Teensy 4.1 used as glue logic and I/O
    • Small speaker for sound output

    So more real HW instead of emulation. The sound is still generated via SID-emulation on the Teensy, serial access is also done via the Teensy.

    The glue logic to get memory accesses and bank registers working was nice to do in SW, so much faster and easier than doing in a CPLD. I still haven't got the CPLD programming working, will have to give up on that specific chip/programmer. The itch to get it working is still present, so I might get some ATF1504 and program them to do both glue logic and bank register functions.

    Bank registers using the 74HC670 was a bit of a disappointment. They work as intended, but I had not read the data sheets thoroughly enough and the read/write-access times @3.3V are way longer than I'd thought. My memory accesses need double the time with bank registers. BUT: it works great at the speeds I use. Running the CPU @2MHz equivalent taxes the Teensy at just below 50%. No problem doing sound-generation and other I/O-tasks.

    Oh how I wish the Teensy had more pins aligned for 8-bit access. Also, it is not the easiest trying to get nanosecond-level timing. An oscilloscope or using the built-in CPU-cycle counter (ARM_DWT_CYCCNT) is essential.

    I still need to decide in what direction I want to pursue the HW of this project.

    Next up is (re)connecting the GD3x display, and writing some 6502 multitasking demo code.

  • Banks and blocks, again

    adam.klotblixt01/15/2021 at 14:00 0 comments

    HW memory and bank registers are connected now, waiting to get them enabled and working in SW.

    I did a small detour and updated the picture on memory banks and blocks. I wasn't happy with how it looked, and there were some thread variants missing. Hope this is easier to understand.

  • 2021: PZ1 in more HW

    adam.klotblixt01/05/2021 at 06:18 0 comments

    The parts I ordered from Mouser finally came, the holidays were not kind to the delivery date :)

    The first revision is up and running correctly now. A Teensy 4.1 is hooked directly to a W65C02 with address, data and 6 control lines. The Teensy sets the pace by controlling the clock, so it is possible to run really slow or quite fast. I've tested the code I have to run 2 million cycles which takes around 0.285 seconds. No problem doing an emulated environment on the Teensy and still run the 6502-cpu in a 2 MHz equivalent. Not bad for such a rats nest of wires.

    Everything is emulated for the 6502: memory and whatever I/O deemed necessary. This is rather nifty, since the C++ code is much easier to write than any HDL, and the emulation can even be cycle exact if needed.

  • End of year report

    adam.klotblixt12/24/2020 at 10:40 0 comments

    This week I ordered HW: 65C02, ATF750 CPLD, 4x4 register chips and 512KiB SRAM. The urge to build a "real" HW PZ1 was simply to great.

    I've done quite a lot of 3D-modeling for a compact case, but am nowhere near complete. I know what I want in the end, getting there takes time.

    The code has seen little improvements since last report. Sprites are working and fun to use.

    All in all, I realize I do lots of things in parallel without completing anything major. BUT it is very enjoyable, which is what matters most to me. Getting it all done is a long term goal.

  • Sprites and 3D

    adam.klotblixt10/18/2020 at 08:26 0 comments

    Last week I implemented ports to access sprites from the 6502. Quite interesting how much HW-sprites offloads work from old CPUs, it really pays off! Not quite done yet, but good enough to test from basic.

    Yesterday I got an Ender-3 V2 3D-printer, so now I can finally build a proper case for the PZ1. It is really different to work with 3D-CAD compared to coding, but I like both. Nice to be able to swap between different tasks and ways of working, and the result seems to come out very good. Pictures later, when I've passed the alpha levels of case design. As with code, (almost) nothing is correct on the first try.

  • A sea of pixels and power

    adam.klotblixt10/07/2020 at 14:25 0 comments

    More HW has arrived!

    The long awaited Gameduino 3X screen has crept slowly to me from USA, and finally landed at my doorstep. It is a marvellous screen with its own GPU, and a totally different way of programming. More similar to modern 3D-accelerators, but limited to 2D.

    4.3", 480x272 pixels, 24-bit colour, 1024KiB screen ram, built in fonts and 8MiB flash. WOW! The tricky part is that it really doesn't have a simple frame buffer, but instead uses commands in a display list. Takes some time to get used to.

    After some frustrating manual reading and testing I've finally gotten what I want for a start: an 8x8 text-mode with back- and foreground colours and way too many sprites :) All synced at a buttery smooth 50Hz.

    The screen with the Teensy 4.1 and its 8MiB PSRAM makes this emulated 6502-system extremely capable.

  • A sea of memory!

    adam.klotblixt10/01/2020 at 14:55 0 comments

    I got a Teensy 4.1 and soldered an extra 8MiB PSRAM to the underside. The PZ1 6502 now sees 4MiB of memory, which is the maximum possible due to 16KiB banks. Interestingly, I can measure NO slowdown in the emulation even though the PSRAM is a serial memory. I am very pleased!

    To test the memory a bit I made some thread-code that changes the colour of one pixel every frame, then yields the rest of its slot-time. The X-position of the pixel is the thread-number, so when I start several threads, I get an informative colour cycling pattern on screen. There is a limit of 63 threads, which feels like more than enough for a 6502-system.

  • Keyboard

    adam.klotblixt09/19/2020 at 03:41 0 comments

    I've rebuilt keyboards before. Liking/wanting thin and split keyboards necessitates doing that, there are none ready to buy. Lately I've wondered about minimizing the number of keys as well. Suddenly I got the urge to try it out, and that lead to a new experimental PZ1-keyboard!

    It communicates via standard serial, not USB or PS/2 connection. This makes it a LOT less bothersome to receive data from :)

    Now I only have to figure out a good way to make some keycaps or overlay. It is definitely much smaller than the real keyboard I've used so far. We'll just see which I prefer down the line.

  • Banks of memory

    adam.klotblixt08/31/2020 at 15:00 0 comments

    Since I've worked on the HW aspects of the project I started to question my choice to divide the 64KiB memory space into 8 banks of 8KiB each. I guess 8x8 had a nice ring to it...
    The HW is now designed with 4x 16KiB banks, and the SW has changed accordingly. It lead to significantly fewer number of cycles required in thread switching, and the code actually looks much cleaner since the banks are fewer. It also feels like 4 is a very good number to use, 1 for the scheduler/OS, 1 for the main code/stack/ZP for each thread, and 2 more to make swapping/copying in each thread painless. Fewer banks would be cumbersome, more banks are not really necessary very often.
    One downside is the increased waste when doing small threads, but that is not a real problem with all the memory available in this system.