Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example
dev_buck_ptemp_adc.h
1
/* Microchip Technology Inc. and its subsidiaries. You may use this software
2
* and any derivatives exclusively with Microchip products.
3
*
4
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
5
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
6
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
7
* PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
8
* WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
9
*
10
* IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
11
* INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
12
* WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
13
* BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
14
* FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS
15
* IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF
16
* ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
17
*
18
* MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
19
* TERMS.
20
*/
21
22
/*
23
* File: dev_buck_ptemp_adc.h
24
* Author: M91406
25
* Comments: ADC Peripheral Special Function Register Configuration Template
26
* Revision history:
27
* 10/29/2020 1.0 initial release
28
*/
29
30
// This is a guard condition so that contents of this file are not included
31
// more than once.
32
#ifndef BUCK_CONVERTER_PERIPHERAL_CONFIGURATION_ADC_H
33
#define BUCK_CONVERTER_PERIPHERAL_CONFIGURATION_ADC_H
34
35
#include <xc.h>
// include processor files - each processor file is guarded.
36
#include <stdint.h>
// include standard integer data types
37
#include <stdbool.h>
// include standard boolean data types
38
#include <stddef.h>
// include standard definition data types
39
44
/* ********************************************************************************
45
* ADC BASE MODULE BASE REGISTERS CONFIGURATION
46
* *******************************************************************************/
51
#define ADC_POWERUP_TIMEOUT 5000
52
/* SLPxDAT: DACx SLOPE DATA REGISTER => Timing Register: User value will be set in code */
53
54
// ADC specific declarations
59
#define ADC_CORE_MASK 0b0000000010001111
60
65
#define ADC_CORE0_MASK_INDEX 0b0000000000000001
66
71
#define ADC_CORE1_MASK_INDEX 0b0000000000000010
72
77
#define ADC_CORE2_MASK_INDEX 0b0000000000000100
78
83
#define ADC_CORE3_MASK_INDEX 0b0000000000001000
84
89
#define ADC_SHRCORE_MASK_INDEX 0b0000000010000000
90
91
/* ********************************************************************************
92
* ADC INPUT INSTANCE CONFIGURATION
93
* *******************************************************************************/
94
95
96
/* REGISTER VALUE DECLARATION TEMPLATE */
97
/* PCLKCON: PWM CLOCK CONTROL REGISTER
98
99
________________ BIT 15: HRRDY: High-Resolution Ready bit
100
| _______________ BIT 14: HRERR: High-Resolution Error bit
101
|| ______________ BIT 13: (unimplemented)
102
||| _____________ BIT 12: (unimplemented)
103
|||| ____________ BIT 11: (unimplemented)
104
||||| ___________ BIT 10: (unimplemented)
105
|||||| __________ BIT 9: (unimplemented)
106
||||||| _________ BIT 8: LOCK: Lock bit
107
|||||||| ________ BIT 7: (unimplemented)
108
||||||||| _______ BIT 6: (unimplemented)
109
|||||||||| ______ BIT 5: DIVSEL[1:0]: PWM Clock Divider Selection bits
110
||||||||||| _____ BIT 4:
111
|||||||||||| ____ BIT 3: (unimplemented)
112
||||||||||||| ___ BIT 2: (unimplemented)
113
|||||||||||||| __ BIT 1: MCLKSEL[1:0]: PWM Master Clock Selection bits
114
||||||||||||||| _ BIT 0:
115
|||||||||||||||| */
/*
116
#define REG_PCLKCON 0b0000000000000011 */
117
118
119
120
#endif
/* BUCK_CONVERTER_PERIPHERAL_CONFIGURATION_ADC_H */
121
dpsk_buck_vmc.X
sources
power_control
devices
templates
dev_buck_ptemp_adc.h
© 2021, Microchip Technology Inc.