Make One Program Launch Another

You can use the Propeller Tool to store many programs on the MicroSD card, and then write programs that load them into the Propeller chip and launch them. It’s called a soft boot.

Program to Be Launched to SD Card

  • Open “05 Other Program.spin”.
  • Click Run, then select Compile Current and View Info… F8.

  • Use your computer and MicroSD card reader to view your MicroSD drive.
  • If just the left side of the Object Info window is visible, click the Show Hext button to get the rest of it to display.
  • Click the Save EEPROM File button.
  • Save the file to your MicroSD drive.

  • Check your MicroSD drive to verify that the “05 Other Program.eeprom” file is there.

How it Works

The .eeprom file is a binary image of the program that can be loaded into the Propeller chip and run. Since it’s on the MicroSD card, it can be accessed by the PropBOE MicroSD object.

Display Directory

The SD_MMC_FATEngine object the PropBOE MicroSD card object abstracts is designed to work with the short filename. To see the short filename, you can use the sd.ListFiles method.

  • Insert the MicroSD card into your PropBOE’s socket.
  • Use the Propeller Tool to load 06.Display Directory.spin into the PropBOE.
  • While the program is loading, click the Parallax Serial Terminal’s Enable button.

How it Works

When you write code to perform operations on files, use the short filename. This program allows you to view it.

Did you Know?

The Short filename is also called the 8.3 filename.

Boot One Program with Another

Alright, now we can load a program into the Propeller that boots the program we stored on the MicroSD card.

  • Open “07 Boot Other Program.spin” and use F11 to load it into the Propeller chip.
  • While the program is loading, click the Parallax Serial Terminal’s Enable button.

  • Watch carefully, the display on the left is 07 Boot Other Program.spin running. Then, the screen will clear and you’ll see the output from 05 Other Program.spin when it loads.

How it Works

After running and doing some jobs, “07 Boot Other Program.spin” passes the short filename of 05OTHE~1.EEP to the PropBOE MicroSD card object’s sd.Run method. This loads the 05 Other Program.spin EEPROM image into RAM, and the program starts running. Since it’s loaded into RAM, it loads quickly. The 1 second delay is for the time.Pause method call in the 07 program to give you time to read the display.

Did you Know?
You can chain programs together, or use IF or CASE statements to choose which program to load.

Your Turn

Try writing a program that uses IF statements to decide which program to run based on either Parallax Serial Terminal input characters or button presses.

Learn More about the Run Method

  • In the Propeller Tool software, click Run -> Compile Current -> View Info… F8. The F8 next to the menu selection means that you can use the F8 key as a shortcut to this feature.
  • Double-click the PropBOE MicroSD object to open it. Then close the Object Info window.
  • The PropBOE MicroSD object should be the active tab in your Propeller Tool software now. Click the Documentation radio button.
  • Read the Run method’s documentation.