1Plan your array
Planning is always wise before soldering things together! Stage the project components (P1) and plan your array design by aligning modules side-by-side in the shown orientation (P2) or any orientation you prefer.
2Assemble the hardware
It's time to do the fun stuff and assemble the array! Start by making basic solder joints to hold modules together (P3). This helps a lot moving forward.
Then complete the remaining joints. You don't have to do all of them but it's preferable to provide structural support. Don't forget to work on the bottom side (P4)
Finally add the push buttons (P5) (make sure you leave factory bootloader programming port P2 free if you did not load firmware before). Add any extra connectors/headers you might need and now hardware assembly is finished! (P6)
Check this assembly video as well:
3Get the source code
Copy an empty H01Rx project from H01R00 code repository, rename the folder and open the uVision project located in the MDK-ARM folder (P7). You can also use firmware from the attached zip folder as well.
4Generate and compile array code
First, we need to add a topology definition file to tell the modules how they are going to be connected to each other. Open "project.h", uncomment topology header file definition and open topology_1.h header file. Modify this file to suite the array as shown in pictures (P8, P9 and P10). More about making topology header files later! Recompile the project once you're done.
Now time to generate individualized source code for each module bcased on its location in the array. Click on Manage Project Items and add four other targets if they're not already there. (P11). Choose each module from the dropdown menu and click on "Options for Target". Modify _module=1 in "C/C++" tab into module number (1 to 5) and modify name of executable in "Output" tab to match module number as well. Click on Batch Build >> Select All >> Rebuild.
Note 1: There's a way to automatically generate array topology files in run-time. We will feature it in other projects
Note 2: This project has a single type of programmable modules (H01R00). If you have other types of programmable modules, follow same steps by downloading their source code and adding same topology file.
Moment of truth! Connect input voltage (5-40V DC) to H03R00 input connector, you should see the green power-OK LED once you power the array. You can use any 12V DC power adapter (P12 and P13).
6Programming the modules
It's tiime to load firmware on these modules. Connect the USB-UART cable and our handy Kelvin clamp to programming port P2 of module 1 and pay attention to polarity with respect to USB-UART cable (TXD/Top > yellow, RXD/Bottom > orange). Also don't forget to connect a jumper wire between array GND and cable GND (black).
If module is new and empty, load the appropriate hex file with ST Loader Demonstrator. If it's already programmed use the update Command in the CLI first. Please review firmware update article for detailed steps. (P14)
Load firmware to all modules based on their IDs (P15 and P16) and make sure you don't load same file! (I did that many times although I have programmed 500+ modules so far :) )
Connect to module 1 CLI and test some commands. If you want to test broadcast, disable response with:
set BOS.response none
Check the following screen recording of CLI tests and experiment with commands shown there:
Here's the array video for these tests:
You're all set! Next, we will start writing some actual C code to perform more complex tricks in the upcoming project logs.