IEC60730_user_config.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2013, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 
33 #ifndef _IEC60730_USER_CONFIG_H_
34 #define _IEC60730_USER_CONFIG_H_
35 
36 #include <msp430.h>
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 //***************************************************************************************
44 // Start of User Options
45 //***************************************************************************************
46 
47 //**************************************************************************************
48 // FOR WATCHDOG TIMER options
49 // Section to define if WDT is enabled 0=disabled 1= enabled
50 //**************************************************************************************
51 #define ENABLED_WDT 1
52 
53 
54 //**************************************************************************************
55 // Define for handle test failures
56 //
57 // Section to define if JUMP_TO_FAILSAFE is enabled 0=disabled 1= enabled
58 //
59 // If JUMP_TO_FAILSAFE is enabled the user must create a function called
60 // "IEC60730_FAIL_SAFE_failSafe(void)" to handle the failure of any test
61 //
62 // If JUMP_TO_FAILSAFE is disabled all test will return TEST_FAILURE. TEST_FAILURE is
63 // define in "IEC60730_system_config.h"
64 //**************************************************************************************
65 
66 #define JUMP_TO_FAILSAFE 1
67 
68 
69 //***************************************************************************************
70 // Defines for OSCILLATOR_TEST
71 //***************************************************************************************
72 
73 //***************************************************************************************
74 // Defines to specify which Timer_Ax and CCRn to be used for Oscillator fault test
75 // You must define one one USE_TAx and and one USE_CCRn. Otherwise, the test may
76 // result in unexpected beahvior.
77 //
78 // NOTE: The selected Timer_Ax and CCRn must be available in the device. If the selected
79 // timer is not available in the device, the project will throw compilation errors
80 //***************************************************************************************
81 
82 #define USE_TA0
83 //#define USE_TA1
84 //#define USE_TA2
85 
86 
87 #define USE_CCR0
88 //#define USE_CCR1
89 //#define USE_CCR2
90 //#define USE_CCR3
91 //#define USE_CCR4
92 
93 //***************************************************************************************
94 // Define to specify the MCLK frequency
95 //
96 // Uncomment the frequency at which the MCLK will be running.
97 //
98 // If the desired MCLK frequency is not available you can select
99 // MAIN_CLOCK_FREQUENCY_USER_DEFINED.
100 //
101 // MAIN_CLOCK_EXTERNAL_XT2 if a external high speed oscillator or crystal will be used.
102 //
103 //
104 // NOTE: If MAIN_CLOCK_EXTERNAL_XT2 or MAIN_CLOCK_FREQUENCY is defined you must define
105 // MAIN_CLOCK_FREQUENCY and provide the frequency in Hz.
106 //***************************************************************************************
107 
108 //#define MAIN_CLOCK_EXTERNAL_XT2
109 //#define MAIN_CLOCK_USER_DEFINED
110 //#define MAIN_CLOCK_FREQUENCY_1MHz
111 //#define MAIN_CLOCK_FREQUENCY_8MHz
112 #define MAIN_CLOCK_FREQUENCY_12MHz
113 
114 //***************************************************************************************
115 // Uncomment if MAIN_CLOCK_EXTERNAL_XT2 or MAIN_CLOCK_USER_DEFINED option was
116 // selected above.
117 //
118 // NOTE: Make sure to specify the frequency in HZ
119 //
120 // CAUTION: If using predefined frequency DO NOT uncomment this define. Uncommenting
121 // this define may result in unexpected behavior for OSCILLATOR_TEST
122 //***************************************************************************************
123 //#define MAIN_CLOCK_FREQUENCY 4000000
124 
125 //***************************************************************************************
126 // Define to specify divider of Main Clock
127 //***************************************************************************************
128 #define MAIN_CLOCK_DIVIDER 1
129 
130 //***************************************************************************************
131 //Defines to provide information regarding independent clock source that will be used to
132 //monitor the main clock source
133 //***************************************************************************************
134 #define LFXT1_FREQUENCY 32768
135 #define LFXT1_FREQUENCY_DIVIDER 1
136 
137 //***************************************************************************************
138 //Defines to provide determine the allowed frequency drift of the main clock (in +/- %)
139 //***************************************************************************************
140 #define PERCENT_FREQUENCY_DRIFT 3
141 
142 //***************************************************************************************
143 // Defines for RAM MEMORY test
144 //***************************************************************************************
145 
146 //***************************************************************************************
147 // The following defines determine the parameters that will be passed to
148 // IEC60730_MARCH_TEST_testRam(). The values for RAM_START_ADDRESS and RAM_SIZE
149 // can be obtain in the device datasheet. The stack size can be determine from your
150 // compiler configuration setting.
151 //***************************************************************************************
152 
153 #if defined(__MSP430F5529__)
154 #define RAM_START_ADDRESS 0x2400
155 #define RAM_SIZE 0x1FF0
156 #define STACK_SIZE 160
157 #elif defined(__MSP430G2553__)
158 #define RAM_START_ADDRESS 0x0200
159 #define RAM_SIZE 0x01F0
160 #define STACK_SIZE 80
161 #elif defined(__MSP430FR5739__)
162 #define RAM_START_ADDRESS 0x1C00
163 #define RAM_SIZE 0x03F0
164 #define STACK_SIZE 160
165 #else
166 //***************************************************************************************
167 // IF you your device is not listed in above please specify the RAM properties
168 //***************************************************************************************
169 #define RAM_START_ADDRESS
170 #define RAM_SIZE
171 #define STACK_SIZE
172 #endif
173 
174 //***************************************************************************************
175 // The following defines is calculated based on the defines above. This define should
176 // not be modified.
177 //***************************************************************************************
178 #define RAM_END_ADDRESS ((RAM_START_ADDRESS + RAM_SIZE)-STACK_SIZE)
179 
180 
181 //***************************************************************************************
182 // The following define selects the type of MARCH test to be implemented in the RAM
183 // TEST.
184 //
185 // NOTE: Only one test should be selected.
186 //***************************************************************************************
187 //#define MARCH_C_TEST
188 #define MARCH_X_TEST
189 
190 //***************************************************************************************
191 // Uncomment this define if you want to run the RAM test in NON-DESTRUCTIVE mode.
192 //***************************************************************************************
193 #define NON_DESTRUCTIVE
194 
195 //***************************************************************************************
196 // The following define is used if NON-DESTRUCTIVE for march test is selected
197 //***************************************************************************************
198 #define RAM_TEST_BUFSIZE 8
199 
200 
201 
202 
203 //***************************************************************************************
204 // Defines for NON VOLATILE MEMORY test
205 //***************************************************************************************
206 
207 
208 //***************************************************************************************
209 //
210 // Definitions required for software implementation of CRC16-CCITT the default seed is
211 // (0xFFFF) and the polynomial used is x^16+x^12+x^5+1
212 //
213 //***************************************************************************************
214 #define CRC16_CCITT_SEED 0xFFFF
215 
216 //***************************************************************************************
217 //
218 // If library is being complied for an MSP430 device that does not have a CRC module
219 // CRC16_CCITT_POLY will be automatically defined
220 //
221 //***************************************************************************************
222 #ifndef __MSP430_HAS_CRC__
223 #define CRC16_CCITT_POLY 0x1021
224 #endif
225 
226 //***************************************************************************************
227 // The following define specifies the start location in Flash where CRC check sumsums
228 // are stored.
229 // Specify the address where CRC result is located.
230 // Note: Ideally the location will be in the information memory section of the device.
231 // To determine the address for the information memory for each device please reffer to
232 // the device datasheet and locate the "Memory Organization" section in the datasheet.
233 //
234 //***************************************************************************************
235 #if defined(__MSP430F5529__)
236 #define CRC_CHECKSUM_LOCATION 0x1800
237 #elif defined(__MSP430G2553__)
238 #define CRC_CHECKSUM_LOCATION 0x1004
239 #elif defined(__MSP430FR5739__)
240 #define CRC_CHECKSUM_LOCATION 0x1880
241 #else
242 #define CRC_CHECKSUM_LOCATION
243 #endif
244 //***************************************************************************************
245 // Defines for ADC test
246 //***************************************************************************************
247 
248 //***************************************************************************************
249 //
250 // The following defines specify the maximum and minimum ADC conversion count drift
251 // allowed in the application
252 //
253 //***************************************************************************************
254 #define MINIMUM_ADC_COUNT_DRIFT -50
255 #define MAXIMUM_ADC_COUNT_DRIFT 50
256 
257 //***************************************************************************************
258 //
259 // Section to define all the sucess codes
260 //
261 //***************************************************************************************
262 
263 #define SIG_CPU_REG_TEST 0xCC
264 #define SIG_PC_REG_TEST 0xCD
265 #define SIG_CLOCK_TEST 0xCE
266 #define SIG_RAM_TEST 0xCF
267 #define SIG_NV_MEM_CRC_TEST 0xD0
268 #define SIG_ADC_TEST 0xD1
269 #define SIG_GPIO_TEST 0xD2
270 #define SIG_INTERRUPT_TEST 0xD3
271 
272 //***************************************************************************************
273 //
274 // Section to define failure code.
275 //
276 // The following failure code will be return by IEC60730 APIs.
277 //
278 //***************************************************************************************
279 #define TEST_FAILURE 0x00
280 
281 //***************************************************************************************
282 //End user Options
283 //***************************************************************************************
284 #ifdef __cplusplus
285 }
286 #endif
287 
288 #endif

Copyright 2015, Texas Instruments Incorporated