Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example
p33smps_devices.h
1 /*LICENSE ********************************************************************
2  * Microchip Technology Inc. and its subsidiaries. You may use this software
3  * and any derivatives exclusively with Microchip products.
4  *
5  * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
6  * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
7  * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
8  * PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
9  * WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
10  *
11  * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
12  * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
13  * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
14  * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
15  * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS
16  * IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF
17  * ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
18  *
19  * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
20  * TERMS.
21  * ***************************************************************************/
31 // This is a guard condition so that contents of this file are not included
32 // more than once.
33 #ifndef _MCAL_P33_SMPS_DEVICE_DEFINITION_H_
34 #define _MCAL_P33_SMPS_DEVICE_DEFINITION_H_
35 
36 #include <xc.h> // include processor files - each processor file is guarded.
37 
38 #if defined (__dsPIC33FJ06GS101__) || defined (__dsPIC33FJ06GS102__) || \
39  defined (__dsPIC33FJ06GS202__) || defined (__dsPIC33FJ16GS402__) || \
40  defined (__dsPIC33FJ16GS404__) || defined (__dsPIC33FJ16GS502__) || \
41  defined (__dsPIC33FJ16GS504__)
42 // YGAR family of devices
43 
44  #define __P33SMPS_FJ__
45 
46 #elif defined (__dsPIC33FJ32GS406__) || defined (__dsPIC33FJ64GS406__) || \
47  defined (__dsPIC33FJ32GS606__) || defined (__dsPIC33FJ64GS606__) || \
48  defined (__dsPIC33FJ32GS608__) || defined (__dsPIC33FJ64GS608__) || \
49  defined (__dsPIC33FJ32GS610__) || defined (__dsPIC33FJ64GS610__)
50 // UEAA family of devices
51 
52  #define __P33SMPS_FJC__
53 
54 #elif defined (__dsPIC33FJ06GS001__) || defined (__dsPIC33FJ06GS101A__) || \
55  defined (__dsPIC33FJ06GS102A__) || defined (__dsPIC33FJ16GS202A__) || \
56  defined (__dsPIC33FJ09GS302__)
57 // UEAG family of devices
58 
59  #define __P33SMPS_FJA__
60 
61 #elif defined (__dsPIC33EP16GS202__) || defined (__dsPIC33EP32GS202__)
62 // TLAL family of devices
63 
64  #define __P33SMPS_EP__
65  #define __P33SMPS_EP2__
66 
67 #elif defined (__dsPIC33EP16GS502__) || defined (__dsPIC33EP32GS502__) || defined (__dsPIC33EP64GS502__) || \
68  defined (__dsPIC33EP16GS504__) || defined (__dsPIC33EP32GS504__) || defined (__dsPIC33EP64GS504__) || \
69  defined (__dsPIC33EP16GS505__) || defined (__dsPIC33EP32GS505__) || defined (__dsPIC33EP64GS505__) || \
70  defined (__dsPIC33EP16GS506__) || defined (__dsPIC33EP32GS506__) || defined (__dsPIC33EP64GS506__)
71 // TLAH family of devices
72 
73  #define __P33SMPS_EP__
74  #define __P33SMPS_EP5__
75 
76 #elif defined (__dsPIC33EP128GS702__) || defined (__dsPIC33EP128GS704__) || defined (__dsPIC33EP128GS705__) || \
77  defined (__dsPIC33EP128GS706__) || defined (__dsPIC33EP64GS708__) || defined (__dsPIC33EP128GS708__) || \
78  defined (__dsPIC33EP64GS804__) || defined (__dsPIC33EP128GS804__) || defined (__dsPIC33EP64GS805__) || \
79  defined (__dsPIC33EP128GS805__) || defined (__dsPIC33EP64GS806__) || defined (__dsPIC33EP128GS806__) || \
80  defined (__dsPIC33EP64GS808__) || defined (__dsPIC33EP128GS808__)
81 // TLAY family of devices
82 
83  #define __P33SMPS_EP__
84  #define __P33SMPS_EP7__
85  #define __P33SMPS_EP8__
86 
87 #elif defined (__dsPIC33CH64MP202__) || defined (__dsPIC33CH128MP202__) || \
88  defined (__dsPIC33CH64MP202S1__) || defined (__dsPIC33CH128MP202S1__) || \
89  defined (__dsPIC33CH64MP203__) || defined (__dsPIC33CH128MP203__) || \
90  defined (__dsPIC33CH64MP203S1__) || defined (__dsPIC33CH128MP203S1__) || \
91  defined (__dsPIC33CH64MP205__) || defined (__dsPIC33CH128MP205__) || defined (__dsPIC33CH256MP205__) || defined (__dsPIC33CH512MP205__) || \
92  defined (__dsPIC33CH64MP205S1__) || defined (__dsPIC33CH128MP205S1__) || defined (__dsPIC33CH256MP205S1__) || defined (__dsPIC33CH512MP205S1__) || \
93  defined (__dsPIC33CH64MP206__) || defined (__dsPIC33CH128MP206__) || defined (__dsPIC33CH256MP206__) || defined (__dsPIC33CH512MP206__) || \
94  defined (__dsPIC33CH64MP206S1__) || defined (__dsPIC33CH128MP206S1__) || defined (__dsPIC33CH256MP206S1__) || defined (__dsPIC33CH512MP206S1__) || \
95  defined (__dsPIC33CH64MP208__) || defined (__dsPIC33CH128MP208__) || defined (__dsPIC33CH256MP208__) || defined (__dsPIC33CH512MP208__) || \
96  defined (__dsPIC33CH64MP208S1__) || defined (__dsPIC33CH128MP208S1__) || defined (__dsPIC33CH256MP208S1__) || defined (__dsPIC33CH512MP208S1__)
97  // Gemini family of devices (master and slave core))
98 
99  #define __P33SMPS_CH__
100  #define __P33SMPS_CH2__
101 
102  #if defined (__dsPIC33CH64MP202S1__) || defined (__dsPIC33CH128MP202S1__) || \
103  defined (__dsPIC33CH64MP203S1__) || defined (__dsPIC33CH128MP203S1__) || \
104  defined (__dsPIC33CH64MP205S1__) || defined (__dsPIC33CH128MP205S1__) || defined (__dsPIC33CH256MP205S1__) || defined (__dsPIC33CH512MP205S1__) || \
105  defined (__dsPIC33CH64MP206S1__) || defined (__dsPIC33CH128MP206S1__) || defined (__dsPIC33CH256MP206S1__) || defined (__dsPIC33CH512MP206S1__) || \
106  defined (__dsPIC33CH64MP208S1__) || defined (__dsPIC33CH128MP208S1__) || defined (__dsPIC33CH256MP208S1__) || defined (__dsPIC33CH512MP208S1__)
107  // Gemini family of devices (slave core)
108  #define __P33SMPS_CH_SLV__
109  #define __P33SMPS_CH_SLV1__
110  #else
111  // Gemini family of devices (master core)
112  #define __P33SMPS_CH_MSTR__
113  #endif
114 
115 
116 #elif defined (__dsPIC33CH64MP502__) || defined (__dsPIC33CH128MP502__) || \
117  defined (__dsPIC33CH64MP502S1__) || defined (__dsPIC33CH128MP502S1__) || \
118  defined (__dsPIC33CH64MP503__) || defined (__dsPIC33CH128MP503__) || \
119  defined (__dsPIC33CH64MP503S1__) || defined (__dsPIC33CH128MP503S1__) || \
120  defined (__dsPIC33CH64MP505__) || defined (__dsPIC33CH128MP505__) || defined (__dsPIC33CH256MP505__) || defined (__dsPIC33CH512MP505__) || \
121  defined (__dsPIC33CH64MP505S1__) || defined (__dsPIC33CH128MP505S1__) || defined (__dsPIC33CH256MP505S1__) || defined (__dsPIC33CH512MP505S1__) || \
122  defined (__dsPIC33CH64MP506__) || defined (__dsPIC33CH128MP506__) || defined (__dsPIC33CH256MP506__) || defined (__dsPIC33CH512MP506__) || \
123  defined (__dsPIC33CH64MP506S1__) || defined (__dsPIC33CH128MP506S1__) || defined (__dsPIC33CH256MP506S1__) || defined (__dsPIC33CH512MP506S1__) || \
124  defined (__dsPIC33CH64MP508__) || defined (__dsPIC33CH128MP508__) || defined (__dsPIC33CH256MP508__) || defined (__dsPIC33CH512MP508__) || \
125  defined (__dsPIC33CH64MP508S1__) || defined (__dsPIC33CH128MP508S1__) || defined (__dsPIC33CH256MP508S1__) || defined (__dsPIC33CH512MP508S1__)
126  // Gemini family of devices with CAN FD (master and slave core)
127 
128  #define __P33SMPS_CH__
129  #define __P33SMPS_CH5__
130 
131  #if defined (__dsPIC33CH64MP502S1__) || defined (__dsPIC33CH128MP502S1__) || \
132  defined (__dsPIC33CH64MP503S1__) || defined (__dsPIC33CH128MP503S1__) || \
133  defined (__dsPIC33CH64MP505S1__) || defined (__dsPIC33CH128MP505S1__) || defined (__dsPIC33CH256MP505S1__) || defined (__dsPIC33CH512MP505S1__) || \
134  defined (__dsPIC33CH64MP506S1__) || defined (__dsPIC33CH128MP506S1__) || defined (__dsPIC33CH256MP506S1__) || defined (__dsPIC33CH512MP506S1__) || \
135  defined (__dsPIC33CH64MP508S1__) || defined (__dsPIC33CH128MP508S1__) || defined (__dsPIC33CH256MP508S1__) || defined (__dsPIC33CH512MP508S1__)
136  // Gemini family of devices with CAN FD (slave core)
137  #define __P33SMPS_CH_SLV__
138  #define __P33SMPS_CH_SLV1__
139  #else
140  #define __P33SMPS_CH_MSTR__
141  #endif
142 
143 #elif defined (__dsPIC33CK32MP102__) || defined (__dsPIC33CK64MP102__) || \
144  defined (__dsPIC33CK32MP103__) || defined (__dsPIC33CK64MP103__) || \
145  defined (__dsPIC33CK32MP105__) || defined (__dsPIC33CK64MP105__)
146 // Ara family of devices
147 
148  #define __P33SMPS_CK__
149  #define __P33SMPS_CK1__
150 
151 #elif defined (__dsPIC33CK32MP502__) || defined (__dsPIC33CK64MP502__) || defined (__dsPIC33CK128MP502__) || defined (__dsPIC33CK256MP502__) || \
152  defined (__dsPIC33CK32MP503__) || defined (__dsPIC33CK64MP503__) || defined (__dsPIC33CK128MP503__) || defined (__dsPIC33CK256MP503__) || \
153  defined (__dsPIC33CK32MP505__) || defined (__dsPIC33CK64MP505__) || defined (__dsPIC33CK128MP505__) || defined (__dsPIC33CK256MP505__) || \
154  defined (__dsPIC33CK32MP506__) || defined (__dsPIC33CK64MP506__) || defined (__dsPIC33CK128MP506__) || defined (__dsPIC33CK256MP506__) || \
155  defined (__dsPIC33CK64MP508__) || defined (__dsPIC33CK128MP508__) || defined (__dsPIC33CK256MP508__)
156 // Sagitta family of devices with CAN FD
157 
158  #define __P33SMPS_CK__
159  #define __P33SMPS_CK5__
160 
161 #else
162 
163  #pragma message "selected device not supported by peripheral driver libraries"
164 
165 #endif
166 
167 
168 #if defined (__dsPIC33FJ06GS101__)
169  #define __P33SMPS_FJ101__
170 #elif defined (__dsPIC33FJ06GS102__)
171  #define __P33SMPS_FJ102__
172 #elif defined (__dsPIC33FJ06GS202__)
173  #define __P33SMPS_FJ202__
174 #elif defined (__dsPIC33FJ16GS402__)
175  #define __P33SMPS_FJ402__
176 #elif defined (__dsPIC33FJ16GS404__)
177  #define __P33SMPS_FJ404__
178 #elif defined (__dsPIC33FJ16GS502__)
179  #define __P33SMPS_FJ502__
180 #elif defined (__dsPIC33FJ16GS504__)
181  #define __P33SMPS_FJ504__
182 
183 #elif defined (__dsPIC33FJ06GS001__)
184  #define __P33SMPS_FJA001__
185 #elif defined (__dsPIC33FJ06GS101A__)
186  #define __P33SMPS_FJA101__
187 #elif defined (__dsPIC33FJ06GS102A__)
188  #define __P33SMPS_FJA102__
189 #elif defined (__dsPIC33FJ16GS202A__)
190  #define __P33SMPS_FJA202__
191 #elif defined (__dsPIC33FJ09GS302__)
192  #define __P33SMPS_FJA302__
193 
194 #elif defined (__dsPIC33FJ32GS406__) || defined (__dsPIC33FJ64GS406__)
195  #define __P33SMPS_FJ406__
196 #elif defined (__dsPIC33FJ32GS606__) || defined (__dsPIC33FJ64GS606__)
197  #define __P33SMPS_FJ606__
198 #elif defined (__dsPIC33FJ32GS608__) || defined (__dsPIC33FJ64GS608__)
199  #define __P33SMPS_FJ608__
200 #elif defined (__dsPIC33FJ32GS610__) || defined (__dsPIC33FJ64GS610__)
201  #define __P33SMPS_FJ610__
202 
203 #elif defined (__dsPIC33EP16GS202__) || defined (__dsPIC33EP32GS202__)
204  #define __P33SMPS_EP202__
205 #elif defined (__dsPIC33EP16GS502__) || defined (__dsPIC33EP32GS502__) || defined (__dsPIC33EP64GS502__)
206  #define __P33SMPS_EP502__
207 #elif defined (__dsPIC33EP16GS504__) || defined (__dsPIC33EP32GS504__) || defined (__dsPIC33EP64GS504__)
208  #define __P33SMPS_EP504__
209 #elif defined (__dsPIC33EP16GS505__) || defined (__dsPIC33EP32GS505__) || defined (__dsPIC33EP64GS505__)
210  #define __P33SMPS_EP505__
211 #elif defined (__dsPIC33EP16GS506__) || defined (__dsPIC33EP32GS506__) || defined (__dsPIC33EP64GS506__)
212  #define __P33SMPS_EP506__
213 
214 #elif defined (__dsPIC33EP128GS702__)
215  #define __P33SMPS_EP702__
216 #elif defined (__dsPIC33EP128GS704__)
217  #define __P33SMPS_EP704__
218 #elif defined (__dsPIC33EP128GS705__)
219  #define __P33SMPS_EP705__
220 #elif defined (__dsPIC33EP128GS706__)
221  #define __P33SMPS_EP706__
222 #elif defined (__dsPIC33EP64GS708__) || defined (__dsPIC33EP128GS708__)
223  #define __P33SMPS_EP708__
224 
225 #elif defined (__dsPIC33EP64GS804__) || defined (__dsPIC33EP128GS804__)
226  #define __P33SMPS_EP804__
227 #elif defined (__dsPIC33EP64GS805__) || defined (__dsPIC33EP128GS805__)
228  #define __P33SMPS_EP805__
229 #elif defined (__dsPIC33EP64GS806__) || defined (__dsPIC33EP128GS806__)
230  #define __P33SMPS_EP806__
231 #elif defined (__dsPIC33EP64GS808__) || defined (__dsPIC33EP128GS808__)
232  #define __P33SMPS_EP808__
233 
234 #elif defined (__dsPIC33CH64MP202S1__) || defined (__dsPIC33CH128MP202S1__)
235  #define __P33SMPS_CH202__
236 #elif defined (__dsPIC33CH64MP202__) || defined (__dsPIC33CH128MP202__)
237  #define __P33SMPS_CH202__
238 #elif defined (__dsPIC33CH64MP203S1__) || defined (__dsPIC33CH128MP203S1__)
239  #define __P33SMPS_CH203__
240 #elif defined (__dsPIC33CH64MP203__) || defined (__dsPIC33CH128MP203__)
241  #define __P33SMPS_CH203__
242 #elif defined (__dsPIC33CH64MP205S1__) || defined (__dsPIC33CH128MP205S1__)
243  #define __P33SMPS_CH205__
244 #elif defined (__dsPIC33CH64MP205__) || defined (__dsPIC33CH128MP205__)
245  #define __P33SMPS_CH205__
246 #elif defined (__dsPIC33CH256MP205S1__) || defined (__dsPIC33CH512MP205S1__)
247  #define __P33SMPS_CH205__
248 #elif defined (__dsPIC33CH256MP205__) || defined (__dsPIC33CH512MP205__)
249  #define __P33SMPS_CH205__
250 #elif defined (__dsPIC33CH64MP206S1__) || defined (__dsPIC33CH128MP206S1__)
251  #define __P33SMPS_CH206__
252 #elif defined (__dsPIC33CH64MP206__) || defined (__dsPIC33CH128MP206__)
253  #define __P33SMPS_CH206__
254 #elif defined (__dsPIC33CH256MP206S1__) || defined (__dsPIC33CH512MP206S1__)
255  #define __P33SMPS_CH206__
256 #elif defined (__dsPIC33CH256MP206__) || defined (__dsPIC33CH512MP206__)
257  #define __P33SMPS_CH206__
258 #elif defined (__dsPIC33CH64MP208S1__) || defined (__dsPIC33CH128MP208S1__)
259  #define __P33SMPS_CH208__
260 #elif defined (__dsPIC33CH64MP208__) || defined (__dsPIC33CH128MP208__)
261  #define __P33SMPS_CH208__
262 #elif defined (__dsPIC33CH256MP208S1__) || defined (__dsPIC33CH512MP208S1__)
263  #define __P33SMPS_CH208__
264 #elif defined (__dsPIC33CH256MP208__) || defined (__dsPIC33CH512MP208__)
265  #define __P33SMPS_CH208__
266 
267 #elif defined (__dsPIC33CH64MP502S1__) || defined (__dsPIC33CH128MP502S1__)
268  #define __P33SMPS_CH502__
269 #elif defined (__dsPIC33CH64MP502__) || defined (__dsPIC33CH128MP502__)
270  #define __P33SMPS_CH502__
271 #elif defined (__dsPIC33CH64MP503S1__) || defined (__dsPIC33CH128MP503S1__)
272  #define __P33SMPS_CH503__
273 #elif defined (__dsPIC33CH64MP503__) || defined (__dsPIC33CH128MP503__)
274  #define __P33SMPS_CH503__
275 #elif defined (__dsPIC33CH64MP505S1__) || defined (__dsPIC33CH128MP505S1__)
276  #define __P33SMPS_CH505__
277 #elif defined (__dsPIC33CH64MP505__) || defined (__dsPIC33CH128MP505__)
278  #define __P33SMPS_CH505__
279 #elif defined (__dsPIC33CH256MP505S1__) || defined (__dsPIC33CH512MP505S1__)
280  #define __P33SMPS_CH505__
281 #elif defined (__dsPIC33CH256MP505__) || defined (__dsPIC33CH512MP505__)
282  #define __P33SMPS_CH505__
283 #elif defined (__dsPIC33CH64MP506S1__) || defined (__dsPIC33CH128MP506S1__)
284  #define __P33SMPS_CH506S1__
285 #elif defined (__dsPIC33CH64MP506__) || defined (__dsPIC33CH128MP506__)
286  #define __P33SMPS_CH506__
287 #elif defined (__dsPIC33CH256MP506S1__) || defined (__dsPIC33CH512MP506S1__)
288  #define __P33SMPS_CH506S1__
289 #elif defined (__dsPIC33CH256MP506__) || defined (__dsPIC33CH512MP506__)
290  #define __P33SMPS_CH506__
291 #elif defined (__dsPIC33CH64MP508S1__) || defined (__dsPIC33CH128MP508S1__)
292  #define __P33SMPS_CH508__
293 #elif defined (__dsPIC33CH64MP508__) || defined (__dsPIC33CH128MP508__)
294  #define __P33SMPS_CH508__
295 #elif defined (__dsPIC33CH256MP508S1__) || defined (__dsPIC33CH512MP508S1__)
296  #define __P33SMPS_CH508__
297 #elif defined (__dsPIC33CH256MP508__) || defined (__dsPIC33CH512MP508__)
298  #define __P33SMPS_CH508__
299 
300 #elif defined (__dsPIC33CK32MP102__) || defined (__dsPIC33CK64MP102__)
301  #define __P33SMPS_CK102__
302 #elif defined (__dsPIC33CK32MP103__) || defined (__dsPIC33CK64MP103__)
303  #define __P33SMPS_CK103__
304 #elif defined (__dsPIC33CK32MP105__) || defined (__dsPIC33CK64MP105__)
305  #define __P33SMPS_CK105__
306 
307 #elif defined (__dsPIC33CK32MP502__) || defined (__dsPIC33CK64MP502__) || defined (__dsPIC33CK128MP502__) || defined (__dsPIC33CK256MP502__)
308  #define __P33SMPS_CK502__
309 #elif defined (__dsPIC33CK32MP503__) || defined (__dsPIC33CK64MP503__) || defined (__dsPIC33CK128MP503__) || defined (__dsPIC33CK256MP503__)
310  #define __P33SMPS_CK503__
311 #elif defined (__dsPIC33CK32MP505__) || defined (__dsPIC33CK64MP505__) || defined (__dsPIC33CK128MP505__) || defined (__dsPIC33CK256MP505__)
312  #define __P33SMPS_CK505__
313 #elif defined (__dsPIC33CK32MP506__) || defined (__dsPIC33CK64MP506__) || defined (__dsPIC33CK128MP506__) || defined (__dsPIC33CK256MP506__)
314  #define __P33SMPS_CK506__
315 #elif defined (__dsPIC33CK64MP508__) || defined (__dsPIC33CK128MP508__) || defined (__dsPIC33CK256MP508__)
316  #define __P33SMPS_CK508__
317 #else
318  #pragma message "selected device not supported by peripheral driver libraries"
319 #endif
320 
321 
322 
323 #endif /* _MCAL_P33_SMPS_DEVICE_DEFINITION_H_ */
324