Download smartBASIC user`s manual
Transcript
smart BASIC Core Functionality User Manual Clear the UWTerminal screen by clicking the Clear button on the toolbar and then enter the command ATZ to force the module to reset itself. You could also click Reset on the development kit to achieve the same outcome. Warning: If the JLINK debugger is connected to the development kit via the ribbon, then the reset button has no effect. The following output displays: Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello World World World World World World World World World World 1 2 3 4 5 6 7 8 9 10 In UWTerminal, next clear the screen using the Clear button and then unselect the checkbox labelled DTR so that the nAutoRUN input of the module is not asserted. After a reset (ATZ or the button), the screen remains blank which signifies that the autorun application was NOT invoked automatically. The reason for providing this capability (suppressing the launching of the autorun application) is to ensure that if your autorun application has the WAITEVENT as the last statement. This allows you to regain control of the module’s command interpreter for further development work. Debugging Applications One difference with smart BASIC is that it does not have program labels (or line numbers). Because it is designed for a single line compilation in a memory constrained embedded environment, it is more efficient to work without them. Because of the absence of labels, smart BASIC provides facilities for debugging an application by inserting breakpoints into the source code prior to compilation and execution. Multiple breakpoints can be inserted and each breakpoint can have a unique identifier associated with it. These IDs can be used to aid the developer in locating which breakpoint resulted in the break. It is up to the programmer to ensure that all IDs are unique. The compiler does not check for repeated values. Each breakpoint statement has the following syntax: BP nnnn Where nnnn should be a unique number which is echoed back when the breakpoint is encountered at runtime. It is up to the developer to keep all the nnnn’s unique as they are not validated when the source is compiled. Breakpoints are ignored if the application is launched using the command AT+RUN (or name alone). This allows the application to be run at full speed with breaks, if required. However, if the command AT+DBG is used to run the application, then all of the debugging commands are enabled. When the breakpoint is encountered, the runtime engine is halted and the command line interface becomes active. At this point, the response seen in UWTerminal is in the following form: Embedded Wireless Solutions Support Center: http://ews-support.lairdtech.com www.lairdtech.com/bluetooth 28 Laird Technologies Americas: +1-800-492-2320 Europe: +44-1628-858-940 Hong Kong: +852-2268-6567 x026