For future reference links to all the Arduino software, articles and discussions I write about can be found on the Arduino Links Page which is listed in the Pages and Links gadget to the right.
In post one I built the radio. In post two I employed some hardware hacking to correct an unfortunate property of my radio. You may have to do something similar, or maybe your radio works well out of the box. Now it is time to look at how we can modify the radio operating software.
Installing Arduino Integrated Development Environment (IDE).
I could write a lot about installing the Arduino IDE, but it would be difficult to come close to what the Arduino folks have already written. So follow that link and read up about programing the boards and install the IDE on the system(s) you want to use. If the system you want to use is a Raspberry Pi, don't worry. Installing the IDE on a Pi is very easy and the people at MagPi have you covered. Actually even if you aren't going to use a Raspberry Pi that article is still a recommended read.
BITX40
There are a number of choices of available software:
- Farhan's original code, with updates since your Raduino was programmed.
- Munters mods which support a series of hardware mods and provide some attractive features.
- Costa's fork of Farhan's original and his own Si5351 library. This supports some of Munter's mods and adds some others.
- Your own mashup taking pieces from these or other sources and adding your own features.
A Word About GitHub
The git program is a very advanced source code control system that allows multiple developers to work on a body of code and manage the issues which arise therefrom. The use of git tools is beyond the scope of this post so I will be showing you the simplest way to get the code. If you want to contribute back with your own work, or even if you just want to be able to get the latest updates easily you should look into using git and GitHub.
Munters Mods
The source code for Munters sketch is on a GitHub repository.
Munters GitHub repository |
Before we can compile the sketch we need to ensure we have access to a library. In the readme file for the code starting at version 1.27 the PinChangeInterrup library is required. The Arduino IDE manages well know libraries very well. From the Sketch menu go to Include Library and select Manage Libraries... Enter PinChangeInterrup where is says filter your search:
Select the entry for the PinChangeInterrupt library and click Install.
You can now Verify and Compile the sketch by selecting "Verify/Compile" from the Sketch menu. This should compile without warnings or errors. Now the sketch is ready to be uploaded. Connect the Raduino to your development machine with an appropriate USB cable. If the radio is off this will power up the Raduino and start running whatever sketch was previously loaded. Using the Tools menu make sure the correct Port is selected. Consult the Arduino getting started guide if you have to. Now you can upload the sketch by selecting "Upload" from the sketch menu.
Enjoy your updated BITX40 software. Make some of the hardware modes as well. If you want a quick and easy taste of what making software mods can do try this. Somewhere around line 460 you will find the printLine function. The original looks like this:
/**
Display Routine
This display routine prints a line of characters to the upper or lower line of the 16x2 display
linenmbr = 0 is the upper line
linenmbr = 1 is the lower line
*/
void printLine(char linenmbr, char *c) {
if (strcmp(c, printBuff[linenmbr])) { // only refresh the display when there was a change
lcd.setCursor(0, linenmbr); // place the cursor at the beginning of the selected line
lcd.print(c);
strcpy(printBuff[linenmbr], c);
for (byte i = strlen(c); i < 16; i++) { // add white spaces until the end of the 16 characters line is reached
lcd.print(' ');
}
}
}
Change the function prototype (the first line of the function) by adding const in front of char *c like this:
void printLine(char linenmbr, const char *c) {
Then add these three lines immediately after the function prototype:
if (linenmbr == 1 && strlen(c) == 0) {
c = "your callsign";
}
This is a kludge, there is a much better way but it involves changes scattered around the source code.
73s
Richard
VE3YSH
No comments:
Post a comment