Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
aareyes
refusion_oven
Commits
26afa814
Unverified
Commit
26afa814
authored
Apr 05, 2020
by
Andy Abreu Reyes
Committed by
GitHub
Apr 05, 2020
Browse files
Add files via upload
parent
31130c34
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
12844 additions
and
0 deletions
+12844
-0
HORNO_MAX6675_2550_V1.0/code/18F2550.h
HORNO_MAX6675_2550_V1.0/code/18F2550.h
+758
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.STA
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.STA
+126
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.c
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.c
+143
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.ccspjt
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.ccspjt
+21
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.cof
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.cof
+0
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.err
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.err
+22
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.esym
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.esym
+1357
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.hex
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.hex
+749
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.lst
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.lst
+8350
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.sym
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.sym
+366
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.tre
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.tre
+384
-0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.xsym
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.xsym
+0
-0
HORNO_MAX6675_2550_V1.0/code/funciones.h
HORNO_MAX6675_2550_V1.0/code/funciones.h
+568
-0
No files found.
HORNO_MAX6675_2550_V1.0/code/18F2550.h
0 → 100644
View file @
26afa814
This diff is collapsed.
Click to expand it.
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.STA
0 → 100644
View file @
26afa814
ROM used: 11884/16384 (36%)
11884/16384 (36%) including unused fragments
2.8 Average locations per line
14.0 Average locations per statement
RAM used: 64/2048 (3%) at main() level
156/2048 (8%) worst case
Stack used: 10 worst case (9 in main + 1 for interrupts)
Stack size: 31
Lines Stmts % Files
----- ----- --- -----
144 52 6 HORNO_MAX6675_2550_V1.0.c
759 0 0 C:\Program Files (x86)\PICC\Devices\18F2550.h
456 100 12 C:\Program Files (x86)\PICC\Drivers\lcd.c
2229 257 30 C:\Program Files (x86)\PICC\Drivers\math.h
81 21 2 tones.c
569 417 49 funciones.h
----- -----
4238 847 Total
Page ROM % RAM Vol Diff Functions:
---- --- --- --- --- ---- ----------
0 38 0 1 @delay_ms1
0 32 0 1 @delay_us1
0 78 0 6 @SPI_XFER_1
0 78 0 6 @SPI_XFER_2
0 30 0 0 @const668
0 74 0 3 760 4.5 lcd_read_byte
0 82 0 2 262 3.7 lcd_read_nibble
0 64 0 1 399 2.4 lcd_send_nibble
0 70 0 3 415 3.7 lcd_send_byte
0 110 0 2 704 5.0 lcd_init
0 34 0 4 208 6.3 lcd_gotoxy
0 80 0 1 354 4.7 lcd_putc
0 74 0 5 267 6.8 lcd_set_cgram_char
0 118 0 10 @FLT
0 56 0 4 @SFTOI
0 54 0 2 @ITOF
0 242 1 11 @MULFF
0 618 3 16 @ADDFF
0 346 1 14 @DIVFF
0 54 0 5 285 4.3 do_delay
0 468 2 26 777 6.7 generate_tone
0 142 1 13 @DIV3232
0 66 0 5 @DIV1616
0 86 0 14 @MUL3232
0 254 1 2 831 3.4 tono
0 380 2 1 1965 9.9 mode_insert
0 2 0 0 @const911
0 32 0 2 @PSTRINGC_687
0 28 0 0 @const914
0 2 0 0 @const915
0 16 0 0 @const917
0 2 0 0 @const918
0 36 0 2 @PSTRINGR_687
0 40 0 3 @DIV88
0 102 0 2 @PRINTF_U_687
0 288 1 3 852 6.1 read_tmp
0 18 0 0 @const931
0 18 0 0 @const933
0 2038 9 1 5933 3.5 subroutine_mode
0 2 0 0 @const937
0 8 0 0 @const939
0 716 3 37 791 6.3 PID
0 884 4 4 1878 8.9 precalentamiento
0 2 0 0 @const955
0 48 0 0 @const957
0 2 0 0 @const958
0 18 0 0 @const960
0 64 0 5 @FTOSD
0 388 2 13 @PRINTF_L32D_687FPFPF
0 4 0 0 @const968
0 2 0 0 @const969
0 612 3 4 1030 5.8 calentamiento
0 2 0 0 @const974
0 16 0 0 @const976
0 4 0 0 @const979
0 2 0 0 @const980
0 614 3 4 1030 5.8 refusion
0 2 0 0 @const985
0 14 0 0 @const987
0 4 0 0 @const990
0 2 0 0 @const991
0 618 3 4 1061 5.8 enfriamiento
0 2 0 0 @const996
0 16 0 0 @const998
0 4 0 0 @const1001
0 2 0 0 @const1002
0 76 0 0 524 2.9 restart
0 404 2 4 786 5.7 over
0 2 0 0 @const1006
0 18 0 0 @const1008
0 2 0 0 @const1010
0 18 0 0 @const1012
0 18 0 0 83 3.5 RTCC_isr
0 774 3 1 1631 3.9 MAIN
0 12 0 0 @const1019
0 10 0 0 @const1021
0 2 0 0 @const1022
Inline 0 @cinit1
Program metrics:
Functions 23
Statements 847
Comments 651
Volume (V) 36822
Difficulty (D) 115.0
Effort to implement (E) 4235775
Time to implement (T) 65 hours, 22 minutes
Est Delivered Bugs (B) 9
Cyclomatic Complexity 44
Maintainability (MI) 120
Segment Used Free
----------- ---- ----
00000-00002 4 0
00004-00006 0 4
00008-00094 142 0
00096-07FFE 11738 20880
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.c
0 → 100644
View file @
26afa814
#include <18F2550.h>
#device ADC=10
#FUSES MCLR //Master Clear
#FUSES WDT //Watch Dog Timer
#FUSES WDT2048 //Watch Dog Timer uses 1:512 Postscale
#FUSES PUT //Power Up Timer
#FUSES BORV43 //Brownout reset at 4.3V
#FUSES NOVREGEN //USB voltage regulator disabled
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used FOR I/O
#FUSES NOPBADEN
#FUSES PROTECT //Code protected from reads
#FUSES CPUDIV1
#use delay(INTERNAL=8000000) //FRECUENCIA RELOJ DEL PIC(INTERNA)
#define LCD_ENABLE_PIN PIN_A6
#define LCD_RS_PIN PIN_A4
#define LCD_RW_PIN PIN_A5
#define LCD_DATA4 PIN_C4
#define LCD_DATA5 PIN_C5
#define LCD_DATA6 PIN_C6
#define LCD_DATA7 PIN_C7
#define M1_PREC_TEMP_0 0x00
#define M1_PREC_TEMP_1 0x01
#define M1_CALENT_TEMP_0 0x02
#define M1_CALENT_TEMP_1 0x03
#define M1_REFUS_TEMP_0 0x04
#define M1_REFUS_TEMP_1 0x05
#define M1_ENF_TEMP_0 0x06
#define M1_ENF_TEMP_1 0x07
#define M1_PREC_TIME 0x08
#define M1_CALENT_TIME 0x09
#define M1_REFUS_TIME 0x0A
#define M1_ENF_TIME 0x0B
#USE SPI (MASTER, CLK=PIN_A0, DI=PIN_A1,ENABLE=PIN_B6,ENABLE_DELAY=2,BITS=16,stream=TP_1,mode=0,baud=9600)
#USE SPI (MASTER, CLK=PIN_A0, DI=PIN_A1,ENABLE=PIN_B7,ENABLE_DELAY=2,BITS=16,stream=TP_2,mode=0,baud=9600)
#USE RS232(baud=9600,parity=N,xmit=PIN_A3,rcv=PIN_A2,bits=8,stream=SERIAL_DATA)
#USE PWM (pwm1,FREQUENCY=1000,stream=pwm1)
#USE PWM (pwm2,FREQUENCY=1000,stream=pwm2)
int8
counter
=
0
,
time
=
0
;
int8
reading
=
0
;
int8
mode
=
0
;
int16
prec
,
calent
,
refus
,
enf
;
//temperaturas
int8
tprec
,
tcalent
,
trefus
,
tenf
;
//iempos
int1
flag
=
0
;
int16
LCK
[
2
];
float
TMP
[
2
];
int16
temperature
=
0
;
//evaluar si es necesaria la coma flotante
//variables del PID
float
min
=
0
;
//inicializacin variables
float
max
=
0
;
int16
control
=
0
;
//constantes del PID
const
float
a
=
0
.
1243
;
const
float
b
=
0
.
0062
;
const
float
c
=
0
.
6215
;
#include <lcd.c>
#include <math.h>
#include "tones.c"
#include "funciones.h"
#INT_RTCC
void
RTCC_isr
(
void
)
{
//hacer funcion para inicializar counter = time
if
(
counter
==
0
)
flag
=
1
;
else
{
counter
--
;
time
++
;
}
}
void
main
(
void
){
pwm_off
(
pwm1
);
pwm_off
(
pwm2
);
delay_ms
(
1000
);
//tiempo de espera
lcd_init
();
//////////////////////////////////caracteres personalizados
unsigned
int8
grados
[
8
];
grados
[
0
]
=
0
b00001110
;
grados
[
1
]
=
0
b00001010
;
grados
[
2
]
=
0
b00001110
;
grados
[
3
]
=
0
b00000000
;
grados
[
4
]
=
0
b00000000
;
grados
[
5
]
=
0
b00000000
;
grados
[
6
]
=
0
b00000000
;
grados
[
7
]
=
0
b00000000
;
lcd_set_cgram_char
(
2
,
grados
);
//////////////////////////////////pantalla de inicio
lcd_gotoxy
(
4
,
1
);
printf
(
lcd_putc
,
"%s"
,
"TO2CONTROL"
);
lcd_gotoxy
(
5
,
2
);
printf
(
lcd_putc
,
"%s"
,
"FUSION-I"
);
delay_ms
(
2000
);
lcd_putc
(
"
\f
"
);
////////////////////////////////botones activos en LOW
port_b_pullups
(
0
b00111111
);
////////////////////////////////timer overflow 1.0s
setup_timer_0
(
RTCC_INTERNAL
|
RTCC_DIV_32
);
//1,0 s overflow
disable_interrupts
(
GLOBAL
);
write_eeprom
(
M1_PREC_TEMP_0
,
0x00
);
write_eeprom
(
M1_PREC_TEMP_1
,
0x0064
);
write_eeprom
(
M1_CALENT_TEMP_0
,
0x00
);
write_eeprom
(
M1_CALENT_TEMP_1
,
0x0096
);
write_eeprom
(
M1_REFUS_TEMP_0
,
0x00
);
write_eeprom
(
M1_REFUS_TEMP_1
,
0x009B
);
write_eeprom
(
M1_ENF_TEMP_0
,
0x00
);
write_eeprom
(
M1_ENF_TEMP_1
,
0x0054
);
write_eeprom
(
M1_PREC_TIME
,
6
);
write_eeprom
(
M1_CALENT_TIME
,
5
);
write_eeprom
(
M1_REFUS_TIME
,
4
);
write_eeprom
(
M1_ENF_TIME
,
3
);
while
(
1
){
mode_insert
();
subroutine_mode
();
delay_ms
(
100
);
precalentamiento
();
calentamiento
();
refusion
();
enfriamiento
();
over
();
restart
();
restart_wdt
();
}
}
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.ccspjt
0 → 100644
View file @
26afa814
[PROJECT]
Target=HORNO_MAX6675_2550_V1.0.hex
Processor_Text=PIC18F2550
CCSVersion=5.010
Compiler=PCH
[Target Data]
FileList=HORNO_MAX6675_2550_V1.0.c
[Directories]
Include=C:\Program Files (x86)\PICC\Devices\;C:\Program Files (x86)\PICC\Drivers\;C:\Program Files (x86)\PICC\Drivers\C:\Program Files (x86)\PICC\Devices\;C:\Program Files (x86)\PICC\Drivers\C:\Program Files (x86)\PICC\Devices\C:\Program Files (x86)\PICC\Devices\;C:\Program Files (x86)\PICC\Drivers\C:\Program Files (x86)\PICC\Devices\C:\Program Files (x86)\PICC\Devices\C:\Program Files (x86)\PICC\Devices\;C:\Program Files (x86)\PICC\Drivers\C:\Program Files (x86)\PICC\Devices\C:\Program Files (x86)\PICC\Devices\C:\Program Files (x86)\PICC\Devices\C:\Program Files (x86)\PICC\Devices\
[HORNO_MAX6675_2550_V1.0.c]
Type=4
[mru-list]
1=HORNO_MAX6675_2550_V1.0.c
[Opened Files]
1=HORNO_MAX6675_2550_V1.0.c
2=
3=
4=
[Units]
Count=1
1=HORNO_MAX6675_2550_V1.0 (main)
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.cof
0 → 100644
View file @
26afa814
File added
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.err
0 → 100644
View file @
26afa814
--- Info 300 "HORNO_MAX6675_2550_V1.0.c" Line 44(1,1): More info: PWM Resolution: 8,97 bits
>>> Warning 203 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\funciones.h" Line 122(1,1): Condition always TRUE
>>> Warning 203 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\funciones.h" Line 192(1,1): Condition always TRUE
>>> Warning 203 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\funciones.h" Line 193(1,1): Condition always TRUE
>>> Warning 203 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\funciones.h" Line 368(1,1): Condition always TRUE
>>> Warning 229 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\funciones.h" Line 524(1,1): Subscript out of range
>>> Warning 229 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\funciones.h" Line 525(1,1): Subscript out of range
>>> Warning 203 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\funciones.h" Line 547(1,1): Condition always TRUE
>>> Warning 203 "HORNO_MAX6675_2550_V1.0.c" Line 129(1,1): Condition always TRUE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 23(12,18): Variable never used: C_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 24(12,19): Variable never used: Db_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 25(12,18): Variable never used: D_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 26(12,19): Variable never used: Eb_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 28(12,18): Variable never used: F_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 29(12,19): Variable never used: Gb_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 30(12,18): Variable never used: G_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 31(12,19): Variable never used: Ab_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 32(12,18): Variable never used: A_NOTE
>>> Warning 202 "E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\tones.c" Line 33(12,19): Variable never used: Bb_NOTE
Memory usage: ROM=36% RAM=3% - 8%
0 Errors, 18 Warnings.
Build Successful.
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.esym
0 → 100644
View file @
26afa814
This diff is collapsed.
Click to expand it.
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.hex
0 → 100644
View file @
26afa814
This diff is collapsed.
Click to expand it.
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.lst
0 → 100644
View file @
26afa814
This diff is collapsed.
Click to expand it.
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.sym
0 → 100644
View file @
26afa814
000 @SCRATCH
001 @SCRATCH
001 _RETURN_
002 @SCRATCH
003 @SCRATCH
004 @INTERRUPT_AREA
005 @INTERRUPT_AREA
006 @INTERRUPT_AREA
007 @INTERRUPT_AREA
008 @INTERRUPT_AREA
009 @INTERRUPT_AREA
00A @INTERRUPT_AREA
00B @INTERRUPT_AREA
00C @INTERRUPT_AREA
00D @INTERRUPT_AREA
00E @INTERRUPT_AREA
00F @INTERRUPT_AREA
010 @INTERRUPT_AREA
011 @INTERRUPT_AREA
012 @INTERRUPT_AREA
013 @INTERRUPT_AREA
014 @INTERRUPT_AREA
015 @INTERRUPT_AREA
016 counter
017 time
018 reading
019 mode
01A-01B prec
01C-01D calent
01E-01F refus
020-021 enf
022 tprec
023 tcalent
024 trefus
025 tenf
026.0 flag
027-02A LCK
02B-032 TMP
033-034 temperature
035-038 min
039-03C max
03D-03E control
03F-046 MAIN.grados
03F-042 atan2.y
043-046 atan2.x
047 lcd_init.i
047 mode_insert.i
047-04A atan2.z
047-04A precalentamiento.temp_actual
047-04A over.temp_0
047-04A refusion.temp_actual
047 lcd_set_cgram_char.which
047 subroutine_mode.a
047-04A enfriamiento.temp_actual
047-04A calentamiento.temp_actual
047 MAIN.@SCRATCH1
048 mode_insert.pos
048-049 lcd_set_cgram_char.ptr
048 subroutine_mode.b
048 lcd_init.@SCRATCH1
049-058 mode_insert.selec
049 subroutine_mode.@SCRATCH1
04A lcd_set_cgram_char.i
04B-04C enfriamiento.temp_min
04B-04C precalentamiento.temp_max
04B-04C refusion.temp_max
04B-04C calentamiento.temp_max
04B.0 atan2.sign
04B lcd_set_cgram_char.@SCRATCH1
04B over.@SCRATCH1
04C atan2.quad
04C over.@SCRATCH2
04D-050 refusion.temp_0
04D-050 precalentamiento.temp_0
04D-050 enfriamiento.temp_0
04D-050 calentamiento.temp_0
04D over.@SCRATCH3
04E over.@SCRATCH4
051 precalentamiento.i
051 calentamiento.@SCRATCH1
051 refusion.@SCRATCH1
051 enfriamiento.@SCRATCH1
052 PID.zone
052-055 @PRINTF_L32D_687FPFPF.P1
052 precalentamiento.@SCRATCH1
052 calentamiento.@SCRATCH2
052 refusion.@SCRATCH2
052 enfriamiento.@SCRATCH2
053-056 PID.rT
053 precalentamiento.@SCRATCH2
053 calentamiento.@SCRATCH3
053 refusion.@SCRATCH3
053 enfriamiento.@SCRATCH3
054 precalentamiento.@SCRATCH3
054 calentamiento.@SCRATCH4
054 refusion.@SCRATCH4
054 enfriamiento.@SCRATCH4
055 precalentamiento.@SCRATCH4
056 @PRINTF_L32D_687FPFPF.P1
057-05A PID.eT
057 @PRINTF_L32D_687FPFPF.@SCRATCH1
058 @PRINTF_L32D_687FPFPF.@SCRATCH2
059-063 mode_insert.modo
059 @PRINTF_L32D_687FPFPF.@SCRATCH3
05A @PRINTF_L32D_687FPFPF.@SCRATCH4
05B-05E PID.iT
05B @PRINTF_L32D_687FPFPF.@SCRATCH5
05C @PRINTF_L32D_687FPFPF.@SCRATCH6
05D @PRINTF_L32D_687FPFPF.@SCRATCH7
05E @PRINTF_L32D_687FPFPF.@SCRATCH8
05F-062 @FTOSD.P1
05F-062 PID.dT
063-066 PID.yT
063 @FTOSD.@SCRATCH1
064.0 mode_insert.flag
065 @PRINTF_U_687.P1
065 mode_insert.@SCRATCH1
065 @PSTRINGR_687.@SCRATCH1
066 @PRINTF_U_687.P1
066 @PSTRINGR_687.@SCRATCH2
067 @DIV88.P1
067-06A PID.uT
068 @DIV88.P1
069 @DIV88.@SCRATCH1
06B-06E PID.iT0
06F-072 PID.eT0
073 read_tmp.i
073-076 @FLT.P1
073-076 @SFTOI.P2
073-076 @MULFF.P3
073 PID.@SCRATCH1
074-075 @SPI_XFER_2.P1
074 tono.who
074-075 @SPI_XFER_1.P1
074 @PSTRINGC_687.@SCRATCH1
074 read_tmp.@SCRATCH1
074 PID.@SCRATCH2
075-076 generate_tone.frequency
075 tono.@SCRATCH1
075 @PSTRINGC_687.@SCRATCH2
075 read_tmp.@SCRATCH2
075 PID.@SCRATCH3
076 @SPI_XFER_1.P1
076 lcd_putc.c
076 @SPI_XFER_2.P1
076 read_tmp.@SCRATCH3
076 PID.@SCRATCH4
077-07A @MULFF.P1
077 lcd_gotoxy.x
077-078 @ITOF.P1
077-07A @DIVFF.P2
077-078 generate_tone.duration
077-07A @FLT.P1
077-07A @ADDFF.P2
077 @SPI_XFER_1.@SCRATCH1
077 @SPI_XFER_2.@SCRATCH1
078 lcd_gotoxy.y
078 @SPI_XFER_1.@SCRATCH2
078 @SPI_XFER_2.@SCRATCH2
079-07C generate_tone.total_delay_time
079 lcd_gotoxy.address
07A lcd_gotoxy.@SCRATCH1
07B-07E @DIVFF.P1
07B lcd_send_byte.address
07B-07E @ADDFF.P1
07B @FLT.@SCRATCH1
07B @MULFF.@SCRATCH1
07C lcd_send_byte.n
07C @FLT.@SCRATCH2
07C @MULFF.@SCRATCH2
07D lcd_read_byte.low
07D-07E generate_tone.total_ms_delay_time
07D lcd_send_byte.@SCRATCH1
07D @MULFF.@SCRATCH3
07E lcd_send_nibble.n
07E lcd_read_byte.high
07F lcd_read_nibble.n
07F-080 generate_tone.total_us_delay_time
07F lcd_read_byte.@SCRATCH1
07F @ADDFF.@SCRATCH1
07F @DIVFF.@SCRATCH1
080 lcd_read_nibble.@SCRATCH1
080 @ADDFF.@SCRATCH2
080 @DIVFF.@SCRATCH2
081 generate_tone.num_us_delays
081 @ADDFF.@SCRATCH3
081 @DIVFF.@SCRATCH3
082 generate_tone.num_ms_delays
082 @ADDFF.@SCRATCH4
082 @DIVFF.@SCRATCH4
083 generate_tone.ms_delay_time
083 @ADDFF.@SCRATCH5
083 @DIVFF.@SCRATCH5
084 generate_tone.us_delay_time
084 @ADDFF.@SCRATCH6
084 @DIVFF.@SCRATCH6
085-086 generate_tone.num_periods
085 @ADDFF.@SCRATCH7
086 @ADDFF.@SCRATCH8
087-088 @DIV1616.P1
087 do_delay.ms_delay
087 generate_tone.@SCRATCH1
088 do_delay.num_ms
088 generate_tone.@SCRATCH2
089 do_delay.us_delay
089-08A @DIV1616.P1
089 generate_tone.@SCRATCH3
08A do_delay.num_us
08A generate_tone.@SCRATCH4
08B do_delay.i
08B-08E @MUL3232.P1
08B generate_tone.@SCRATCH5
08B @DIV1616.@SCRATCH1
08C @delay_ms1.P1
08C @delay_us1.P2
08C generate_tone.@SCRATCH6
08D generate_tone.@SCRATCH7
08E generate_tone.@SCRATCH8
08F-092 @DIV3232.P1
08F-092 @MUL3232.P2
093-096 @DIV3232.P1
093 @MUL3232.@SCRATCH1
094 @MUL3232.@SCRATCH2
095 @MUL3232.@SCRATCH3
096 @MUL3232.@SCRATCH4
097 @DIV3232.@SCRATCH1
097 @MUL3232.@SCRATCH5
098 @DIV3232.@SCRATCH2
098 @MUL3232.@SCRATCH6
099 @DIV3232.@SCRATCH3
09A @DIV3232.@SCRATCH4
09B @DIV3232.@SCRATCH5
FB4.6 C1OUT
FB4.7 C2OUT
FBB CCP_2_LOW
FBB CCP_2
FBC CCP_2_HIGH
FBE CCP_1_LOW
FBE CCP_1
FBF CCP_1_HIGH
FE1-FE2 @READ_PACKED_MEMORY.P1
FE1-FE2 @WRITE_PACKED_MEMORY.P2
FE9-FEA @WRITE_PROGRAM_MEMORY.P1
FE9-FEA @READ_PROGRAM_MEMORY.P2
FE9-FEA @READ_PACKED_MEMORY.P3
FE9-FEA @WRITE_PACKED_MEMORY.P4
FF6-FF8 @WRITE_PROGRAM_MEMORY.P1
FF6-FF8 @READ_PROGRAM_MEMORY.P2
ROM Allocation:
000096 LCD_INIT_STRING.call
0000B0 LCD_INIT_STRING.data
0000B4 @const911.call
0000B6 @const914.call
0000D2 @const915.call
0000D4 @const917.call
0000E4 @const918.call
0000E6 @const931.call
0000F8 @const933.call
00010A @const937.call
00010C @const939.call
000114 @const955.call
000116 @const957.call
000146 @const958.call
000148 @const960.call
00015A @const968.call
00015E @const969.call
000160 @const974.call
000162 @const976.call
000172 @const979.call
000176 @const980.call
000178 @const985.call
00017A @const987.call
000188 @const990.call
00018C @const991.call
00018E @const996.call
000190 @const998.call
0001A0 @const1001.call
0001A4 @const1002.call
0001A6 @const1006.call
0001A8 @const1008.call
0001BA @const1010.call
0001BC @const1012.call
0001CE RTCC_isr
0001E0 @const1019.call
0001EC @const1021.call
0001F6 @const1022.call
0001F8 @delay_ms1
00021E lcd_send_nibble
00025E lcd_read_nibble
0002B0 lcd_read_byte
0002FA lcd_send_byte
000340 lcd_init
0003AE lcd_set_cgram_char
0003F8 lcd_gotoxy
00041A lcd_putc
00046A @PSTRINGC_687
00048A @DIV3232
000518 @DIV1616
00055A @MUL3232
0005B0 @delay_us1
0005D0 do_delay
000606 generate_tone
0007DA tono
0008D8 @PSTRINGR_687
0008FC @DIV88
000924 @PRINTF_U_687
00098A mode_insert
000B06 subroutine_mode
0012FC @SPI_XFER_1
00134A @SPI_XFER_2
001398 @ITOF
0013CE @DIVFF
001528 read_tmp
001648 @ADDFF
0018B2 @FLT
001928 @MULFF
001A1A @SFTOI
001A52 PID
001D1E @FTOSD
001D5E @PRINTF_L32D_687FPFPF
001EE2 precalentamiento
002256 calentamiento
0024BA refusion
002720 enfriamiento
00298A over
002B1E restart
002B6A @cinit1
002B6A MAIN
002BD8 @cinit2
Project Directory:
E:\iWork\PROYECTOS_PIC\HORNO\HORNO_MAX6675_2550_V1.0\
Project Files:
HORNO_MAX6675_2550_V1.0.c [13-mar-16 23:45 CRC=D9CF80B0]
C:\Program Files (x86)\PICC\Devices\18F2550.h [19-jul-13 15:10 CRC=7707FB52]
C:\Program Files (x86)\PICC\Drivers\lcd.c [23-ago-12 09:01 CRC=D28E8746]
C:\Program Files (x86)\PICC\Drivers\math.h [28-sep-12 11:35 CRC=546412C9]
tones.c [02-mar-16 21:35 CRC=437B685A]
funciones.h [27-mar-16 18:10 CRC=9325B0F3]
Source signature=E190E051
Units:
HORNO_MAX6675_2550_V1.0 (main)
Compiler Settings:
Processor: PIC18F2550
Pointer Size: 16
ADC Range: 0-1023
Opt Level: 9
Short,Int,Long: UNSIGNED: 1,8,16
Float,Double: 32,32
Output Files:
XREF file: HORNO_MAX6675_2550_V1.0.xsym
Errors: HORNO_MAX6675_2550_V1.0.err
Ext Symbols: HORNO_MAX6675_2550_V1.0.esym
INHX32: HORNO_MAX6675_2550_V1.0.hex
Symbols: HORNO_MAX6675_2550_V1.0.sym
List: HORNO_MAX6675_2550_V1.0.lst
Debug/COFF: HORNO_MAX6675_2550_V1.0.cof
Project: HORNO_MAX6675_2550_V1.0.ccspjt
Call Tree: HORNO_MAX6675_2550_V1.0.tre
Statistics: HORNO_MAX6675_2550_V1.0.STA
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.tre
0 → 100644
View file @
26afa814
HORNO_MAX6675_2550_V1
MAIN 0/774 Ram=1
@cinit1 (Inline) Ram=0
@delay_ms1 0/38 Ram=1
lcd_init 0/110 Ram=2
@delay_ms1 0/38 Ram=1
lcd_send_nibble 0/64 Ram=1
@delay_ms1 0/38 Ram=1
lcd_send_nibble 0/64 Ram=1
@delay_ms1 0/38 Ram=1
@const668 0/30 Ram=0
lcd_send_byte 0/70 Ram=3
lcd_read_byte 0/74 Ram=3
lcd_read_nibble 0/82 Ram=2
lcd_read_nibble 0/82 Ram=2
lcd_send_nibble 0/64 Ram=1
lcd_send_nibble 0/64 Ram=1
lcd_set_cgram_char 0/74 Ram=5
lcd_send_byte 0/70 Ram=3
*
lcd_send_byte 0/70 Ram=3
*
lcd_gotoxy 0/34 Ram=4
lcd_send_byte 0/70 Ram=3
*
@PSTRINGC_687 0/32 Ram=2
lcd_putc 0/80 Ram=1
lcd_gotoxy 0/34 Ram=4
*
lcd_send_byte 0/70 Ram=3
*
@delay_ms1 0/38 Ram=1
lcd_gotoxy 0/34 Ram=4
*
lcd_send_byte 0/70 Ram=3
*
lcd_send_byte 0/70 Ram=3
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@delay_ms1 0/38 Ram=1
@PSTRINGC_687 0/32 Ram=2
*
mode_insert 0/380 Ram=1
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@delay_ms1 0/38 Ram=1
tono 0/254 Ram=2
generate_tone 0/468 Ram=26
@DIV3232 0/142 Ram=13
@DIV3232 0/142 Ram=13
@DIV1616 0/66 Ram=5
@DIV1616 0/66 Ram=5
@DIV3232 0/142 Ram=13
@DIV1616 0/66 Ram=5
@DIV1616 0/66 Ram=5
@MUL3232 0/86 Ram=14
@DIV3232 0/142 Ram=13
@DIV3232 0/142 Ram=13
do_delay 0/54 Ram=5
@delay_ms1 0/38 Ram=1
@delay_ms1 0/38 Ram=1
@delay_us1 0/32 Ram=1
do_delay 0/54 Ram=5
*
@delay_ms1 0/38 Ram=1
generate_tone 0/468 Ram=26
*
generate_tone 0/468 Ram=26
*
generate_tone 0/468 Ram=26
*
@delay_ms1 0/38 Ram=1
generate_tone 0/468 Ram=26
*
generate_tone 0/468 Ram=26
*
@delay_ms1 0/38 Ram=1
generate_tone 0/468 Ram=26
*
@delay_ms1 0/38 Ram=1
generate_tone 0/468 Ram=26
*
@delay_ms1 0/38 Ram=1
generate_tone 0/468 Ram=26
*
generate_tone 0/468 Ram=26
*
@PSTRINGC_687 0/32 Ram=2
*
@PSTRINGC_687 0/32 Ram=2
*
tono 0/254 Ram=2
*
tono 0/254 Ram=2
*
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGR_687 0/36 Ram=2
lcd_putc 0/80 Ram=1
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGR_687 0/36 Ram=2
*
@PRINTF_U_687 0/102 Ram=2
@DIV88 0/40 Ram=3
lcd_putc 0/80 Ram=1
*
@DIV88 0/40 Ram=3
lcd_putc 0/80 Ram=1
*
lcd_putc 0/80 Ram=1
*
tono 0/254 Ram=2
*
subroutine_mode 0/2038 Ram=1
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@PRINTF_U_687 0/102 Ram=2
*
@delay_ms1 0/38 Ram=1
@delay_ms1 0/38 Ram=1
precalentamiento 0/884 Ram=4
@delay_ms1 0/38 Ram=1
read_tmp 0/288 Ram=3
@SPI_XFER_1 0/78 Ram=6
@SPI_XFER_2 0/78 Ram=6
@PSTRINGC_687 0/32 Ram=2
*
tono 0/254 Ram=2
*
@delay_ms1 0/38 Ram=1
@PSTRINGC_687 0/32 Ram=2
*
tono 0/254 Ram=2
*
@delay_ms1 0/38 Ram=1
@ITOF 0/54 Ram=2
@DIVFF 0/346 Ram=14
@ITOF 0/54 Ram=2
@DIVFF 0/346 Ram=14
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
@FLT 0/118 Ram=10
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
tono 0/254 Ram=2
*
@PSTRINGC_687 0/32 Ram=2
*
@delay_ms1 0/38 Ram=1
read_tmp 0/288 Ram=3
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
@FLT 0/118 Ram=10
tono 0/254 Ram=2
*
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@ITOF 0/54 Ram=2
@ADDFF 0/618 Ram=16
@ITOF 0/54 Ram=2
@DIVFF 0/346 Ram=14
@ITOF 0/54 Ram=2
@MULFF 0/242 Ram=11
@SFTOI 0/56 Ram=4
PID 0/716 Ram=37
read_tmp 0/288 Ram=3
*
@ITOF 0/54 Ram=2
@ADDFF 0/618 Ram=16
@MULFF 0/242 Ram=11
@ADDFF 0/618 Ram=16
@ADDFF 0/618 Ram=16
@MULFF 0/242 Ram=11
@MULFF 0/242 Ram=11
@ADDFF 0/618 Ram=16
@ADDFF 0/618 Ram=16
@FLT 0/118 Ram=10
@FLT 0/118 Ram=10
@SFTOI 0/56 Ram=4
@delay_ms1 0/38 Ram=1
PID 0/716 Ram=37
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
lcd_gotoxy 0/34 Ram=4
*
@PRINTF_L32D_687FPFPF 0/388 Ram=13
@MULFF 0/242 Ram=11
@FTOSD 0/64 Ram=5
@DIV3232 0/142 Ram=13
lcd_putc 0/80 Ram=1
*
lcd_putc 0/80 Ram=1
*
lcd_putc 0/80 Ram=1
*
lcd_putc 0/80 Ram=1
*
@DIV3232 0/142 Ram=13
lcd_putc 0/80 Ram=1
*
lcd_putc 0/80 Ram=1
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@PRINTF_U_687 0/102 Ram=2
*
@PSTRINGC_687 0/32 Ram=2
*
calentamiento 0/612 Ram=4
read_tmp 0/288 Ram=3
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@ITOF 0/54 Ram=2
@ADDFF 0/618 Ram=16
@ITOF 0/54 Ram=2
@DIVFF 0/346 Ram=14
@ITOF 0/54 Ram=2
@MULFF 0/242 Ram=11
@SFTOI 0/56 Ram=4
PID 0/716 Ram=37
*
PID 0/716 Ram=37
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
lcd_gotoxy 0/34 Ram=4
*
@PRINTF_L32D_687FPFPF 0/388 Ram=13
*
lcd_putc 0/80 Ram=1
*
lcd_putc 0/80 Ram=1
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@PRINTF_U_687 0/102 Ram=2
*
@PSTRINGC_687 0/32 Ram=2
*
refusion 0/614 Ram=4
read_tmp 0/288 Ram=3
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@ITOF 0/54 Ram=2
@ADDFF 0/618 Ram=16
@ITOF 0/54 Ram=2
@DIVFF 0/346 Ram=14
@ITOF 0/54 Ram=2
@MULFF 0/242 Ram=11
@SFTOI 0/56 Ram=4
PID 0/716 Ram=37
*
PID 0/716 Ram=37
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
lcd_gotoxy 0/34 Ram=4
*
@PRINTF_L32D_687FPFPF 0/388 Ram=13
*
lcd_putc 0/80 Ram=1
*
lcd_putc 0/80 Ram=1
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@PRINTF_U_687 0/102 Ram=2
*
@PSTRINGC_687 0/32 Ram=2
*
enfriamiento 0/618 Ram=4
read_tmp 0/288 Ram=3
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@ITOF 0/54 Ram=2
@ADDFF 0/618 Ram=16
@ITOF 0/54 Ram=2
@DIVFF 0/346 Ram=14
@ITOF 0/54 Ram=2
@MULFF 0/242 Ram=11
@SFTOI 0/56 Ram=4
PID 0/716 Ram=37
*
PID 0/716 Ram=37
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
lcd_gotoxy 0/34 Ram=4
*
@PRINTF_L32D_687FPFPF 0/388 Ram=13
*
lcd_putc 0/80 Ram=1
*
lcd_putc 0/80 Ram=1
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
@PRINTF_U_687 0/102 Ram=2
*
@PSTRINGC_687 0/32 Ram=2
*
over 0/404 Ram=4
read_tmp 0/288 Ram=3
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
@PSTRINGC_687 0/32 Ram=2
*
read_tmp 0/288 Ram=3
*
@ADDFF 0/618 Ram=16
@DIVFF 0/346 Ram=14
@FLT 0/118 Ram=10
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PRINTF_L32D_687FPFPF 0/388 Ram=13
*
@PSTRINGC_687 0/32 Ram=2
*
lcd_gotoxy 0/34 Ram=4
*
@PSTRINGC_687 0/32 Ram=2
*
tono 0/254 Ram=2
*
@delay_ms1 0/38 Ram=1
restart 0/76 Ram=0
RTCC_isr 0/18 Ram=0
HORNO_MAX6675_2550_V1.0/code/HORNO_MAX6675_2550_V1.0.xsym
0 → 100644
View file @
26afa814
File added
HORNO_MAX6675_2550_V1.0/code/funciones.h
0 → 100644
View file @
26afa814
/////////////////////////////////////////////////////////////////////////////////////
// serial_connection(void) ==>> toma los valores //
// de subrutinas desde el terminal //
// mode_insert(void) ==>> selecciona el modo //
// y muestra solicitud en lcd //
// read_tmp(void) ==>> lee la temperatura y la almacena en TMP[2] //
// y detecta si el termopar esta abierto //
// subroutine_mode(void) ==>> lee las variables de la eeprom y //
// las pone en la RAM segun el modo //
// tono (int8 who) ==>> genera un tono: //
// 0:tono error //
// 1:tono afirmativo //
// 2:tono inicio de refusion //
// 3:tono fin de refusion //
// 4:tono boton presionado //
// PID (int1 zone) ==>> controla la temperatura por PID //
// zone=0: zona 1 //
// zone=1: zona 2 //
// precalentamiento(void) ==>> controla etapa de precalentamiento //
// //
// calentamiento(void) ==>> controla etapa de calentamiento //
// //
// refusion(void) ==>> controla etapa de refusion //
// //
// enfriamiento(void) ==>> controla etapa de enfriamiento //
// //
// over(void) ==>> espera a que se enfrie el horno a menos de //
// 50 grados celcius //
// restart(void) ==>> resetea todas las variables //
// //
/////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////tonos y sonidos
void
tono
(
int8
who
){
if
(
who
==
0
){
restart_wdt
();
generate_tone
(
500
,
125
);
delay_ms
(
200
);
}
if
(
who
==
1
){
restart_wdt
();
generate_tone
(
E_NOTE
[
0
],
100
);
generate_tone
(
B_NOTE
[
0
],
80
);
}
if
(
who
==
2
){
restart_wdt
();
generate_tone
(
600
,
125
);
delay_ms
(
100
);
generate_tone
(
600
,
125
);
}
if
(
who
==
3
){
restart_wdt
();
generate_tone
(
600
,
225
);
delay_ms
(
400
);
generate_tone
(
600
,
225
);
delay_ms
(
400
);
generate_tone
(
600
,
225
);
delay_ms
(
400
);
generate_tone
(
600
,
225
);
}
if
(
who
==
4
){
restart_wdt
();
generate_tone
(
600
,
125
);
}
restart_wdt
();
}
/////////////////////////tomar valores d subrutinas desde el terminal
/*void serial_connection(void){
restart_wdt();
int8 times=0;
int16 temp=0;
int8 rx[2];
char tt=0;
int8 mode1[12];
int8 mode2[12];
int8 mode3[12];
int8 mode4[12];
int8 mode5[12];
restart_wdt();
gets(rx,SERIAL_DATA);
if( rx[0] == 0x31 && rx[1] == 0x39 ){
for(int i=0;i<5;i++){
restart_wdt();
puts("MODE??\n",SERIAL_DATA);
gets(tt,SERIAL_DATA);
restart_wdt();
if( tt == '1' )gets(mode1,SERIAL_DATA);
if( tt == '2' )gets(mode2,SERIAL_DATA);
if( tt == '3' )gets(mode3,SERIAL_DATA);
if( tt == '4' )gets(mode4,SERIAL_DATA);
if( tt == '5' )gets(mode5,SERIAL_DATA);
restart_wdt();
}
}
restart_wdt();
}*/
////////////////////////////////// SELECION DE MODO
void
mode_insert
(
void
){
restart_wdt
();
signed
int8
i
=
16
;
int8
pos
=
1
;
char
selec
[]
=
"SELECCION=>MODO"
;
char
modo
[]
=
" MODO "
;
int1
flag
=
1
;
lcd_putc
(
"
\f
"
);
while
(
1
){
lcd_gotoxy
(
i
,
1
);
printf
(
lcd_putc
,
"%s"
,
"ELIJA EL MODO DE REFUSION "
);
delay_ms
(
100
);
if
(
i
<-
32
)
i
=
16
;
reading
=
input_b
();
if
(
(
reading
&
0
b00011100
)
!=
0
b00011100
){
tono
(
4
);
lcd_putc
(
"
\f
"
);
break
;}
i
--
;
restart_wdt
();
}
while
(
bit_test
(
reading
,
3
)
){
if
(
reading
==
0
b00001000
)
{
//serial_connection();
printf
(
lcd_putc
,
"%s"
,
" *CONECTADO* "
);
}
if
(
!
bit_test
(
reading
,
2
)
&&
flag
){
tono
(
4
);
pos
+=
1
;
if
(
pos
>
6
)
pos
=
6
;
if
(
pos
<
1
)
pos
=
1
;
flag
=
0
;
}
if
(
!
bit_test
(
reading
,
4
)
&&
flag
)
{
tono
(
4
);
pos
-=
1
;
if
(
pos
>
6
)
pos
=
6
;
if
(
pos
<
1
)
pos
=
1
;
flag
=
0
;
}
lcd_putc
(
"
\a
"
);
lcd_gotoxy
(
1
,
1
);
printf
(
lcd_putc
,
"%s"
,
selec
);
lcd_gotoxy
(
1
,
2
);
printf
(
lcd_putc
,
"%s%u"
,
modo
,
pos
);
reading
=
input_b
();
if
(
bit_test
(
reading
,
2
)
&&
bit_test
(
reading
,
4
)
)
flag
=
1
;
restart_wdt
();
}
mode
=
pos
;
tono
(
1
);
restart_wdt
();
}
//////////////////////////////////LEER TEMPERATURA
void
read_tmp
(
void
){
for
(
int
i
=
0
;
i
<
3
;
i
++
){
LCK
[
0
]
=
spi_xfer
(
TP_1
,
0
);
delay_us
(
1
);
LCK
[
1
]
=
spi_xfer
(
TP_2
,
0
);
delay_us
(
1
);
}
if
(
bit_test
(
LCK
[
0
],
2
)){
printf
(
lcd_putc
,
"%s"
,
"
\n
TCK 1 ABIERTO!!!"
);
while
(
1
){
tono
(
0
);
delay_ms
(
500
);};}
if
(
bit_test
(
LCK
[
1
],
2
)){
printf
(
lcd_putc
,
"%s"
,
"
\n
TCK 2 ABIERTO!!!"
);
while
(
1
){
tono
(
0
);
delay_ms
(
500
);};}
TMP
[
0
]
=
(
LCK
[
0
]
>>
3
)
/
4
.
000
;
TMP
[
1
]
=
(
LCK
[
1
]
>>
3
)
/
4
.
000
;
restart_wdt
();
}
//////////////////////////leer variables de subrutinas en la eeprom
void
subroutine_mode
(){
restart_wdt
();
int8
a
=
0
,
b
=
0
;
if
(
mode
==
1
){
a
=
read_eeprom
(
0x0000
);
b
=
read_eeprom
(
0x0001
);
prec
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0002
);
b
=
read_eeprom
(
0x0003
);
calent
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0004
);
b
=
read_eeprom
(
0x0005
);
refus
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0006
);
b
=
read_eeprom
(
0x0007
);
enf
=
make16
(
a
,
b
);
tprec
=
read_eeprom
(
0x08
);
tcalent
=
read_eeprom
(
0x09
);
trefus
=
read_eeprom
(
0x0A
);
tenf
=
read_eeprom
(
0x0B
);
}
if
(
mode
==
2
){
a
=
read_eeprom
(
0x0010
);
b
=
read_eeprom
(
0x0011
);
prec
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0012
);
b
=
read_eeprom
(
0x0013
);
calent
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0014
);
b
=
read_eeprom
(
0x0015
);
refus
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0016
);
b
=
read_eeprom
(
0x0017
);
enf
=
make16
(
a
,
b
);
tprec
=
read_eeprom
(
0x18
);
tcalent
=
read_eeprom
(
0x19
);
trefus
=
read_eeprom
(
0x1A
);
tenf
=
read_eeprom
(
0x1B
);
}
if
(
mode
==
3
){
a
=
read_eeprom
(
0x0020
);
b
=
read_eeprom
(
0x0021
);
prec
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0022
);
b
=
read_eeprom
(
0x0023
);
calent
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0024
);
b
=
read_eeprom
(
0x0025
);
refus
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0026
);
b
=
read_eeprom
(
0x0027
);
enf
=
make16
(
a
,
b
);
tprec
=
read_eeprom
(
0x28
);
tcalent
=
read_eeprom
(
0x29
);
trefus
=
read_eeprom
(
0x2A
);
tenf
=
read_eeprom
(
0x2B
);
}
if
(
mode
==
4
){
a
=
read_eeprom
(
0x0030
);
b
=
read_eeprom
(
0x0031
);
prec
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0032
);
b
=
read_eeprom
(
0x0033
);
calent
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0034
);
b
=
read_eeprom
(
0x0035
);
refus
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0036
);
b
=
read_eeprom
(
0x0037
);
enf
=
make16
(
a
,
b
);
tprec
=
read_eeprom
(
0x38
);
tcalent
=
read_eeprom
(
0x39
);
trefus
=
read_eeprom
(
0x3A
);
tenf
=
read_eeprom
(
0x3B
);
}
if
(
mode
==
5
){
a
=
read_eeprom
(
0x0040
);
b
=
read_eeprom
(
0x0041
);
prec
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0042
);
b
=
read_eeprom
(
0x0043
);
calent
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0044
);
b
=
read_eeprom
(
0x0045
);
refus
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0046
);
b
=
read_eeprom
(
0x0047
);
enf
=
make16
(
a
,
b
);
tprec
=
read_eeprom
(
0x48
);
tcalent
=
read_eeprom
(
0x49
);
trefus
=
read_eeprom
(
0x4A
);
tenf
=
read_eeprom
(
0x4B
);
}
if
(
mode
==
6
){
a
=
read_eeprom
(
0x0050
);
b
=
read_eeprom
(
0x0051
);
prec
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0052
);
b
=
read_eeprom
(
0x0053
);
calent
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0054
);
b
=
read_eeprom
(
0x0055
);
refus
=
make16
(
a
,
b
);
a
=
read_eeprom
(
0x0056
);
b
=
read_eeprom
(
0x0057
);
enf
=
make16
(
a
,
b
);
tprec
=
read_eeprom
(
0x58
);
tcalent
=
read_eeprom
(
0x59
);
trefus
=
read_eeprom
(
0x5A
);
tenf
=
read_eeprom
(
0x5B
);
}
lcd_putc
(
"
\f
"
);
lcd_gotoxy
(
5
,
1
);
printf
(
lcd_putc
,
"%s%u"
,
"MODO: "
,
mode
);
delay_ms
(
1000
);
restart_wdt
();
}
//////////////////////////////////////control de la temperatura en tiempo real
void
PID
(
int1
zone
){
float
rT
,
eT
,
iT
,
dT
,
yT
,
uT
,
iT0
,
eT0
;
min
=
0
;
max
=
1000
;
read_tmp
();
//leer temperatura
yT
=
TMP
[
zone
];
rT
=
temperature
;
eT
=
rT
-
yT
;
//Cálculo error
iT
=
b
*
eT
+
iT0
;
//Cálculo del término integral
dT
=
c
*
(
eT
-
eT0
);
//Cálculo del término derivativo
uT
=
iT
+
a
*
eT
+
dT
;
//Cálculo de la salida PID
if
(
uT
>
max
)
uT
=
max
;
//Salida PID si es mayor que el MAX
if
(
uT
<
min
)
uT
=
min
;
//Salida PID si es menor que el MIN
control
=
uT
;
//Transferencia de salida PID a señal PWM
if
(
!
zone
)
set_pwm1_duty
(
control
);
if
(
zone
)
set_pwm2_duty
(
control
);
iT0
=
iT
;
//Guardar variables
eT0
=
eT
;
restart_wdt
();
delay_ms
(
100
);
}
///////////////////////////////////generar la curva de temperatura
//////////////////precalentamiento
void
precalentamiento
(
void
){
restart_wdt
();
float
temp_actual
=
0
;
int16
temp_max
=
prec
;
float
temp_0
=
0
;
signed
int8
i
=
16
;
time
=
0
;
counter
=
tprec
;
delay_ms
(
100
);
read_tmp
();
temp_0
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
if
(
temp_0
>=
50
){
lcd_putc
(
"
\f
"
);
while
(
1
){
lcd_gotoxy
(
i
,
1
);
tono
(
0
);
printf
(
lcd_putc
,
"%s"
,
"LA TEMPERATURA ES DEMASIADO ALTA PARA INICIAR "
);
delay_ms
(
100
);
if
(
i
<-
44
)
i
=
16
;
restart_wdt
();
read_tmp
();
temp_0
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
if
(
temp_0
<=
50
)
break
;
i
--
;
restart_wdt
();
}
}
pwm_on
(
pwm1
);
pwm_on
(
pwm2
);
tono
(
2
);
lcd_putc
(
"
\f
"
);
lcd_gotoxy
(
1
,
1
);
printf
(
lcd_putc
,
"%s"
,
"PRECALENTAMIENTO"
);
enable_interrupts
(
INT_RTCC
);
enable_interrupts
(
GLOBAL
);
while
(
!
flag
){
temperature
=
((
temp_max
-
temp_0
)
/
tprec
)
*
time
;
PID
(
0
);
PID
(
1
);
temp_actual
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
lcd_gotoxy
(
1
,
2
);
printf
(
lcd_putc
,
"%f%c%c"
,
temp_actual
,
2
,
'C'
);
lcd_gotoxy
(
11
,
2
);
printf
(
lcd_putc
,
"%s%u%s"
,
"T:"
,
counter
,
"s"
);
restart_wdt
();
}
disable_interrupts
(
INT_RTCC
);
disable_interrupts
(
GLOBAL
);
flag
=
0
;
restart_wdt
();
}
///////calentamiento
void
calentamiento
(
void
){
restart_wdt
();
float
temp_actual
=
0
;
int16
temp_max
=
calent
;
counter
=
tcalent
;
time
=
0
;
read_tmp
();
float
temp_0
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
lcd_putc
(
"
\f
"
);
lcd_gotoxy
(
1
,
1
);
printf
(
lcd_putc
,
"%s"
,
" CALENTAMIENTO"
);
enable_interrupts
(
INT_RTCC
);
enable_interrupts
(
GLOBAL
);
while
(
!
flag
){
temperature
=
((
temp_max
-
temp_0
)
/
tcalent
)
*
time
;
PID
(
0
);
PID
(
1
);
temp_actual
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
lcd_gotoxy
(
1
,
2
);
printf
(
lcd_putc
,
"%f%c%c"
,
temp_actual
,
2
,
'C'
);
lcd_gotoxy
(
11
,
2
);
printf
(
lcd_putc
,
"%s%u%s"
,
"T:"
,
counter
,
"s"
);
restart_wdt
();
}
disable_interrupts
(
INT_RTCC
);
disable_interrupts
(
GLOBAL
);
flag
=
0
;
restart_wdt
();
}
///////////////////////////refusion
void
refusion
(
void
){
restart_wdt
();
float
temp_actual
=
0
;
int16
temp_max
=
refus
;
counter
=
trefus
;
time
=
0
;
read_tmp
();
float
temp_0
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
lcd_putc
(
"
\f
"
);
lcd_gotoxy
(
1
,
1
);
printf
(
lcd_putc
,
"%s"
,
" REFUSION"
);
enable_interrupts
(
INT_RTCC
);
enable_interrupts
(
GLOBAL
);
while
(
!
flag
){
temperature
=
((
temp_max
-
temp_0
)
/
trefus
)
*
time
;
PID
(
0
);
PID
(
1
);
temp_actual
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
lcd_gotoxy
(
1
,
2
);
printf
(
lcd_putc
,
"%f%c%c"
,
temp_actual
,
2
,
'C'
);
lcd_gotoxy
(
11
,
2
);
printf
(
lcd_putc
,
"%s%u%s"
,
"T:"
,
counter
,
"s"
);
restart_wdt
();
}
disable_interrupts
(
INT_RTCC
);
disable_interrupts
(
GLOBAL
);
flag
=
0
;
restart_wdt
();
}
///////////////////////////enfriamiento
void
enfriamiento
(
void
){
restart_wdt
();
float
temp_actual
=
0
;
int16
temp_min
=
enf
;
counter
=
tenf
;
time
=
0
;
output_high
(
PIN_B5
);
read_tmp
();
float
temp_0
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
lcd_putc
(
"
\f
"
);
lcd_gotoxy
(
1
,
1
);
printf
(
lcd_putc
,
"%s"
,
" ENFRIAMIENTO"
);
enable_interrupts
(
INT_RTCC
);
enable_interrupts
(
GLOBAL
);
while
(
!
flag
){
temperature
=
((
temp_0
-
temp_min
)
/
tenf
)
*
time
;
PID
(
0
);
PID
(
1
);
temp_actual
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
lcd_gotoxy
(
1
,
2
);
printf
(
lcd_putc
,
"%f%c%c"
,
temp_actual
,
2
,
'C'
);
lcd_gotoxy
(
11
,
2
);
printf
(
lcd_putc
,
"%s%u%s"
,
"T:"
,
counter
,
"s"
);
restart_wdt
();
}
disable_interrupts
(
INT_RTCC
);
disable_interrupts
(
GLOBAL
);
flag
=
0
;
restart_wdt
();
}
///////////////////////////resetear todas las variables
void
restart
(
void
){
counter
=
0
;
time
=
0
;
reading
=
0
;
mode
=
0
;
prec
=
0
;
calent
=
0
;
refus
=
0
;
enf
=
0
;
tprec
=
0
;
tcalent
=
0
;
trefus
=
0
;
tenf
=
0
;
flag
=
0
;
LCK
[
2
]
=
(
0
,
0
);
TMP
[
2
]
=
(
0
,
0
);
temperature
=
0
;
//variables del PID
min
=
0
;
max
=
0
;
control
=
0
;
restart_wdt
();
}
////////////////////////normaliza a temperatura ambiente y termina el proceso
void
over
(
void
){
restart_wdt
();
pwm_off
(
pwm1
);
pwm_off
(
pwm2
);
float
temp_0
=
0
;
read_tmp
();
temp_0
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
lcd_putc
(
"
\f
"
);
while
(
1
){
read_tmp
();
temp_0
=
(
TMP
[
0
]
+
TMP
[
1
])
/
2
;
if
(
temp_0
<=
50
)
break
;
lcd_gotoxy
(
1
,
1
);
printf
(
lcd_putc
,
"%s"
,
"NORMALIZANDO... "
);
lcd_gotoxy
(
1
,
2
);
printf
(
lcd_putc
,
"%f"
,
temp_0
);
}
output_low
(
PIN_B5
);
lcd_putc
(
"
\f
"
);
lcd_gotoxy
(
1
,
1
);
printf
(
lcd_putc
,
"%s"
,
"FIN DE REFUSION "
);
tono
(
3
);
delay_ms
(
2000
);
restart_wdt
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment