Devices430X.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * 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
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32 */
33 /*==========================================================================*\
34 | |
35 | Devices430X.c |
36 | |
37 | The file contains functions to distinguish MSP430 devices concerning |
38 | FLASH programming. |
39 |----------------------------------------------------------------------------|
40 | Project: MSP430 Replicator |
41 | Developed using: IAR Embedded Workbench 6.20 |
42 | and: Code Composer Studio 6.0 |
43 |----------------------------------------------------------------------------|
44 | Version history: |
45 | 1.0 02/06 STO Initial version. |
46 | 1.1 04/07 WLUT Enhanced with adress ranges for all actual silica |
47 | 1.2 01/08 WLUT Updated device feature list with new devices |
48 | 1.3 06/12 RL Updated commentaries |
49 |----------------------------------------------------------------------------|
50 | Designed 2005 by Texas Instruments Germany |
51 \*==========================================================================*/
52 
56 
57 /****************************************************************************/
58 /* INCLUDES */
59 /****************************************************************************/
60 
61 #include "Devices430X.h"
62 
63 /****************************************************************************/
64 /* VARIABLES */
65 /****************************************************************************/
66 
72 static word DeviceIdx = 0;
73 
77  word Id;
78  bool TestPin;
79  bool CpuX;
80  bool DataQuick;
81  bool FastFlash;
82  bool EnhVerify;
83  bool JTAG;
84  bool SpyBiWire;
85  word RamStart;
86  word RamEnd;
87  word MainStart;
88 };
89 
92 static const struct tsDeviceFeatures sDeviceFeatures[] =
93 {
94 // TestPin DataQuick EnhVerify SpyBiWire RamEnd
95 // Id | CpuX | FastFlash | JTAG | RamStart | MainStart
96 // | | | | | | | | | | |
97 /* F11x(1)(A)*/ { 0xF112, TRUE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xF000 }, // MSP430F1121A
98 /* F11x2 */ { 0x1132, TRUE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F1132
99 /* F12x(A) */ { 0xF123, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F123
100 /* F12x2 */ { 0x1232, TRUE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F1232
101 /* F13x
102  F14x */ { 0xF149, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430F149
103 /* F15x
104  F16x */ { 0xF169, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430F169
105 /* F161x */ { 0xF16C, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x1100, 0x24FF, 0x8000 }, // MSP430F1610
106 /* F20xx */ { 0xF201, TRUE, FALSE, TRUE , TRUE, FALSE, TRUE , TRUE , 0x0200, 0x027F, 0xF800 }, // MSP430F2013
107 /* F21x1
108  F21x2 */ { 0xF213, TRUE, FALSE, TRUE , TRUE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F2131
109 /* F22x2
110  F22x4 */ { 0xF227, TRUE, FALSE, TRUE , TRUE, TRUE, TRUE , TRUE , 0x0200, 0x05FF, 0x8000 }, // MSP430F2274
111 /* F23x0 */ { 0xF237, TRUE, FALSE, TRUE , TRUE, TRUE, TRUE , FALSE , 0x0200, 0x09FF, 0x8000 }, // MSP430F2370
112 /* F23x
113  F24x
114  F24x1
115  F2410 */ { 0xF249, FALSE, FALSE, TRUE , TRUE, TRUE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430F249
116 /* F241x
117  F261x */ { 0xF26F, FALSE, TRUE, TRUE , TRUE, TRUE, TRUE , FALSE , 0x1100, 0x20FF, 0x2100 }, // MSP430F2619
118 /* F41x */ { 0xF413, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F413
119 /* F42x(x) */ { 0xF427, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430FW427
120 /* F43x 80p */ { 0xF437, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x05FF, 0xA000 }, // MSP430F437
121 /* FG43x */ { 0xF439, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430FG439
122 /* F44x
123  F43x 100p */ { 0xF449, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430F449
124 /* FG461x */ { 0xF46F, FALSE, TRUE, TRUE , TRUE, TRUE, TRUE , FALSE , 0x1100, 0x20FF, 0x2100 }, // MSP430FG4619
125 /* GENERIC */ { 0xFFFF, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }
126 };
127 
128 /****************************************************************************/
129 /* FUNCTIONS */
130 /****************************************************************************/
131 
136 void SetDevice (word wDeviceId)
137 {
138  for(DeviceIdx = 0; DeviceIdx < (sizeof(sDeviceFeatures)/sizeof(*sDeviceFeatures)); DeviceIdx++)
139  {
140  if(sDeviceFeatures[DeviceIdx].Id == wDeviceId)
141  {
142  break;
143  }
144  }
145 }
146 
150 {
151  return (sDeviceFeatures[DeviceIdx].TestPin);
152 }
153 
156 bool DeviceHas_CpuX(void)
157 {
158  return (sDeviceFeatures[DeviceIdx].CpuX);
159 }
160 
164 {
165  return (sDeviceFeatures[DeviceIdx].DataQuick);
166 }
167 
171 {
172  return (sDeviceFeatures[DeviceIdx].FastFlash);
173 }
174 
178 {
179  return (sDeviceFeatures[DeviceIdx].EnhVerify);
180 }
181 
184 bool DeviceHas_JTAG(void)
185 {
186  return (sDeviceFeatures[DeviceIdx].JTAG);
187 }
188 
192 {
193  return (sDeviceFeatures[DeviceIdx].SpyBiWire);
194 }
195 
198 word Device_RamStart(void)
199 {
200  return (sDeviceFeatures[DeviceIdx].RamStart);
201 }
202 
205 word Device_RamEnd(void)
206 {
207  return (sDeviceFeatures[DeviceIdx].RamEnd);
208 }
209 
214 {
215  return (sDeviceFeatures[DeviceIdx].MainStart);
216 }
217 
218 /****************************************************************************/
219 /* END OF SOURCE FILE */
220 /****************************************************************************/
bool DeviceHas_SpyBiWire(void)
Function to check if current device supports SpyBiWire.
Definition: Devices430X.c:191
word Device_RamStart(void)
This function returns the start address of the device's RAM.
Definition: Devices430X.c:198
word Device_MainStart(void)
This function returns the start address of the device's main memory.
Definition: Devices430X.c:213
bool DeviceHas_CpuX(void)
Function to check if current device has the extended CPUX.
Definition: Devices430X.c:156
bool DeviceHas_FastFlash(void)
Function to check if current device supports FastFlash.
Definition: Devices430X.c:170
bool DeviceHas_JTAG(void)
Function to check if current device supports JTAG.
Definition: Devices430X.c:184
bool DeviceHas_TestPin(void)
Function to check if current device has a test pin.
Definition: Devices430X.c:149
bool DeviceHas_DataQuick(void)
Function to check if current device supports DataQuick.
Definition: Devices430X.c:163
bool DeviceHas_EnhVerify(void)
Function to check if current device supports EnhVerify.
Definition: Devices430X.c:177
Device Function Prototypes and Definitions for FLASH programming.
word Device_RamEnd(void)
This function returns the end address of the device's RAM.
Definition: Devices430X.c:205
Declaration of a struct type that holds all necessary device information.
Definition: Devices430X.c:76
void SetDevice(word wDeviceId)
This function accepts a Device ID and extracts the corresponding device information from the sDeviceF...
Definition: Devices430X.c:136

Copyright 2016, Texas Instruments Incorporated