Start to write the MSP430X demo.

pull/4/head
Richard Barry 14 years ago
parent 96e499775a
commit 98720fb72e

@ -0,0 +1,108 @@
/*
FreeRTOS V6.1.0 - Copyright (C) 2010 Real Time Engineers Ltd.
***************************************************************************
* *
* If you are: *
* *
* + New to FreeRTOS, *
* + Wanting to learn FreeRTOS or multitasking in general quickly *
* + Looking for basic training, *
* + Wanting to improve your FreeRTOS skills and productivity *
* *
* then take a look at the FreeRTOS books - available as PDF or paperback *
* *
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
* http://www.FreeRTOS.org/Documentation *
* *
* A pdf reference manual is also available. Both are usually delivered *
* to your inbox within 20 minutes to two hours when purchased between 8am *
* and 8pm GMT (although please allow up to 24 hours in case of *
* exceptional circumstances). Thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
***NOTE*** The exception to the GPL is included to allow you to distribute
a combined work that includes FreeRTOS without being obliged to provide the
source code for proprietary components outside of the FreeRTOS kernel.
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( 16000000UL )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 5 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 5
#define configGENERATE_RUN_TIME_STATS 0
#define configCHECK_FOR_STACK_OVERFLOW 2
#define configUSE_RECURSIVE_MUTEXES 0
#define configUSE_MALLOC_FAILED_HOOK 1
#define configUSE_APPLICATION_TASK_TAG 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define configTICK_INTERRUPT_VECTOR TIMER0_A0_VECTOR
#endif /* FREERTOS_CONFIG_H */

