You are here: Home DOCUMENTATION Debugging Tools uBug12JE User Manual - Developing Software Using Projects

Technological Arts Inc.

Your Shopping Cart

Your Cart is currently empty.

uBug12JE User Manual - Developing Software Using Projects

Article Index
uBug12JE User Manual
Connecting to the Module
Programming the Module
Extending uBug12 INSTALL
Developing Software Using Projects
Script Command Buttons
uBug12 Miscellaneous Features
Command Glossary
Writing Compatible Applications
All Pages

Developing Software Using Projects

Developing embedded software usually means extra work is needed as compared to more 'standard' software development, as everything has to be defined and set up on the target system.  This begins with setting the MCU clock, and can continue with configuring registers, running MCU checks, and interfacing with real hardware.  All this has to be tested several times over to verify that everything works as expected.  Finally, it's back to editing source again.  One quickly discovers that either their program source gets very large, or that they have lots of files around to handle all the different tasks.  It can also be a hassle switching between all the different tasks that need to be done.

To help ease this burden on the software developer, uBug12 provides the capability to partition development into Projects.  This allows all related files to be in one directory on the development platform that is running uBug12.  In addition, uBug12 helps out by populating this directory when it is created with several files to help you get started.

To create a new Project, use the mouse to select 'File', and then 'New/Open Project Dir'.  You will see a dialog box prompting you for a directory to work.  You can either select a directory that already exists, or just type in the name for a new one to create.  You can also change the directory that your project will be in from the default shown in the dialog box.

Once a new directory is created, the first thing uBug12 will do is copy its current configuration file to this directory.  This will be read in when the project is reopened later.  It also means that it is possible to have each project have its own settings for such things as editor and terminal program used by uBug12.  (Script Buttons are explained later, and they are also unique to each project.)

uBug12 will also copy MCU register definition files, a sample program, and files specific to the various MCU boards available from Technological Arts.  If you are connected to a target MCU before creating a new project, then the project will be tailored to that MCU variant.  In other words, the new Project directory will only contain the MCU definition file and related files for that MCU.  However, if you are not connected to a target when a new project is created, then the Project directory will get all the MCU definition files.  (Demo S-records will not be copied though.)

Once a Project is opened, you can use the 'L' command to get a listing of the files in that directory.  The 'L' output can be tailored by including a regular expression.  (You can read up on Regular Expression syntax at  So, to list the sample program included, and related files, type 'L S.*' in the command line.

There is a sample program included, called Sample.s.  Adapting this file to your needs will get you up and started as quickly as possible.  First,you will need to edit the file so that the INCLUDE for the TA board you have is enabled, and all others are disabled.  Once that is done, assemble the program with 'HSW12ASM Sample.s'.  Notice that the assembler program does not require the use of the full pathname to the source file.  Once a Project is opened, uBug12 keeps track of the directory so that the file is referenced correctly when the assembler is called.

Please note that all the assembler files included in the Project directory are designed to be used with HSW12ASM exclusively.  This is because HSW12ASM has been modified to reference the directory that the source is in.  If you want to use the other assemblers, and the provided definition files, you will need to edit all the INCLUDE statements to use full paths names to the various files.

Now that the source is assembled, FBULK and FLOAD can be used to burn it into the target.  However you will note that HSW12ASM always creates two S-record files, one paged and one linear.  Either of these should work.  Once burned into Flash, start the program with the GO command.  If your target board has an LED, it should light up.  That's the first part of the sample program.  To test the second part, start up the built in terminal emulator program with the VT100 command.  A second window should now pop up onto the screen.  In the terminal window. any text you type should be echoed back.  When you are satisfied the sample program works, you can terminate the terminal program by closing the window.  Finally, press the Reset button on the target to get back to running the serial monitor.

It is instructive to examine the 'LST' file generated by HSW12ASM, to see the completed sample program.  You can see how the MCU clock was set up, how the SCI port was initialized and used, and how macros work.  It should be enough to at least get you started with your own code development.

Last Updated ( Tuesday, 13 September 2016 08:12 )