00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _PIC24_REFLOW_H_
00030 #define _PIC24_REFLOW_H_
00031
00032 typedef struct _PSET {
00033 uint8 u8_dc;
00034 uint8 u8_period;
00035 } PSET;
00036
00037 #if defined(__PIC24HJ64GP502__)|| defined(__PIC24FJ64GA002__)
00038 #define LAST_IMPLEMENTED_PMEM 0x00ABFF
00039 #elif defined(__PIC24HJ32GP202__) || defined(__PIC24FJ32GA002__)
00040 #define LAST_IMPLEMENTED_PMEM 0x0057FF
00041 #else
00042 #error "Define LAST_IMPLEMENTED_PMEM for your processor!
00043 #endif
00044
00045
00046
00047 #define DATA_FLASH_PAGE (LAST_IMPLEMENTED_PMEM/FLASH_PAGESIZE)*FLASH_PAGESIZE //each instruction occupies two program memory addresses
00048
00049 #define FREE_STATUS 0x69A5 //arbitrarily chosen, different from USED_STATUS
00050 #define USED_STATUS 0x965A //arbitrarily chosen, different from FREE_STATUS
00051
00052 #define NUM_PROFILES 2 //number of profiles
00053 #define LEADFREE 1
00054 #define LEADTIN 0
00055
00056
00057
00058
00059
00060
00061
00062
00063 typedef struct _PROFILE{
00064 int16 i16_preheatTemp;
00065 uint16 u16_preheatTime ;
00066 int16 i16_soakTemp;
00067 uint16 u16_soakTime;
00068 int16 i16_reflowTemp;
00069 uint16 u16_reflowTime;
00070 uint16 u16_reflowHoldTime;
00071 int16 i16_coolTemp;
00072 uint16 u16_coolTime;
00073 int16 i16_wetTemp;
00074 }PROFILE;
00075
00076
00077
00078 extern const PROFILE profiles[NUM_PROFILES];
00079
00080 typedef struct _CALDATA{
00081 uint16 temp[100];
00082 }CALDATA;
00083
00084
00085 #define NUM_ROWS (((1*sizeof(CALDATA))/FLASH_ROWBYTES) + 1)
00086 #define FLASH_DATA_SIZE (NUM_ROWS*FLASH_ROWBYTES)
00087
00088 typedef union _UFDATA{
00089 CALDATA caldata;
00090 char fill[FLASH_DATA_SIZE];
00091 }UFDATA;
00092
00093 extern UFDATA fdata;
00094
00095
00096 #define MAX_POWER_SETTING 100
00097 #define MAX_TEMP 270 //do not exceed this temperature
00098
00099
00100 #define CONFIG_SLAVE_ENABLE() CONFIG_RB8_AS_DIG_OUTPUT()
00101 #define SLAVE_ENABLE() _LATB8 = 0 //high true assertion
00102 #define SLAVE_DISABLE() _LATB8 = 1
00103
00104 #define ZEROCROSS _RB6
00105
00106 extern uint8 u8_currPowerSetting;
00107 extern uint8 u8_currentProfile;
00108 extern uint16 readMAX6675(void);
00109 extern void decrementPower(void);
00110 extern void incrementPower(void);
00111 extern void setPower(uint8 newPower);
00112 extern void doDebugMenu(void);
00113 extern void doProfileMenu(void);
00114 extern char *getProfileDesc(uint8 u8_p);
00115 extern int16 getCelsiusI16Temp(void);
00116 extern float getCelsiusFloatTemp(void);
00117 extern void doReflow(void);
00118 extern uint16 volatile u16_tenthSeconds;
00119 extern uint8 getPower(void);
00120 extern void doRead(UFDATA* p_ufdata);
00121
00122
00123 #endif
00124
00125