@ -0,0 +1,739 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>Debug</name>
<toolchain>
<name>MSP430</name>
</toolchain>
<debug>1</debug>
<settings>
<name>C-SPY</name>
<archiveVersion>4</archiveVersion>
<data>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CInput</name>
<state>1</state>
</option>
<option>
<name>MacOverride</name>
<state>0</state>
</option>
<option>
<name>MacFile</name>
<state></state>
</option>
<option>
<name>IProcessor</name>
<state>0</state>
</option>
<option>
<name>GoToEnable</name>
<state>1</state>
</option>
<option>
<name>GoToName</name>
<state>main</state>
</option>
<option>
<name>DynDriver</name>
<state>430FET</state>
</option>
<option>
<name>dDllSlave</name>
<state>0</state>
</option>
<option>
<name>DdfFileSlave</name>
<state>1</state>
</option>
<option>
<name>DdfOverride</name>
<state>0</state>
</option>
<option>
<name>DdfFileName</name>
<state>$TOOLKIT_DIR$\config\MSP430F5438A.ddf</state>
</option>
<option>
<name>ProcTMS</name>
<state>1</state>
</option>
<option>
<name>CExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>CExtraOptions</name>
<state></state>
</option>
<option>
<name>ProcMSP430X</name>
<state>1</state>
</option>
<option>
<name>CompilerDataModel</name>
<state>1</state>
</option>
<option>
<name>IVBASE</name>
<state>1</state>
</option>
<option>
<name>OCImagesSuppressCheck1</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath1</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck2</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath2</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck3</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath3</name>
<state></state>
</option>
<option>
<name>CPUTAG</name>
<state>1</state>
</option>
<option>
<name>L092Mode</name>
<state>1</state>
</option>
<option>
<name>OCImagesOffset1</name>
<state></state>
</option>
<option>
<name>OCImagesOffset2</name>
<state></state>
</option>
<option>
<name>OCImagesOffset3</name>
<state></state>
</option>
<option>
<name>OCImagesUse1</name>
<state>0</state>
</option>
<option>
<name>OCImagesUse2</name>
<state>0</state>
</option>
<option>
<name>OCImagesUse3</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>430FET</name>
<archiveVersion>1</archiveVersion>
<data>
<version>22</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CFetMandatory</name>
<state>0</state>
</option>
<option>
<name>Erase</name>
<state>1</state>
</option>
<option>
<name>EMUVerifyDownloadP7</name>
<state>0</state>
</option>
<option>
<name>EraseOptionSlaveP7</name>
<state>0</state>
</option>
<option>
<name>ExitBreakpointP7</name>
<state>0</state>
</option>
<option>
<name>PutcharBreakpointP7</name>
<state>1</state>
</option>
<option>
<name>GetcharBreakpointP7</name>
<state>1</state>
</option>
<option>
<name>derivativeP7</name>
<state>0</state>
</option>
<option>
<name>ParallelPortP7</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>TargetVoltage</name>
<state>3.3</state>
</option>
<option>
<name>AllowLockedFlashAccessP7</name>
<state>0</state>
</option>
<option>
<name>EMUAttach</name>
<state>0</state>
</option>
<option>
<name>AttachOptionSlave</name>
<state>0</state>
</option>
<option>
<name>CRadioProtocolType</name>
<state>1</state>
</option>
<option>
<name>CCRadioModuleTypeSlave</name>
<state>1</state>
</option>
<option>
<name>EEMLevel</name>
<state>0</state>
</option>
<option>
<name>DiasbleMemoryCache</name>
<state>0</state>
</option>
<option>
<name>NeedLockedFlashAccess</name>
<state>1</state>
</option>
<option>
<name>UsbComPort</name>
<state>Automatic</state>
</option>
<option>
<name>FetConnection</name>
<version>2</version>
<state>0</state>
</option>
<option>
<name>SoftwareBreakpointEnable</name>
<state>0</state>
</option>
<option>
<name>RadioSoftwareBreakpointType</name>
<state>0</state>
</option>
<option>
<name>TargetSettlingtime</name>
<state>0</state>
</option>
<option>
<name>AllowAccessToBSL</name>
<state>0</state>
</option>
<option>
<name>OTargetVccTypeDefault</name>
<state>0</state>
</option>
<option>
<name>CCBetaDll</name>
<state>1</state>
</option>
<option>
<name>GPassword</name>
<state></state>
</option>
<option>
<name>DebugLPM5</name>
<state>0</state>
</option>
<option>
<name>LPM5Slave</name>
<state>0</state>
</option>
<option>
<name>CRadioAutoManualType</name>
<state>0</state>
</option>
<option>
<name>ExternalCodeDownload</name>
<state>0</state>
</option>
<option>
<name>CCVCCDefault</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>SIM430</name>
<archiveVersion>1</archiveVersion>
<data>
<version>4</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>SimOddAddressCheckP7</name>
<state>1</state>
</option>
<option>
<name>CSimMandatory</name>
<state>1</state>
</option>
<option>
<name>derivativeSim</name>
<state>0</state>
</option>
<option>
<name>SimEnablePSP</name>
<state>0</state>
</option>
<option>
<name>SimPspOverrideConfig</name>
<state>0</state>
</option>
<option>
<name>SimPspConfigFile</name>
<state>$TOOLKIT_DIR$\CONFIG\test.psp.config</state>
</option>
</data>
</settings>
<debuggerPlugins>
<plugin>
<file>$TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\FreeRTOS\FreeRTOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
</debuggerPlugins>
</configuration>
<configuration>
<name>Release</name>
<toolchain>
<name>MSP430</name>
</toolchain>
<debug>0</debug>
<settings>
<name>C-SPY</name>
<archiveVersion>4</archiveVersion>
<data>
<version>25</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>CInput</name>
<state>1</state>
</option>
<option>
<name>MacOverride</name>
<state>0</state>
</option>
<option>
<name>MacFile</name>
<state></state>
</option>
<option>
<name>IProcessor</name>
<state>0</state>
</option>
<option>
<name>GoToEnable</name>
<state>1</state>
</option>
<option>
<name>GoToName</name>
<state>main</state>
</option>
<option>
<name>DynDriver</name>
<state>SIM430</state>
</option>
<option>
<name>dDllSlave</name>
<state>0</state>
</option>
<option>
<name>DdfFileSlave</name>
<state>1</state>
</option>
<option>
<name>DdfOverride</name>
<state>0</state>
</option>
<option>
<name>DdfFileName</name>
<state></state>
</option>
<option>
<name>ProcTMS</name>
<state>1</state>
</option>
<option>
<name>CExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>CExtraOptions</name>
<state></state>
</option>
<option>
<name>ProcMSP430X</name>
<state>1</state>
</option>
<option>
<name>CompilerDataModel</name>
<state>1</state>
</option>
<option>
<name>IVBASE</name>
<state>1</state>
</option>
<option>
<name>OCImagesSuppressCheck1</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath1</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck2</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath2</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck3</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath3</name>
<state></state>
</option>
<option>
<name>CPUTAG</name>
<state>1</state>
</option>
<option>
<name>L092Mode</name>
<state>1</state>
</option>
<option>
<name>OCImagesOffset1</name>
<state></state>
</option>
<option>
<name>OCImagesOffset2</name>
<state></state>
</option>
<option>
<name>OCImagesOffset3</name>
<state></state>
</option>
<option>
<name>OCImagesUse1</name>
<state>0</state>
</option>
<option>
<name>OCImagesUse2</name>
<state>0</state>
</option>
<option>
<name>OCImagesUse3</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>430FET</name>
<archiveVersion>1</archiveVersion>
<data>
<version>22</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>CFetMandatory</name>
<state>0</state>
</option>
<option>
<name>Erase</name>
<state>1</state>
</option>
<option>
<name>EMUVerifyDownloadP7</name>
<state>0</state>
</option>
<option>
<name>EraseOptionSlaveP7</name>
<state>0</state>
</option>
<option>
<name>ExitBreakpointP7</name>
<state>0</state>
</option>
<option>
<name>PutcharBreakpointP7</name>
<state>1</state>
</option>
<option>
<name>GetcharBreakpointP7</name>
<state>1</state>
</option>
<option>
<name>derivativeP7</name>
<state>0</state>
</option>
<option>
<name>ParallelPortP7</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>TargetVoltage</name>
<state>###Uninitialized###</state>
</option>
<option>
<name>AllowLockedFlashAccessP7</name>
<state>0</state>
</option>
<option>
<name>EMUAttach</name>
<state>0</state>
</option>
<option>
<name>AttachOptionSlave</name>
<state>0</state>
</option>
<option>
<name>CRadioProtocolType</name>
<state>1</state>
</option>
<option>
<name>CCRadioModuleTypeSlave</name>
<state>1</state>
</option>
<option>
<name>EEMLevel</name>
<state>0</state>
</option>
<option>
<name>DiasbleMemoryCache</name>
<state>0</state>
</option>
<option>
<name>NeedLockedFlashAccess</name>
<state>1</state>
</option>
<option>
<name>UsbComPort</name>
<state>Automatic</state>
</option>
<option>
<name>FetConnection</name>
<version>2</version>
<state>0</state>
</option>
<option>
<name>SoftwareBreakpointEnable</name>
<state>0</state>
</option>
<option>
<name>RadioSoftwareBreakpointType</name>
<state>0</state>
</option>
<option>
<name>TargetSettlingtime</name>
<state>0</state>
</option>
<option>
<name>AllowAccessToBSL</name>
<state>0</state>
</option>
<option>
<name>OTargetVccTypeDefault</name>
<state>0</state>
</option>
<option>
<name>CCBetaDll</name>
<state>1</state>
</option>
<option>
<name>GPassword</name>
<state>###Uninitialized###</state>
</option>
<option>
<name>DebugLPM5</name>
<state>0</state>
</option>
<option>
<name>LPM5Slave</name>
<state>0</state>
</option>
<option>
<name>CRadioAutoManualType</name>
<state>0</state>
</option>
<option>
<name>ExternalCodeDownload</name>
<state>0</state>
</option>
<option>
<name>CCVCCDefault</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>SIM430</name>
<archiveVersion>1</archiveVersion>
<data>
<version>4</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>SimOddAddressCheckP7</name>
<state>1</state>
</option>
<option>
<name>CSimMandatory</name>
<state>1</state>
</option>
<option>
<name>derivativeSim</name>
<state>0</state>
</option>
<option>
<name>SimEnablePSP</name>
<state>0</state>
</option>
<option>
<name>SimPspOverrideConfig</name>
<state>0</state>
</option>
<option>
<name>SimPspConfigFile</name>
<state>###Uninitialized###</state>
</option>
</data>
</settings>
<debuggerPlugins>
<plugin>
<file>$TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\FreeRTOS\FreeRTOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
</debuggerPlugins>
</configuration>
</project>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\RTOSDemo.ewp</path>
</project>
<batchBuild/>
</workspace>

