PIC24 Support Libraries
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
chap15
reflow_oven.h
1
/*
2
* "Copyright (c) 2008 Robert B. Reese, Bryan A. Jones, J. W. Bruce ("AUTHORS")"
3
* All rights reserved.
4
* (R. Reese, reese_AT_ece.msstate.edu, Mississippi State University)
5
* (B. A. Jones, bjones_AT_ece.msstate.edu, Mississippi State University)
6
* (J. W. Bruce, jwbruce_AT_ece.msstate.edu, Mississippi State University)
7
*
8
* Permission to use, copy, modify, and distribute this software and its
9
* documentation for any purpose, without fee, and without written agreement is
10
* hereby granted, provided that the above copyright notice, the following
11
* two paragraphs and the authors appear in all copies of this software.
12
*
13
* IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
14
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
15
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
16
* HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
*
18
* THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21
* ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
22
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
23
*
24
* Please maintain this header in its entirety when copying/modifying
25
* these files.
26
*
27
*
28
*/
29
#ifndef _PIC24_REFLOW_H_
30
#define _PIC24_REFLOW_H_
31
32
typedef
struct
_PSET {
33
uint8_t
u8_dc;
34
uint8_t
u8_period;
35
} PSET;
36
37
#if defined(__PIC24HJ64GP502__) || defined(__PIC24FJ64GA002__)
38
#define LAST_IMPLEMENTED_PMEM 0x00ABFF
39
#elif defined(__PIC24HJ32GP202__) || defined(__PIC24FJ32GA002__) || defined(__dsPIC33FJ32GP202__)
40
#define LAST_IMPLEMENTED_PMEM 0x0057FF
41
#elif defined(__dsPIC33FJ128GP802__)
42
#define LAST_IMPLEMENTED_PMEM 0x0157FF
43
#else
44
#error "Define LAST_IMPLEMENTED_PMEM for your processor!
45
#endif
46
47
48
49
//calculate starting address of last page of program memory
50
#define DATA_FLASH_PAGE (LAST_IMPLEMENTED_PMEM/FLASH_PAGESIZE)*FLASH_PAGESIZE //each instruction occupies two program memory addresses
51
52
#define FREE_STATUS 0x69A5 //arbitrarily chosen, different from USED_STATUS
53
#define USED_STATUS 0x965A //arbitrarily chosen, different from FREE_STATUS
54
55
#define NUM_PROFILES 2 //number of profiles
56
#define LEADFREE 1
57
#define LEADTIN 0
58
59
60
/*
61
profile is hardcoded since generic lead-free versus
62
Tin-solder mix works ok
63
*/
64
65
66
typedef
struct
_PROFILE {
67
int16_t
i16_preheatTemp;
//target temperature
68
uint16_t
u16_preheatTime ;
//ramp
69
int16_t
i16_soakTemp;
//target temperature
70
uint16_t
u16_soakTime;
71
int16_t
i16_reflowTemp;
//time to maintain reflow in seconds
72
uint16_t
u16_reflowTime;
73
uint16_t
u16_reflowHoldTime;
74
int16_t
i16_coolTemp;
75
uint16_t
u16_coolTime;
76
int16_t
i16_wetTemp;
77
} PROFILE;
78
79
/* first profile is Tin/Lead mix, 2nd is lead free */
80
81
extern
const
PROFILE profiles[NUM_PROFILES];
82
83
typedef
struct
_CALDATA {
84
uint16_t
temp[100];
//temp data from 1 to 100
85
} CALDATA;
86
87
88
#define NUM_ROWS (((1*sizeof(CALDATA))/FLASH_ROWBYTES) + 1)
89
#define FLASH_DATA_SIZE (NUM_ROWS*FLASH_ROWBYTES)
90
91
typedef
union
_UFDATA {
92
CALDATA caldata;
93
char
fill[FLASH_DATA_SIZE];
//worst case allocates extra row, but ensures RAM data block is multiple of row size
94
} UFDATA;
95
96
extern
UFDATA fdata;
97
98
99
#define MAX_POWER_SETTING 100
100
#define MAX_TEMP 270 //do not exceed this temperature
101
102
103
#define CONFIG_SLAVE_ENABLE() CONFIG_RB8_AS_DIG_OUTPUT()
104
#define SLAVE_ENABLE() _LATB8 = 0 //high true assertion
105
#define SLAVE_DISABLE() _LATB8 = 1
106
107
#define ZEROCROSS _RB6
108
109
extern
uint8_t
u8_currPowerSetting;
110
extern
uint8_t
u8_currentProfile;
111
extern
uint16_t
readMAX6675(
void
);
112
extern
void
decrementPower(
void
);
113
extern
void
incrementPower(
void
);
114
extern
void
setPower(
uint8_t
newPower);
115
extern
void
doDebugMenu(
void
);
116
extern
void
doProfileMenu(
void
);
117
extern
char
*getProfileDesc(
uint8_t
u8_p);
118
extern
int16_t
getCelsiusI16Temp(
void
);
119
extern
float
getCelsiusFloatTemp(
void
);
120
extern
void
doReflow(
void
);
121
extern
uint16_t
volatile
u16_tenthSeconds;
122
extern
uint8_t
getPower(
void
);
123
extern
void
doRead(UFDATA* p_ufdata);
124
125
126
#endif
127
128
Generated by
1.8.4