Sunday, December 25, 2022

2023 Project Goals

2022 was another year full of all kinds of fun projects like my 7400 Logic Calculator plan, Interactive 6502 Assembler, and embedded programming on Linux. Although these weren't on my list of 2022 Project Goals list, I did learn a lot from them and make progress towards some of the goals on the list. With 2022 coming to a close, it's time to take stock of my progress from 2022 and set some goals for 2023.

2022 Project Goals

6507 Graphing Calculator - Still working
Despite another year of work on this project, there is still a lot of work left to finish it. The plan to reduce the firmware size to fit into an 8K ROM by using a Forth VM didn't work out as expected. After a little more work, I plan to post about my progress on this from 2022 and how the project will proceed in the future.

This is the one project from the list that is completely finished. It even made it onto Hackaday yesterday! As mentioned in the article, what I learned from this project will be useful for other projects like the PIC32 Calculator below.

Tiny Calculator - No progress
Not much to say here. There just wasn't enough time to get to this one.

PIC32 Calculator - Still working
Although I haven't started on this project formally yet, a lot of my projects from 2022 will help me work on this one. As mentioned in the last project goals post, this shouldn't take as long as other calculators since it won't be necessary to write all the firmware from scratch.


2023 Project Goals
This year, my goal is to finish enough projects to give a presentation at the Hewlett-Packard Handheld Conference (HHC) in fall 2023 like my presentations at HHC 2019 and HHC 2021. This will take a lot of focus which I wasn't able to pull off last year. Hopefully, having a firm date and goal in mind will motivate me. Here is the tentative list of topics:

Although not a calculator, this should be really interesting to present on since the 6502 emulator written in MIPS assembly can be used to emulate 6502 calculator firmware on a PIC32. This is a good one to start with since this project is already finished.

As mentioned above, there is still a lot of work left to do for this though I know exactly how to proceed from here. Barring any unforeseen complications, this should be a straightforward project to finish. This will be one of the main topics of the presentation.

Calculator key comparison
This is another topic where I made a lot of progress in the last year but haven't posted anything yet. My goal is to compare many different ways of making calculator keys using 3D printing, laser cutting, cast plastic and other methods.

PIC32 Calculator
This is the same project from my list last year. This will be the most exciting thing to present on if it's ready in time. 
 

Monday, December 19, 2022

PIC32/6502 Blinky Robot

The PIC32 robot from my 2022 Project Goals is finally finished! Building it was a fun way to learn about the MIPS architecture and programming the PIC32. It was also a chance to work on a 6502 emulator that will be useful for other projects.

As far as robots go, this is not a very useful one since all it does is blink its eyes every few seconds. The interesting part is how it does the blinking. Rather than switching the LEDs on then delaying a while before switching them off, the robot runs several layers of emulation with the innermost emulated system blinking the LEDs as fast as possible. All the layers of emulators within emulators combine to produce enough overhead to slow the blinking down to a rate that is visible.

Sunday, December 11, 2022

Tali Forth 2 on Linux

When people on IRC have questions about Forth or I can't remember how a particular word works, it's nice to have a Forth handy to try things out on. For this, I usually open Tali Forth 2 in a browser window on my website. Even though it's a 6502 Forth running in a JavaScript 6502 emulator rather than a native x86 Forth like Gforth, it works just fine for experimenting. Since most of my programming is on Linux now, it seemed like a good idea to have a way to do my tests in a terminal.

There were several choices for getting Tali Forth 2 running on Linux. One of the easiest ways is to use an existing emulator like Py65 since Tali Forth 2 comes with a pre-compiled binary ready to be emulated. However, this was less interesting than using one of my own emulators. Another option was the JavaScript 6502 emulator running on my website. As mentioned in the post about my 6507 calculator, this also runs in a terminal thanks to node.js. Another option was to extract the emulation engine from my 6502 Interactive Assembler, although it seemed this would be time consuming to untangle since the emulator was not designed to work without the assembler. In the end, it was the most convenient to use the 6502 emulator written in MIPS assembly I've been working on for another project using the tools mentioned in my post about MIPS development in Linux. As mentioned in that post, a binary compiled for MIPS will run right from the Ubuntu command line as if it were native thanks to QEMU and also have access to the terminal through Linux syscalls. Going with this emulator was also an opportunity to double check my MIPS code emulates the 6502 correctly.

Wednesday, December 7, 2022

MIPS Development on Linux

Two of the projects from my 2022 project goals use a PIC32 microcontroller. The company that makes them, Microchip, offers an IDE and a compiler which is a port of GCC. The free version of the compiler has some limitations which would make it difficult to finish one of my projects. However, since the PIC32 is a MIPS core, I was able to set up some tools on Linux as an alternative.

The two main limitations of the Microchip compiler are that it doesn't allow GCC's -O3 level optimizations or compile to the MIPS16e instruction set unless you pay for the full version. The loss of MIPS16e is a real bummer since it saves a lot of program memory by using 16-bit instead of 32-bit instructions like ARM's Thumb instruction set. Microchip claims that programs in this format are 40% smaller without losing much performance which would be great for one of my projects. The standard MIPS GCC has none of these limitations, but it also doesn't come with any headers or other files specific to the PIC32. This got me thinking about how I could combine the two tools and use MIPS GCC on Linux to generate part of the program. Running a few tests shows that Microchip's compiler will accept assembly files written for either the 16-bit or 32-bit instruction set, and the linker will accept object files for either instruction set too. This way, all the chip specific parts of the program like initial setup can be compiled with Microchip's compiler while the bulk of the program can be compiled externally with optimizations and linked in later.