@ -0,0 +1,168 @@
/*
FreeRTOS V6.1.0 - Copyright (C) 2010 Real Time Engineers Ltd.
***************************************************************************
* *
* If you are: *
* *
* + New to FreeRTOS, *
* + Wanting to learn FreeRTOS or multitasking in general quickly *
* + Looking for basic training, *
* + Wanting to improve your FreeRTOS skills and productivity *
* *
* then take a look at the FreeRTOS books - available as PDF or paperback *
* *
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
* http://www.FreeRTOS.org/Documentation *
* *
* A pdf reference manual is also available. Both are usually delivered *
* to your inbox within 20 minutes to two hours when purchased between 8am *
* and 8pm GMT (although please allow up to 24 hours in case of *
* exceptional circumstances). Thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
***NOTE*** The exception to the GPL is included to allow you to distribute
a combined work that includes FreeRTOS without being obliged to provide the
source code for proprietary components outside of the FreeRTOS kernel.
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#include "msp430.h"
#include "FreeRTOSConfig.h"
IMPORT usRegTest1Counter
IMPORT usRegTest2Counter
EXPORT vRegTest1Task
EXPORT vRegTest2Task
RSEG CODE
vRegTest1Task:
movx.a #0x44444, r4
movx.a #0x55555, r5
movx.a #0x66666, r6
movx.a #0x77777, r7
movx.a #0x88888, r8
movx.a #0x99999, r9
movx.a #0xaaaaa, r10
movx.a #0xbbbbb, r11
movx.a #0xccccc, r12
movx.a #0xddddd, r13
movx.a #0xeeeee, r14
movx.a #0xfffff, r15
prvRegTest1Loop:
cmpx.a #0x44444, r4
jne vRegTest1Error
cmpx.a #0x55555, r5
jne vRegTest1Error
cmpx.a #0x66666, r6
jne vRegTest1Error
cmpx.a #0x77777, r7
jne vRegTest1Error
cmpx.a #0x88888, r8
jne vRegTest1Error
cmpx.a #0x99999, r9
jne vRegTest1Error
cmpx.a #0xaaaaa, r10
jne vRegTest1Error
cmpx.a #0xbbbbb, r11
jne vRegTest1Error
cmpx.a #0xccccc, r12
jne vRegTest1Error
cmpx.a #0xddddd, r13
jne vRegTest1Error
cmpx.a #0xeeeee, r14
jne vRegTest1Error
cmpx.a #0xfffff, r15
jne vRegTest1Error
incx.w &usRegTest1Counter
jmp prvRegTest1Loop
nop
vRegTest1Error:
jmp vRegTest1Error
nop
/*-----------------------------------------------------------*/
vRegTest2Task:
movx.a #0x44444, r4
movx.a #0x55555, r5
movx.a #0x66666, r6
movx.a #0x77777, r7
movx.a #0x88888, r8
movx.a #0x99999, r9
movx.a #0xaaaaa, r10
movx.a #0xbbbbb, r11
movx.a #0xccccc, r12
movx.a #0xddddd, r13
movx.a #0xeeeee, r14
movx.a #0xfffff, r15
prvRegTest2Loop:
cmpx.a #0x44444, r4
jne vRegTest2Error
cmpx.a #0x55555, r5
jne vRegTest2Error
cmpx.a #0x66666, r6
jne vRegTest2Error
cmpx.a #0x77777, r7
jne vRegTest2Error
cmpx.a #0x88888, r8
jne vRegTest2Error
cmpx.a #0x99999, r9
jne vRegTest2Error
cmpx.a #0xaaaaa, r10
jne vRegTest2Error
cmpx.a #0xbbbbb, r11
jne vRegTest2Error
cmpx.a #0xccccc, r12
jne vRegTest2Error
cmpx.a #0xddddd, r13
jne vRegTest2Error
cmpx.a #0xeeeee, r14
jne vRegTest2Error
cmpx.a #0xfffff, r15
jne vRegTest2Error
incx.w &usRegTest2Counter
jmp prvRegTest2Loop
nop
vRegTest2Error:
jmp vRegTest2Error
nop
/*-----------------------------------------------------------*/
END

