Devices430.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 | Devices430.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 | 1.4 02/13 RL Added devices to tsDeviceFeatures struct |
50 | 1.5 03/13 RL/MD Added devices to tsDeviceFeatures struct |
51 | 1.6 07/13 RL Added i20xx to tsDeviceFeatures struct |
52 |----------------------------------------------------------------------------|
53 | Designed 2006 by Texas Instruments Germany |
54 \*==========================================================================*/
57 /****************************************************************************/
58 /* INCLUDES */
59 /****************************************************************************/
60 
61 #include "Devices430.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 /* AFE2xx */ { 0x0253, TRUE, FALSE, TRUE , TRUE , FALSE, TRUE , TRUE , 0x0200, 0x02FF, 0xF000 }, // MSP430AFE22x
98 /* F11x(1)(A)*/ { 0xF112, TRUE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xF000 }, // MSP430F1121A
99 /* F11x2 */ { 0x1132, TRUE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F1132
100 /* F12x(A) */ { 0xF123, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F123
101 /* F12x2 */ { 0x1232, TRUE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F1232
102 /* F13x
103  F14x */ { 0xF149, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430F149
104 /* F15x
105  F16x */ { 0xF169, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430F169
106 /* F161x */ { 0xF16C, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x1100, 0x24FF, 0x8000 }, // MSP430F1610
107 /* F20xx */ { 0xF201, TRUE, FALSE, TRUE , TRUE, FALSE, TRUE , TRUE , 0x0200, 0x027F, 0xF800 }, // MSP430F2013
108 /* F21x1
109  F21x2 */ { 0xF213, TRUE, FALSE, TRUE , TRUE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F2131
110 /* F22x2
111  F22x4 */ { 0xF227, TRUE, FALSE, TRUE , TRUE, TRUE, TRUE , TRUE , 0x0200, 0x05FF, 0x8000 }, // MSP430F2274
112 /* F23x0 */ { 0xF237, TRUE, FALSE, TRUE , TRUE, TRUE, TRUE , FALSE , 0x0200, 0x09FF, 0x8000 }, // MSP430F2370
113 /* F23x
114  F24x
115  F24x1
116  F2410 */ { 0xF249, FALSE, FALSE, TRUE , TRUE, TRUE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430F249
117 /* F241x
118  F261x */ { 0xF26F, FALSE, TRUE, TRUE , TRUE, TRUE, TRUE , FALSE , 0x1100, 0x20FF, 0x2100 }, // MSP430F2619
119 /* F41x */ { 0xF413, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430F413
120 /* F42x(x) */ { 0xF427, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430FW427
121  { 0xF429, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430FW429
122 /* F42xA */ { 0x427A, FALSE, FALSE, TRUE , TRUE , FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }, // MSP430FE427A
123 /* F43x 80p */ { 0xF437, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x05FF, 0xA000 }, // MSP430F437
124 /* FG43x */ { 0xF439, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430FG439
125 /* F44x
126  F43x 100p */ { 0xF449, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x09FF, 0x1100 }, // MSP430F449
127 /* FG461x */ { 0xF46F, FALSE, TRUE, TRUE , TRUE, TRUE, TRUE , FALSE , 0x1100, 0x20FF, 0x2100 }, // MSP430FG4619
128 /* G2xx2 */ { 0x2452, TRUE, FALSE, TRUE , TRUE, FALSE, TRUE , TRUE , 0x0200, 0x027F, 0xFC00 }, // MSP430G2112
129 /* G2xx3 */ { 0x2553, TRUE, FALSE, TRUE , TRUE, FALSE, TRUE , TRUE , 0x0200, 0x02FF, 0xFC00 }, // MSP430G2113
130 /* G2x55 */ { 0x2955, TRUE, FALSE, TRUE , TRUE, TRUE, TRUE , TRUE , 0x0200, 0x09FF, 0x8000 }, // MSP430G2755
131 /* TCH5E */ { 0x255C, TRUE, FALSE, TRUE , TRUE, FALSE, TRUE , TRUE , 0x0200, 0x03FF, 0xC000 }, // MSP430TCH5E
132 /* i20xx */ { 0x4020, TRUE, FALSE, TRUE , TRUE, TRUE, TRUE , TRUE , 0x0200, 0x05FF, 0xC000 }, // MSP430i2040
133 /* GENERIC */ { 0xFFFF, FALSE, FALSE, TRUE , FALSE, FALSE, TRUE , FALSE , 0x0200, 0x02FF, 0xE000 }
134 };
135 
136 /****************************************************************************/
137 /* FUNCTIONS */
138 /****************************************************************************/
139 
144 void SetDevice (word wDeviceId)
145 {
146  for(DeviceIdx = 0; DeviceIdx < (sizeof(sDeviceFeatures)/sizeof(*sDeviceFeatures)); DeviceIdx++)
147  {
148  if(sDeviceFeatures[DeviceIdx].Id == wDeviceId)
149  {
150  break;
151  }
152  }
153 }
154 
158 {
159  return (sDeviceFeatures[DeviceIdx].TestPin);
160 }
161 
164 bool DeviceHas_CpuX(void)
165 {
166  return (sDeviceFeatures[DeviceIdx].CpuX);
167 }
168 
172 {
173  return (sDeviceFeatures[DeviceIdx].DataQuick);
174 }
175 
179 {
180  return (sDeviceFeatures[DeviceIdx].FastFlash);
181 }
182 
186 {
187  return (sDeviceFeatures[DeviceIdx].EnhVerify);
188 }
189 
192 bool DeviceHas_JTAG(void)
193 {
194  return (sDeviceFeatures[DeviceIdx].JTAG);
195 }
196 
200 {
201  return (sDeviceFeatures[DeviceIdx].SpyBiWire);
202 }
203 
206 word Device_RamStart(void)
207 {
208  return (sDeviceFeatures[DeviceIdx].RamStart);
209 }
210 
213 word Device_RamEnd(void)
214 {
215  return (sDeviceFeatures[DeviceIdx].RamEnd);
216 }
217 
222 {
223  return (sDeviceFeatures[DeviceIdx].MainStart);
224 }
225 
226 /****************************************************************************/
227 /* END OF SOURCE FILE */
228 /****************************************************************************/
word Device_MainStart(void)
This function returns the start address of the device's main memory.
Definition: Devices430.c:221
Device Function Prototypes and Definitions for FLASH programming.
bool DeviceHas_FastFlash(void)
Function to check if current device supports FastFlash.
Definition: Devices430.c:178
bool DeviceHas_SpyBiWire(void)
Function to check if current device supports SpyBiWire.
Definition: Devices430.c:199
bool DeviceHas_JTAG(void)
Function to check if current device supports JTAG.
Definition: Devices430.c:192
bool DeviceHas_TestPin(void)
Function to check if current device has a test pin.
Definition: Devices430.c:157
bool DeviceHas_DataQuick(void)
Function to check if current device supports DataQuick.
Definition: Devices430.c:171
bool DeviceHas_CpuX(void)
Function to check if current device has the extended CPUX.
Definition: Devices430.c:164
Declaration of a struct type that holds all necessary device information.
Definition: Devices430.c:76
bool DeviceHas_EnhVerify(void)
Function to check if current device supports EnhVerify.
Definition: Devices430.c:185
word Device_RamStart(void)
This function returns the start address of the device's RAM.
Definition: Devices430.c:206
word Device_RamEnd(void)
This function returns the end address of the device's RAM.
Definition: Devices430.c:213
void SetDevice(word wDeviceId)
This function accepts a Device ID and extracts the corresponding device information from the sDeviceF...
Definition: Devices430.c:144

Copyright 2016, Texas Instruments Incorporated