Intro
The design kit has finally arrived, so this is a belated push to get something built and working before the project deadline this week. I have been able to get the kit system running some preliminary software but unfortunately I need to break off at this point and work on the final project blog. The plan for the Microchip Curiosity Nano was to build a file management system for my old Rockwell AIM 65, which used a cassette tape recorder for non-volatile storage. The Curiosity Nano can provide solid state storage and file management to rejuvenate the AIM 65.
Originally I was going to use the Curiosity Nano to simply act like a tape recorder, just recording and playing audio files which store digital data as modulated audio tones. However I think it will be better to store files as text via the AIM 65 ability to interface to a Teletype.
This blog is about how the Curiosity Nano can utilize Arduino libraries. To facilitate this Niraldri has created a Curiosity Nano board package for the Arduino IDE. (Link below) This board package allows the Arduino libraries and IDE to be used to create programs for the Curiosity Nano, but the Arduino IDE can't yet flash a program to the Curiosity Nano. However it can create a binary file that can easily be flashed to the Curiosity Nano by Microchip's MPLAB X IDE.
The AIM 65 File System Concept
The file system will be a simple approach. The system will have a fixed set of files that can be overwritten as needed. Suppose it is just 20 files - 2 buttons will allow scrolling through the 20 file names - forwards and backwards. One other button allows any data coming through the serial port to be saved in the currently selected file, which gets closed when any button is pushed. The last button sends the currently selected file to the serial port.
Programming the Curiosity Nano
This is the process I followed:
To determine which pins were controlled by the buttons, I had to write a separate program to test each pin.
Here is the json message to install the board in the Arduino ISE:
This is a good start but there is still work to do. The good news is that the unknowns have been eliminated and completion is mainly a matter of finding some time to work on it.
Here is the Software such as it is - very preliminary:
Firmware
/* File Management System for an AIM65 using a Microchip Curiosity Nano Eval Kit * LCD1.ino * by Doug Wong 2024 * 20 character 4 line I2C Display * Uses Bill Perry's HD44780 Library, which can be installed from the Arduino Library Manager * See Bills documentation: https://github.com/duinoWitchery/hd44780 * * Uses Curiosity Nano board package by Niladri installed with this json message: * https://raw.githubusercontent.com/niladridmgit/CuriosityNiladriSAME51/master/package_curiosityniladri_same_index.json * see his docs here: https://github.com/niladridmgit/CuriosityNiladriSAME51 */ // ---------------------------------------------------------------------------- /*-----( Import needed libraries )-----*/ #include <Wire.h> #include <hd44780.h> // main hd44780 header #include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header /*-----( Declare Constants )-----*/ // LCD geometry const int LCD_COLS = 20; const int LCD_ROWS = 4; const int bp1 = 23; // the number of the Up pushbutton pin const int bp2 = 33; // the number of the Down pushbutton pin const int bp3 = 29; // the number of the Left pushbutton pin const int bp4 = 32; // the number of the Right pushbutton pin const int ledPin = 4; // the number of the LED pin /*-----( Declare objects )-----*/ hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip /*-----( Declare Variables )-----*/ int status; int Upin, Dpin, Lpin, Rpin; void setup() /*----( SETUP: RUNS ONCE )----*/ { // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(bp1, INPUT); pinMode(bp2, INPUT); pinMode(bp3, INPUT); pinMode(bp4, INPUT); status = lcd.begin(LCD_COLS, LCD_ROWS); if(status) // non zero status means it was unsuccesful { // hd44780 has a fatalError() routine that blinks an led if possible // begin() failed so blink error code using the onboard LED if possible hd44780::fatalError(status); // does not return } Serial.begin(9600); // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print(" element14"); delay(1500); lcd.setCursor(0, 1); lcd.print(" Upcycling Project"); lcd.setCursor(0, 2); lcd.print(" Utilizing "); lcd.setCursor(0, 3); lcd.print(" Curiosity Nano "); delay(5000); lcd.clear(); lcd.print("AIM65 File 1 "); }/*--(end setup )---*/ void loop() { lcd.setCursor(0, 0); // read all buttons Upin = digitalRead(bp1); if (Upin == 0) { lcd.print("AIM65 File 1 "); } lcd.setCursor(0, 0); Dpin = digitalRead(bp2); if (Dpin == 0) { lcd.print("AIM65 File 2 "); } lcd.setCursor(0, 2); Lpin = digitalRead(bp3); if (Lpin == 0) { lcd.print("<< Receiving <<"); delay(3000); lcd.setCursor(0, 2); lcd.print(" "); } else { lcd.print(" "); } lcd.setCursor(0, 2); Rpin = digitalRead(bp4); if (Rpin == 0) { lcd.print(">>> Sending >>>"); delay(3000); lcd.setCursor(0, 2); lcd.print(" "); } else { lcd.print(" "); } delay(50); // clear the screen // lcd.clear(); }
Just to provide some insight into what the AIM 65 is I made a descriptive video:
The AIM 65
Discussion
It is a bit disappointing that the kit arrived so late in the design challenge, but it is a nice kit and it is at least up and running preliminary firmware.
I am pretty happy that I now have a workflow that allows development of the final application.
I now have one day left to pivot and put together the final project blog, which is not a lot of time, but it was important to spend the time to get the challenge kit up and running.
Links:
Serendipitous Salvage - Blog 2