@ -0,0 +1,211 @@
// ************************************************
//
// XLINK configuration file for MSP430F5438A
//
// Copyright 1996-2010 IAR Systems AB
//
// $Revision: $
//
// ************************************************
// ---------------------------------------------------------
// Description
//
//
// Usage:
//
// xlink [file file ...] -f lnk430f5438a.xcl
//
// -----------------------------------------------
// Device summary
//
//
// Core: MSP430X
//
// Interrupt vectors: 64
//
// Peripheral units: 0-001FF
//
// Information memory (FLASH): 01800-019FF
//
// Read/write memory (RAM): 01C00-05BFF
//
// Read-only memory (FLASH): 05C00-0FFFF
// 10000-45BFF
//
// -----------------------------------------------
// Segments
//
// -------------------------------------
// Data read/write segments (RAM)
//
//
// The following segments are available for both
// the DATA16 and DATA20 segment groups.
//
// segment Usage
// ------- --------------------------
// DATA<nn>_Z Data initialized to zero
// DATA<nn>_I Data initialized by copying from DATA<nn>_ID
// DATA<nn>_N Data defined using __no_init
// DATA<nn>_HEAP The heap used by 'malloc' and 'free'
//
// segment Usage
// ------- --------------------------
// CSTACK Runtime stack
//
// -------------------------------------
// Program and data read-only segments (FLASH)
//
//
// The following segments are available for both
// the DATA16 and DATA20 segment groups.
//
// segment Usage
// ------- --------------------------
// DATA<nn>_C Constant data, including string literals
// DATA<nn>_ID initializers for DATA<nn>_I
//
// segment Usage
// ------- --------------------------
// INFO Information memory
// INFOA Information memory, bank A
// INFOB Information memory, bank B
// INFOC Information memory, bank C
// INFOD Information memory, bank D
// CSTART Program startup code
// CODE Program code
// ISR_CODE Program code for interrupt service routines
// DIFUNCT Dynamic initialization vector used by C++
// CHECKSUM Checksum byte(s) generated by the -J option
// INTVEC Interrupt vectors
// RESET The reset vector
//
// Notes:
//
// * The segments CSTART, ISR_CODE, and DIFUNCT, as well as the segments in
// the DATA16 segment group must be placed in in the range 0000-FFFD.
//
// * The INFOx and INFO segments overlap, this allows data either to be
// placed in a specific bank or anywhere in the info memory.
//
// * The INTVEC and RESET segments overlap. This allows an application to
// either use the reset vector provided by the runtime library, or
// provide a reset function by defining an interrupt function associated
// with the reset vector.
//
// ---------------------------------------------------------
// Configuation
//
// -----------------------------------------------
// Stack and heap sizes
//
// Uncomment for command line use
//-D_STACK_SIZE=80
//-D_DATA16_HEAP_SIZE=80
//-D_DATA20_HEAP_SIZE=80
// -----------------------------------------------
// Define cpu
//
-cmsp430
// -----------------------------------------------
// Support for placing functions in read/write memory
//
-QCODE_I=CODE_ID
// ---------------------------------------------------------
// Placement directives
//
// -----------------------------------------------
// Read/write memory
//
/* Commented out and substituted the original memory region definition */
/* for RAM to reserve the memory region from 0x2000 to 0x2021 as it is */
/* used during active mode Icc tests in "5xx_ACTIVE_test.asm" */
//-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=1C00-5BFF
-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=1C00-2000,2022-5BFF
-Z(DATA)CODE_I
-Z(DATA)DATA20_I,DATA20_Z,DATA20_N,DATA20_HEAP+_DATA20_HEAP_SIZE
-Z(DATA)CSTACK+_STACK_SIZE#
// -----------------------------------------------
// Read-only memory
//
// -------------------------------------
// Information memory
//
-Z(CONST)INFO=1800-19FF
-Z(CONST)INFOA=1980-19FF
-Z(CONST)INFOB=1900-197F
-Z(CONST)INFOC=1880-18FF
-Z(CONST)INFOD=1800-187F
// -------------------------------------
// Low memory 0-0FFFF
//
// ---------------------------
// Code
//
-Z(CODE)CSTART,ISR_CODE=5C00-FF7F
// ---------------------------
// Constant data
//
-Z(CONST)DATA16_C,DATA16_ID,DIFUNCT,CHECKSUM=5C00-FF7F
// -------------------------------------
// All memory 0-FFFFF
//
// ---------------------------
// Code
//
-P(CODE)CODE=5C00-FF7F,10000-45BFF
-Z(CODE)CODE_ID
// ---------------------------
// Constant data
//
-Z(CONST)DATA20_C,DATA20_ID=5C00-FF7F,10000-45BFF
// -------------------------------------
// Interrupt vectors
//
-Z(CODE)INTVEC=FF80-FFFF
-Z(CODE)RESET=FFFE-FFFF

