You are here: Home DOCUMENTATION Debugging Tools uBug12JE User Manual - Writing Compatible Applications

Technological Arts Inc.

Your Shopping Cart

Your Cart is currently empty.

uBug12JE User Manual - Writing Compatible Applications

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

Writing Compatible Applications

There are several points to keep in mind when writing applications if you plan to use uBug12 and the serial monitor for debugging. If these rules are not followed, the serial monitor will not be able to be used for troubleshooting. Instead, a BDM pod will be required.

  1. The S12(X) CPU clock speed must match between the serial monitor and the application. Since the serial monitor sets the SCI port values for baud rate based on clock speed, changing the clock rate will cause uBug12 and the serial monitor to lose communication. This also means that if the application has code to configure the CPU clock, even if it is to the same rate as the serial monitor, you will not be able to use breakpoints or single step through that piece of code.
  2. The serial monitor fixes the Direct Page register on the S12X type MCUs at the default value of $00. Since this is a write-once register, an application will not be able to change it if the serial monitor is running. Furthermore, if it is changed, the serial monitor will no longer function correctly, since it uses direct addressing for code accessing the registers from $0000 through $00FF.
  3. The S12X serial monitor fixes the write-once IVBR register to the default value of $FF. This sets up where the interrupt vectors are held. The monitor has to do this so that it can handle SCI interrupts correctly when troubleshooting. The serial monitor then uses a pseudo-vector table at $F710-$F7FF for user applications, which mirror the default locations at $FF10-$FFFF.
  4. Your application should not use the same SCI port as the serial monitor. By default, the serial monitor uses SCI0. If you need SCI0 for your application, you may be able to still do some testing with uBug12 by using the VT100 command.  Otherwise the serial monitor in Flash will have to be reprogrammed with a version that uses a different serial port, such as SCI1.
  5. If you need to use the HALT command when debugging, the application has to leave interrupts enabled as often as possible.  This is because the serial monitor uses the SCI interrupt when HALT is done.  If interrupts are masked when you need to HALT, then HALT will have no effect.


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