Macro Microcontroller 2
Hardware- 8 Devlogs
- 20 Total hours
Macro Microcontroller 2, a macropad + microcontroller that controls GPIO pin output using keys with a custom BASIC interpreter firmware.
Macro Microcontroller 2, a macropad + microcontroller that controls GPIO pin output using keys with a custom BASIC interpreter firmware.
In this devlog, I made some changes to the firmware and released v0.0.3 that adds support for comments:
10 REM This is a comment that will be ignored!
20 PRINT "Hello world!"
I’ve also added a more detailed programming guide for my custom BASIC Interpreter.
I had some trouble soldering the keyboard switches on as it was moving everywhere. I’ve attempted applying tape, but it did not work as the temperature was too high.
I’ll be tidying up the repo and get ready to finally ship🚢 my project!
In this devlog, I’ve added a new function to my custom BASIC interpreter for my development board, and finally sent my PCB for manufacturing!
It took me quite a while to write the random number function that the old BASIC interpreters used to have: RND. I did many rounds of trial and error to finally create a working code (the previous code was returning either nothing or throwing compiler errors due to data types):
printf("%f\n", (float)rand() / (float)RAND_MAX);
Here’s a sample program you could run that generates a random number, stores it in a variable and prints it:
10 let x = rnd
20 lsvar
30 print x
Now, I’ll be working on support for comments in my interpreter and wait for my parts to come. I can’t wait to assemble my macropad + dev board!
Today, I changed the layout and content of the documentation website and made it responsive for mobile devices! I initially wanted to add a 3D viewer to display the .glb file for rendering, but it did not output the result I wanted. (The silkscreen was not appearing!) I’ll read up on more about it, and hopefully, I would be able to add the 3D model into my documentation!
In this devlog, I improved the documentation of my project by creating a simple website to share specifications, schematics, and provide a direct link to download firmware and 3D print files. You may view it at https://nicholas1023.github.io/macro-microcontroller-2!
Next, I will be ordering the PCB and electronic components and finally solder them together!
Today, I have completed the 3D case for Macro Microcontroller 2 and did some minor bug fixes for the BASIC Interpreter. I needed to reassign the GPIO pins from the first revision of the board.
Although the interpreter is currently still basic, it supports 4 BASIC statements and 4 custom statements for controls.
KEY statement for hardware GPIO controlFor the first-half, I added silkscreen text to the PCB for the IO components (GPIO Pins, Keyboard switches, LEDs…). Next, I moved on to designing the enclosure. It took a while for me to get used to using a new app to design it.
The screw holes were not appearing during the first few attempts, but it worked in the end when I placed it manually, instead of using the move function.
Creating the cutout for the USB connector took me about 15 mins as I needed to measure the length and clearance needed for a micro-USB plug and create another sketch before extruding it as a cutout.
Next, I’ll be continuing with the enclosure design, adding a cover with a keyboard plate, and finally moving on to the BASIC interpreter firmware for it!
Did most of the routing for the MCU and macropad segment today, but I might need to do some rewiring for the flash memory as the trace length for SD0 and SD2 are very different (5.57 & 13.2 mm).
Next, I’ll be adding more silkscreen text, and maybe design an icon for my macropad + microcontroller board. I’ll also be creating a custom enclosure for my device!
PRINT, LET and INPUT for the interpreter.Next, I will be focusing on the BASIC interpreter firmware, working on variable assignment and math operations and testing it on a real pico board! Also, I will be starting on the layout and BOM as I have completed the schematics!