@ -0,0 +1,54 @@
/**************************************************
*
* This is a template for early application low-level initialization.
*
* Copyright 1996-2010 IAR Systems AB.
*
* $Revision: 5993 $
*
**************************************************/
/*
* The function __low_level_init it called by the start-up code before
* "main" is called, and before data segment initialization is
* performed.
*
* This is a template file, modify to perform any initialization that
* should take place early.
*
* The return value of this function controls if data segment
* initialization should take place. If 0 is returned, it is bypassed.
*
* For the MSP430 microcontroller family, please consider disabling
* the watchdog timer here, as it could time-out during the data
* segment initialization.
*/
/*
* To disable the watchdog timer, include a suitable device header
* file (or "msp430.h") and add the following line to the function
* below:
*
* WDTCTL = WDTPW+WDTHOLD;
*
*/
#include <intrinsics.h>
#include "msp430.h"
int __low_level_init(void)
{
/* Insert your low-level initializations here */
WDTCTL = WDTPW+WDTHOLD;
/*
* Return value:
*
* 1 - Perform data segment initialization.
* 0 - Skip data segment initialization.
*/
return 1;
}

@ -0,0 +1,357 @@
/*
FreeRTOS V6.1.0 - Copyright (C) 2010 Real Time Engineers Ltd.
***************************************************************************
* *
* If you are: *
* *
* + New to FreeRTOS, *
* + Wanting to learn FreeRTOS or multitasking in general quickly *
* + Looking for basic training, *
* + Wanting to improve your FreeRTOS skills and productivity *
* *
* then take a look at the FreeRTOS books - available as PDF or paperback *
* *
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
* http://www.FreeRTOS.org/Documentation *
* *
* A pdf reference manual is also available. Both are usually delivered *
* to your inbox within 20 minutes to two hours when purchased between 8am *
* and 8pm GMT (although please allow up to 24 hours in case of *
* exceptional circumstances). Thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
***NOTE*** The exception to the GPL is included to allow you to distribute
a combined work that includes FreeRTOS without being obliged to provide the
source code for proprietary components outside of the FreeRTOS kernel.
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#include <stdio.h>
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "msp430.h"
#include "hal_MSP-EXP430F5438.h"
/* The rate at which mainCHECK_LED will toggle when all the tasks are running
without error. Controlled by the check task as described at the top of this
file. */
#define mainNO_ERROR_CYCLE_TIME ( 5000 / portTICK_RATE_MS )
/* The rate at which mainCHECK_LED will toggle when an error has been reported
by at least one task. Controlled by the check task as described at the top of
this file. */
#define mainERROR_CYCLE_TIME ( 200 / portTICK_RATE_MS )
/* Codes sent within messages to the LCD task so the LCD task can interpret
exactly what the message it just received was. These are sent in the
cMessageID member of the message structure (defined below). */
#define mainMESSAGE_BUTTON_UP ( 1 )
#define mainMESSAGE_BUTTON_SEL ( 2 )
#define mainMESSAGE_STATUS ( 3 )
/* When the cMessageID member of the message sent to the LCD task is
mainMESSAGE_STATUS then these definitions are sent in the cMessageValue member
of the same message and indicate what the status actually is. */
#define mainERROR_DYNAMIC_TASKS ( pdPASS + 1 )
#define mainERROR_COM_TEST ( pdPASS + 2 )
#define mainERROR_GEN_QUEUE_TEST ( pdPASS + 3 )
/* The length of the queue (the number of items the queue can hold) that is used
to send messages from tasks and interrupts the the LCD task. */
#define mainQUEUE_LENGTH ( 5 )
#define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/*-----------------------------------------------------------*/
extern void vRegTest1Task( void *pvParameters );
extern void vRegTest2Task( void *pvParameters );
static void prvCheckTask( void *pvParameters );
static void prvSetupHardware( void );
static void prvTerminalIOTask( void *pvParameters );
static void prvButtonPollTask( void *pvParameters );
static void prvGenerateStatusMessage( char *pcBuffer, long lStatusValue );
/*-----------------------------------------------------------*/
volatile unsigned short usRegTest1Counter = 0, usRegTest2Counter = 0;
/* The handle of the queue used to send messages from tasks and interrupts to
the LCD task. */
static xQueueHandle xLCDQueue = NULL;
/* The definition of each message sent from tasks and interrupts to the LCD
task. */
typedef struct
{
char cMessageID; /* << States what the message is. */
char cMessageValue; /* << States the message value (can be an integer, string pointer, etc. depending on the value of cMessageID. */
} xQueueMessage;
/*-----------------------------------------------------------*/
void main( void )
{
prvSetupHardware();
/* Create the queue used by tasks and interrupts to send strings to the LCD
task. */
xLCDQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( xQueueMessage ) );
if( xLCDQueue != NULL )
{
/* Add the created queue to the queue registry so it can be viewed in
the IAR FreeRTOS state viewer plug-in. */
vQueueAddToRegistry( xLCDQueue, "LCDQueue" );
/* Create the terminal IO and button poll tasks, as described at the top
of this file. */
xTaskCreate( prvTerminalIOTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );
xTaskCreate( prvButtonPollTask, ( signed char * ) "ButPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vRegTest1Task, "RegTest1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
xTaskCreate( vRegTest2Task, "RegTest2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );
xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );
vTaskStartScheduler();
}
for( ;; );
}
/*-----------------------------------------------------------*/
static void prvTerminalIOTask( void *pvParameters )
{
xQueueMessage xReceivedMessage;
/* Buffer into which strings are formatted and placed ready for display on the
LCD. Note this is a static variable to prevent it being allocated on the task
stack, which is too small to hold such a variable. The stack size is configured
when the task is created. */
static char cBuffer[ 512 ];
/* This function is the only function that uses printf(). If printf() is
used from any other function then some sort of mutual exclusion on stdout
will be necessary.
This is also the only function that is permitted to access the LCD.
First print out the number of bytes that remain in the FreeRTOS heap. This
can be viewed in the terminal IO window within the IAR Embedded Workbench. */
printf( "%d bytes of heap space remain unallocated\n", ( int ) xPortGetFreeHeapSize() );
for( ;; )
{
/* Wait for a message to be received. Using portMAX_DELAY as the block
time will result in an indefinite wait provided INCLUDE_vTaskSuspend is
set to 1 in FreeRTOSConfig.h, therefore there is no need to check the
function return value and the function will only return when a value
has been received. */
xQueueReceive( xLCDQueue, &xReceivedMessage, portMAX_DELAY );
/* What is this message? What does it contain? */
switch( xReceivedMessage.cMessageID )
{
case mainMESSAGE_BUTTON_UP : /* The button poll task has just
informed this task that the up
button on the joystick input has
been pressed or released. */
sprintf( cBuffer, "Button up = %d", xReceivedMessage.cMessageValue );
break;
case mainMESSAGE_BUTTON_SEL : /* The select button interrupt
just informed this task that the
select button was pressed.
Generate a table of task run time
statistics and output this to
the terminal IO window in the IAR
embedded workbench. */
printf( "\nTask\t Abs Time\t %%Time\n*****************************************" );
// vTaskGetRunTimeStats( ( signed char * ) cBuffer );
// printf( cBuffer );
break;
case mainMESSAGE_STATUS : /* The tick interrupt hook
function has just informed this
task of the system status.
Generate a string in accordance
with the status value. */
prvGenerateStatusMessage( cBuffer, xReceivedMessage.cMessageValue );
break;
default : sprintf( cBuffer, "Unknown message" );
break;
}
/* Output the message that was placed into the cBuffer array within the
switch statement above. */
printf( "%s", cBuffer );
}
}
/*-----------------------------------------------------------*/
static void prvGenerateStatusMessage( char *pcBuffer, long lStatusValue )
{
/* Just a utility function to convert a status value into a meaningful
string for output onto the LCD. */
switch( lStatusValue )
{
case pdPASS : sprintf( pcBuffer, "Task status = PASS" );
break;
case mainERROR_DYNAMIC_TASKS : sprintf( pcBuffer, "Error: Dynamic tasks" );
break;
case mainERROR_COM_TEST : sprintf( pcBuffer, "Err: loop connected?" ); /* Error in COM test - is the Loopback connector connected? */
break;
case mainERROR_GEN_QUEUE_TEST : sprintf( pcBuffer, "Error: Gen Q test" );
break;
default : sprintf( pcBuffer, "Unknown status" );
break;
}
}
/*-----------------------------------------------------------*/
static void prvButtonPollTask( void *pvParameters )
{
unsigned char ucLastState = pdFALSE, ucState;
xQueueMessage xMessage;
/* This tasks performs the button polling functionality as described at the
top of this file. */
for( ;; )
{
/* Check the button state. */
ucState = ( halButtonsPressed() & BUTTON_UP );
if( ucState != ucLastState )
{
/* The state has changed, send a message to the LCD task. */
xMessage.cMessageID = mainMESSAGE_BUTTON_UP;
xMessage.cMessageValue = ucState;
ucLastState = ucState;
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );
}
/* Block for 10 milliseconds so this task does not utilise all the CPU
time and debouncing of the button is not necessary. */
vTaskDelay( 10 / portTICK_RATE_MS );
}
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
halBoardInit();
halButtonsInit( BUTTON_ALL );
halButtonsInterruptEnable( BUTTON_SELECT );
LFXT_Start (XT1DRIVE_0);
Init_FLL_Settle( 25000, 488 );
}
/*-----------------------------------------------------------*/
static void prvCheckTask( void *pvParameters )
{
volatile unsigned short usLastRegTest1Counter = 0, usLastRegTest2Counter = 0;
portTickType xNextWakeTime, xCycleFrequency = mainNO_ERROR_CYCLE_TIME;
const char *pcStatusMessage = "OK";
/* Initialise xNextWakeTime - this only needs to be done once. */
xNextWakeTime = xTaskGetTickCount();
for( ;; )
{
/* Place this task in the blocked state until it is time to run again. */
vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );
/* Check the reg test tasks are still cycling. They will stop incrementing
their loop counters if they encounter an error. */
if( usRegTest1Counter == usLastRegTest1Counter )
{
pcStatusMessage = "Error: RegTest1";
}
if( usRegTest2Counter == usLastRegTest2Counter )
{
pcStatusMessage = "Error: RegTest2";
}
usLastRegTest1Counter = usRegTest1Counter;
usLastRegTest2Counter = usRegTest2Counter;
printf( "%s, tick count = %u\n", pcStatusMessage, ( unsigned int ) xTaskGetTickCount() );
fflush( stdout );
}
}
/*-----------------------------------------------------------*/
void vApplicationSetupTimerInterrupt( void )
{
const unsigned short usACLK_Frequency_Hz = 32768;
/* Ensure the timer is stopped. */
TA0CTL = 0;
/* Run the timer of the ACLK. */
TA0CTL = TASSEL_1;
/* Clear everything to start with. */
TA0CTL |= TACLR;
/* Set the compare match value according to the tick rate we want. */
TA0CCR0 = usACLK_Frequency_Hz / configTICK_RATE_HZ;
/* Enable the interrupts. */
TA0CCTL0 = CCIE;
/* Start up clean. */
TA0CTL |= TACLR;
/* Up mode. */
TA0CTL |= MC_1;
}
/*-----------------------------------------------------------*/
void vApplicationMallocFailedHook( void )
{
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )
{
( void ) pxTask;
( void ) pcTaskName;
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationIdleHook( void )
{
__bis_SR_register( LPM3_bits + GIE );
}
Loading…
Cancel
Save