Other Parts Discussed in Thread: SYSBIOS, MSP430F5438, MSP430F5438A, MSP430WARE
GENERAL ISSUE:
The MSP430 SYS/BIOS documentation contains a variety of fragmented reference and application material, as well as some some (mostly esoteric and simple) examples. While the overview material is adequate, it seems that no comprehensive tutorials (cookbook example style) are available. I did a literature search but found no suitable textbook or manual. I would appreciate any suggestions regarding a comprehensive COOKBOOK style publication.
Development Platform:
*MS Win XP Pro SP3
*CCS 5.5.0
*SYS/BIOS 6.35.04.50 GA
*Evaluation Boards
1. TI MSP-EXP430F5438(A) Experimenter Board
2. Olimex MSP430-5438STK development board
*MSP-FET430UIF USB-Debug-Interface
SPECIFIC ISSUE:
How is UCS CLK SYSTEM specified using SYS/BIOS app.cfgg GUI for the MSP430? The "SYS/BIOS 6.35.04.50 > API reference > ti > sysbios > family > msp430" documentation seems to imply that the app.cfg SMCLK is fixed at 8192000 Hz in the current version of MSP430 SYS/BIOS. If so, this is a severe deficiency!
I need to to run my application using an external 25 MgHz crystal, but I see no way of accomplishing that under MSP430 SYS/BIOS. The SYS/BIOS 1.5-day Workshop Videos (Eric Scot Videos) and other dcuments don't seem to cover the SYS/BIOS CPU UCS CLK SYSTEM.
The question is: How can I get my CPU clock to work with the crystal with appropriate scaling under SYS/BIOS, and can this be done within the GUI?
Alternatively, will the CPU clock work as specified if is it is configured before invoking SYS/BIOS?
TESTS:
Anyway, my Olimex MSP430-5438STK development board has a 15 MgHz crystal on board (as well as the watch crystal). Just to test the result, I set the "GUI app.cfg" CPU clock frequency to 15,000,000 in a simple timer program (but I found no way of specifying the external crystal as the source). The program runs, but the crystal is not oscillating. The FFL circuit seems to be generating some sort of arbitrary or default CPU clock.
I ran the program once with the timer period set for 500 microseconds and once with the timer period set for 1500 counts for both the TI and the Olimex boards. The TI board has no high speed crystal, confirming that the 15 MgHz Xtal was not operating on the Olimex board.
TI results--
500 uS --> 1039 Hz
1500 counts --> 11.01 Hz
Olimex results--
500 uS --> 1042 Hz
1500 counts --> 10.94 Hz
Since the results apparently are not board dependendent, SYS/BIOS seems to have assigned some esoteric default CPU clock settings when the 8192000 value is redefined as 15000000.
PROGRAM:
// timerTEST
//#include <msp430f5438.h> // Olimex MSP430-5438STK
#include <msp430f5438a.h> // TI MSP-EXP430F5438(A)
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/hal/Timer.h>
#include <ti/sysbios/hal/Hwi.h>
#include <ti/sysbios/knl/Swi.h>
#include <xdc/cfg/global.h>
Int main()
{
// P1DIR = 0x01; // Olimex MSP430-5438STK
// P1OUT = 0x00;
P5DIR = 0x01; // TI MSP-EXP430F5438(A)
P5OUT = 0x00;
BIOS_start();
}
void mySqwFxn(UArg arg)
{
// P1OUT ^= 0x01; // Olimex MSP430-5438STK
P5OUT ^= 0x01; // TI MSP-EXP430F5438(A)
}
GUI CONFIGURATION:
BIOS
CPU clock frequency (Hz) = 15000000
Timer
timer0
ISR = mySqwFxn
Id = 0
Period = 500 uS (test 1)
Period = 1500 counts (test 2)
starts automatically
periodic and continuous
ClockFreqs
ACLK = 32768
SMCLK = 15000000
CFG SCRIPT:
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory')
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Timer = xdc.useModule('ti.sysbios.hal.Timer');
var ClockFreqs = xdc.useModule('ti.sysbios.family.msp430.ClockFreqs');
/*
* Program.argSize sets the size of the .args section.
* The examples don't use command line args so argSize is set to 0.
*/
Program.argSize = 0x0;
/*
* Uncomment this line to globally disable Asserts.
* All modules inherit the default from the 'Defaults' module. You
* can override these defaults on a per-module basis using Module.common$.
* Disabling Asserts will save code space and improve runtime performance.
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
*/
/*
* Uncomment this line to keep module names from being loaded on the target.
* The module name strings are placed in the .const section. Setting this
* parameter to false will save space in the .const section. Error and
* Assert messages will contain an "unknown module" prefix instead
* of the actual module name.
Defaults.common$.namedModule = false;
*/
/*
* Minimize exit handler array in System. The System module includes
* an array of functions that are registered with System_atexit() to be
* called by System_exit().
*/
System.maxAtexitHandlers = 4;
/*
* Uncomment this line to disable the Error print function.
* We lose error information when this is disabled since the errors are
* not printed. Disabling the raiseHook will save some code space if
* your app is not using System_printf() since the Error_print() function
* calls System_printf().
Error.raiseHook = null;
*/
/*
* Uncomment this line to keep Error, Assert, and Log strings from being
* loaded on the target. These strings are placed in the .const section.
* Setting this parameter to false will save space in the .const section.
* Error, Assert and Log message will print raw ids and args instead of
* a formatted message.
Text.isLoaded = false;
*/
/*
* Uncomment this line to disable the output of characters by SysMin
* when the program exits. SysMin writes characters to a circular buffer.
* This buffer can be viewed using the SysMin Output view in ROV.
SysMin.flushAtExit = false;
*/
/*
* The BIOS module will create the default heap for the system.
* Specify the size of this default heap.
*/
BIOS.heapSize = 0x400;
/*
* Build a custom SYS/BIOS library from sources.
*/
BIOS.libType = BIOS.LibType_Custom;
/* System stack size (used by ISRs and Swis) */
Program.stack = 0x200;
/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x200;
System.SupportProxy = SysMin;
var timer0Params = new Timer.Params();
timer0Params.instance.name = "null";
timer0Params.period = 500;
timer0Params.periodType = xdc.module("ti.sysbios.interfaces.ITimer").PeriodType_MICROSECS;
timer0Params.extFreq.lo = 0;
var timer0 = Timer.create(null, "&mySqwFxn", timer0Params);
BIOS.cpuFreq.lo = 15000000;
BIOS.customCCOpts = "-vmspx --near_data=none --code_model=large --data_model=restricted -q --advice:power=1 --program_level_compile -o3 -g --optimize_with_debug";
Program.gen.debuggerFiles = false;
ClockFreqs.SMCLK = 15000000;
ClockFreqs.ACLK = 32768;