Problem with comparison.
/Designs/Tools/reflow2/DOC/test/reflow.txt
0,0 → 1,161
#PREHEAT
00 01 23.198
00 02 23.198
00 04 22.524
00 06 23.198
00 07 23.198
00 09 23.198
00 11 23.872
00 12 23.872
00 14 24.547
00 16 24.547
00 17 25.221
00 19 26.569
00 21 26.569
00 22 27.243
00 24 27.918
00 26 29.266
00 27 29.940
00 29 30.614
00 31 31.289
00 32 31.963
00 34 32.637
00 36 32.637
00 38 33.311
00 39 33.985
00 41 33.985
00 43 34.660
00 44 35.334
00 46 35.334
00 48 36.008
00 49 36.682
00 51 37.356
00 53 38.031
00 54 38.705
00 56 38.705
00 58 39.379
00 59 40.053
01 01 40.727
01 03 41.402
01 04 42.076
01 06 42.750
01 08 43.424
01 09 43.424
01 11 43.424
01 13 44.098
01 14 44.773
01 16 45.447
01 18 46.121
01 19 46.121
01 21 47.469
01 23 48.144
01 24 48.818
01 26 49.492
01 28 50.166
01 29 50.166
01 31 51.515
01 33 51.515
01 34 52.189
01 36 53.537
01 38 54.211
01 39 55.560
01 41 56.234
01 43 56.908
01 44 57.582
01 46 58.257
01 48 58.257
01 49 58.931
01 51 59.605
01 53 59.605
01 54 59.605
01 56 60.279
01 58 60.953
01 59 62.302
02 01 62.302
02 03 62.976
02 05 63.650
02 06 64.999
02 08 65.673
02 10 66.347
02 11 67.021
02 13 67.695
02 15 67.695
02 16 67.695
02 18 68.370
02 20 69.718
02 21 69.718
02 23 70.392
02 25 71.066
02 26 71.741
02 28 72.415
02 30 73.089
02 31 73.089
02 33 73.763
02 35 75.112
02 36 75.112
02 38 75.786
02 40 76.460
02 41 77.134
02 43 77.134
02 45 77.808
02 47 77.808
02 48 78.483
02 50 79.831
02 52 80.505
02 53 81.179
02 55 81.854
02 57 83.202
02 58 83.202
03 00 83.876
03 02 83.876
03 03 84.550
03 05 85.225
03 07 86.573
03 08 86.573
03 10 86.573
03 12 87.921
03 13 88.596
03 15 89.270
03 17 89.944
03 18 90.618
03 20 91.292
03 22 91.292
03 23 91.967
03 25 92.641
03 27 92.641
03 28 93.989
03 30 93.989
03 32 94.663
03 33 96.012
03 35 96.686
03 37 97.360
03 38 98.034
03 40 98.034
03 42 98.709
03 43 99.383
03 45 100.057
03 47 100.731
03 48 101.405
03 50 102.080
03 52 102.754
03 53 102.080
03 55 102.754
03 57 102.754
03 58 103.428
04 00 103.428
04 02 104.777
04 03 105.451
04 05 105.451
04 07 106.125
04 08 106.799
04 10 106.125
04 12 106.799
04 13 106.125
04 15 106.799
04 17 106.799
04 18 106.799
04 20 106.125
04 22 106.125
04 23 106.125
04 25 106.125
04 27 105.451
/Designs/Tools/reflow2/DOC/test/reflow2.txt
0,0 → 1,645
#PREHEAT
00 01 103.428
00 02 103.428
00 04 103.428
00 06 103.428
00 07 103.428
00 09 104.777
00 11 105.451
00 12 106.125
00 14 106.799
00 16 107.473
00 17 108.148
00 19 108.148
00 21 108.822
00 22 109.496
00 24 110.170
00 26 110.170
00 27 110.170
00 29 110.844
00 31 112.193
00 32 112.867
00 34 112.867
00 36 113.541
00 37 114.215
00 39 114.890
00 41 114.890
00 42 115.564
00 44 115.564
00 46 116.238
00 47 116.238
00 49 116.238
00 51 116.912
00 52 118.261
00 54 118.935
00 56 120.283
00 57 120.957
00 59 121.632
01 01 122.306
01 03 122.306
01 04 122.980
01 06 122.980
01 08 123.654
01 09 124.328
01 11 126.351
01 13 126.351
01 14 126.351
01 16 127.025
01 18 127.699
01 19 127.699
01 21 129.048
01 23 129.722
01 24 130.396
01 26 130.396
01 28 131.070
01 29 131.745
01 31 132.419
01 33 133.767
01 34 133.767
01 36 133.767
01 38 134.441
01 39 135.116
01 41 135.116
01 43 135.790
01 44 136.464
01 46 136.464
01 48 137.812
01 49 138.487
01 51 139.161
01 53 139.835
01 54 140.509
01 56 140.509
01 58 141.183
01 59 141.183
02 01 142.532
02 03 143.206
02 05 143.880
02 06 144.554
02 08 145.229
02 10 145.229
02 11 145.903
02 13 145.903
02 15 146.577
02 16 146.577
02 18 147.925
02 20 148.600
02 21 149.948
02 23 149.948
00 02 151.296
00 03 151.971
00 05 151.971
00 07 152.645
00 08 153.319
00 10 152.645
00 12 153.319
00 13 152.645
00 15 152.645
00 17 152.645
00 18 152.645
00 20 151.971
00 22 151.971
00 23 151.296
00 25 151.296
00 27 150.622
00 28 149.948
00 30 149.948
00 32 149.948
00 33 149.948
00 35 150.622
00 37 151.296
00 38 152.645
00 40 152.645
00 42 153.319
00 43 153.319
00 45 153.319
00 47 153.319
00 48 153.319
00 50 153.319
00 52 153.319
00 53 153.319
00 55 152.645
00 57 152.645
00 58 151.971
01 00 151.971
01 02 151.296
01 03 150.622
01 05 150.622
01 07 149.948
01 09 149.948
01 10 149.948
01 12 149.948
01 14 150.622
01 15 151.296
01 17 151.971
01 19 151.971
01 20 152.645
01 22 152.645
01 24 152.645
01 25 152.645
01 27 152.645
01 29 152.645
01 30 152.645
01 32 151.971
01 34 151.971
01 35 151.296
01 37 151.296
01 39 150.622
#SOLDER
00 00 150.622
00 02 149.948
00 04 149.948
00 05 149.948
00 07 151.296
00 09 151.971
00 10 152.645
00 12 153.319
00 14 153.993
00 15 156.016
00 17 157.364
00 19 158.713
00 20 160.061
00 22 160.735
00 24 161.409
00 25 162.758
00 27 163.432
00 29 164.780
00 30 166.129
00 32 167.477
00 34 168.151
00 35 169.500
00 37 170.174
00 39 170.848
00 40 172.197
00 42 172.871
00 44 174.219
00 45 174.893
00 47 176.242
00 49 177.590
00 50 178.264
00 52 178.939
00 54 179.613
00 55 180.287
00 57 181.635
00 59 182.984
01 00 184.332
01 02 185.681
01 04 186.355
01 06 187.029
01 07 187.703
01 09 188.377
01 11 189.726
01 12 191.074
01 14 192.423
01 16 193.097
01 17 194.445
01 19 195.119
01 21 195.119
01 22 196.468
01 24 197.142
01 26 197.142
01 27 198.490
01 29 199.165
01 31 200.513
01 32 201.187
01 34 201.861
01 36 202.536
01 37 203.884
01 39 205.232
01 41 205.907
01 42 206.581
01 44 207.929
01 46 209.278
COOLING
01 47 209.952
01 49 211.300
01 51 211.300
01 52 211.974
01 54 211.300
01 56 211.974
01 57 211.300
01 59 211.300
02 01 211.300
02 02 210.626
02 04 209.952
02 06 209.278
02 07 208.603
02 09 207.255
02 11 206.581
02 12 205.907
02 14 205.232
02 16 203.884
02 17 203.210
02 19 202.536
02 21 201.861
02 22 200.513
02 24 199.839
02 26 199.165
02 27 198.490
02 29 197.142
02 31 196.468
02 32 195.119
02 34 195.119
02 36 193.771
02 38 193.097
02 39 192.423
02 41 191.748
02 43 191.074
02 44 190.400
02 46 189.052
02 48 189.052
02 49 187.703
02 51 184.332
02 53 180.287
02 54 177.590
02 56 174.219
02 58 171.522
02 59 168.151
03 01 166.129
03 03 164.106
03 04 162.084
03 06 160.735
03 08 158.713
03 09 157.364
03 11 156.016
03 13 154.667
03 14 153.319
03 16 151.971
03 18 150.622
03 19 149.948
03 21 148.600
03 23 147.251
03 24 146.577
03 26 145.229
03 28 144.554
03 29 143.206
03 31 142.532
03 33 141.183
03 34 140.509
03 36 139.835
03 38 139.161
03 39 137.812
03 41 137.138
03 43 135.790
03 44 135.116
03 46 133.767
03 48 133.767
03 49 132.419
03 51 131.745
03 53 131.070
03 54 130.396
03 56 129.722
03 58 129.048
03 59 127.699
04 01 127.025
04 03 126.351
04 04 126.351
04 06 125.003
04 08 124.328
04 09 123.654
04 11 122.980
04 13 122.306
04 14 121.632
04 16 120.957
04 18 120.283
04 19 119.609
04 21 119.609
04 23 118.935
04 24 118.261
04 26 117.586
04 28 116.912
04 30 116.238
04 31 115.564
04 33 115.564
04 35 114.215
04 36 113.541
04 38 112.867
04 40 112.193
04 41 112.193
04 43 111.519
04 45 110.844
04 46 110.170
04 48 110.170
04 50 109.496
04 51 108.822
04 53 108.148
04 55 107.473
04 56 107.473
04 58 106.799
05 00 106.125
05 01 105.451
05 03 103.428
05 05 100.057
05 06 98.709
05 08 97.360
05 10 96.012
05 11 94.663
05 13 93.315
05 15 92.641
05 16 91.292
05 18 89.944
05 20 89.270
05 21 88.596
05 23 87.247
05 25 86.573
05 26 86.573
05 28 85.225
05 30 84.550
05 31 83.876
05 33 83.202
05 35 83.202
05 36 81.854
05 38 81.854
05 40 81.179
05 41 80.505
05 43 79.831
05 45 79.157
05 46 79.157
05 48 79.157
05 50 78.483
05 51 78.483
05 53 77.808
05 55 77.134
05 56 76.460
05 58 76.460
06 00 76.460
06 02 76.460
06 03 75.786
06 05 75.112
06 07 74.437
06 08 74.437
06 10 73.763
06 12 73.089
06 13 72.415
06 15 72.415
06 17 72.415
06 18 71.741
06 20 71.066
06 22 71.066
06 23 71.066
06 25 70.392
06 27 69.718
06 28 69.718
06 30 69.718
06 32 69.044
06 33 69.044
06 35 69.044
06 37 69.044
06 38 68.370
06 40 68.370
06 42 67.695
06 43 67.695
06 45 67.695
06 47 67.021
06 48 67.021
06 50 66.347
06 52 66.347
06 53 65.673
06 55 65.673
06 57 64.999
06 58 64.999
07 00 64.999
07 02 64.324
07 03 64.324
07 05 63.650
07 07 63.650
07 08 62.976
07 10 62.976
07 12 62.302
07 13 62.302
07 15 61.628
07 17 62.302
07 18 61.628
07 20 61.628
07 22 60.279
07 23 60.279
07 25 60.279
07 27 59.605
07 29 59.605
07 30 59.605
07 32 58.931
07 34 58.931
07 35 58.257
07 37 58.257
07 39 57.582
07 40 57.582
07 42 57.582
07 44 56.908
07 45 56.908
07 47 56.908
07 49 56.908
07 50 56.908
07 52 56.908
07 54 56.234
07 55 56.234
07 57 56.234
07 59 55.560
08 00 56.234
08 02 55.560
08 04 55.560
08 05 54.886
08 07 54.886
08 09 54.211
08 11 54.211
08 12 53.537
08 14 52.863
08 16 52.863
08 17 52.863
08 19 52.863
08 21 52.863
08 22 52.863
08 24 52.189
08 26 52.863
08 27 52.863
08 29 52.189
08 31 52.189
08 32 52.189
08 34 51.515
08 36 51.515
08 37 51.515
08 39 50.840
08 41 50.840
08 42 50.840
08 44 50.166
08 46 50.166
08 47 50.166
08 49 50.166
08 51 50.166
08 52 50.166
08 54 50.166
08 56 50.166
08 57 50.166
08 59 49.492
09 01 49.492
09 02 48.818
09 04 48.818
09 06 48.818
09 07 48.144
09 09 48.144
09 11 47.469
09 12 47.469
09 14 47.469
09 16 47.469
09 17 46.795
09 19 46.795
09 21 46.121
09 22 46.795
09 24 46.121
09 26 46.121
09 27 46.121
09 29 46.121
09 31 46.121
09 32 46.121
09 34 45.447
09 36 45.447
09 37 45.447
09 39 45.447
09 41 45.447
09 43 45.447
09 44 45.447
09 46 45.447
09 48 44.773
09 49 44.773
09 51 44.773
09 53 44.773
09 54 44.773
09 56 44.773
09 58 44.773
09 59 44.773
10 01 44.773
10 03 44.098
10 04 44.098
10 06 44.098
10 08 44.098
10 09 43.424
10 11 43.424
10 13 43.424
10 14 43.424
10 16 42.750
10 18 42.750
10 19 42.076
10 21 42.750
10 23 42.076
10 24 42.076
10 26 42.076
10 28 42.076
10 29 42.076
10 31 42.750
10 33 42.076
10 34 42.750
10 36 42.076
10 38 42.076
10 39 42.076
10 41 42.076
10 43 42.076
10 44 42.076
10 46 42.076
10 48 42.076
10 49 42.076
10 51 42.076
10 53 42.076
10 54 41.402
10 56 41.402
10 58 41.402
10 59 41.402
11 01 41.402
11 03 41.402
11 05 40.727
11 06 41.402
11 08 41.402
11 10 40.727
11 11 40.727
11 13 40.727
11 15 40.727
11 16 40.053
11 18 40.053
11 20 40.053
11 21 40.053
11 23 40.053
11 25 39.379
11 26 38.705
11 28 38.705
11 30 38.705
11 31 38.705
11 33 38.705
11 35 38.705
11 36 38.705
11 38 38.705
11 40 38.705
11 41 39.379
11 43 38.705
11 45 38.705
11 47 38.705
11 48 38.705
11 50 38.705
11 52 38.705
11 53 38.705
11 55 38.031
11 57 38.031
11 58 38.031
12 00 38.031
12 02 38.031
12 03 38.031
12 05 37.356
12 07 38.031
12 08 37.356
12 10 37.356
12 12 37.356
12 13 37.356
12 15 37.356
12 17 37.356
12 18 37.356
12 20 37.356
12 22 37.356
12 23 37.356
12 25 37.356
12 27 37.356
12 28 36.682
12 30 37.356
12 32 36.682
12 33 37.356
12 35 36.682
12 37 36.682
12 38 36.682
12 40 36.682
12 42 36.682
12 43 36.682
12 45 36.008
12 47 35.334
12 48 35.334
12 50 35.334
12 52 35.334
12 53 35.334
12 55 35.334
12 57 35.334
12 58 35.334
13 00 34.660
13 02 34.660
13 03 34.660
13 05 34.660
13 07 34.660
13 09 35.334
13 10 35.334
13 12 35.334
13 14 34.660
13 15 34.660
13 17 34.660
13 19 34.660
13 20 35.334
13 22 34.660
13 24 34.660
13 25 34.660
13 27 34.660
13 29 34.660
13 30 34.660
13 32 34.660
13 34 34.660
13 35 34.660
13 37 34.660
13 39 33.985
13 40 33.985
13 42 33.985
13 44 34.660
13 45 33.985
13 47 33.985
13 49 33.985
13 50 33.985
/Designs/Tools/reflow2/DOC/calibration/fit.log
0,0 → 1,474
 
 
*******************************************************************************
Mon Apr 18 10:07:44 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
*******************************************************************************
Mon Apr 18 10:07:56 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:11:53 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:15:14 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:16:19 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:16:42 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:22:51 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:23:12 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:24:14 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:24:37 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
 
 
*******************************************************************************
Mon Apr 18 10:25:11 2011
 
 
FIT: data read from "calibration_data.txt" using 2:1
format = x:z
#datapoints = 21
residuals are weighted equally (unit weight)
 
function used for fitting: f(x)
fitted parameters initialized with current variable values
 
 
 
Iteration 0
WSSR : 5.09698e+06 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-05
lambda : 431.263
 
initial set of free parameter values
 
k = 1
q = 1
 
After 7 iterations the fit converged.
final sum of squares of residuals : 121.522
rel. change during last iteration : -5.14772e-13
 
degrees of freedom (FIT_NDF) : 19
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 2.52901
variance of residuals (reduced chisquare) = WSSR/ndf : 6.3959
 
Final set of parameters Asymptotic Standard Error
======================= ==========================
 
k = 0.674201 +/- 0.005913 (0.877%)
q = -294.35 +/- 3.606 (1.225%)
 
 
correlation matrix of the fit parameters:
 
k q
k 1.000
q -0.988 1.000
/Designs/Tools/reflow2/DOC/calibration/plot.gp
0,0 → 1,17
set terminal png
set output "temperature.png"
 
set key under
set xlabel "ADC value [-]"
set ylabel "Temperature [°C]"
 
f(x)= k*x + q
fit f(x) "calibration_data.txt" using 2:1 via k,q
 
 
# from http://hw.cz/docs/mereni_teploty/mereni_teploty_1.html/
A=3.90802e-3
B=-5.802e-7
g(x)=(-A + sqrt(A*A - 4*B*(1.0 - 1.0*x*2350.0/1024.0/1000.0)))/2.0/B;
 
plot "calibration_data.txt" using 2:1 with points title "measured points", f(x) title "0.674201 * x - 294.35", g(x) title "original hw.cz"
/Designs/Tools/reflow2/DOC/calibration/temperature.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Designs/Tools/reflow2/DOC/calibration/calibration_data.txt
0,0 → 1,22
temperature ADCvalue
12 459
57 518
76 547
89 567
110 601
152 661
179 703
197 730
220 774
210 748
180 701
160 670
150 655
130 625
120 611
100 583
55 518
50 512
40 499
35 491
30 484
/Designs/Tools/reflow2/SW/reflow.c
0,0 → 1,356
#include "reflow.h"
#include "process.h"
#include <math.h>
 
// nastaveni teplot a casu
#define TEPLOTA_PREDEHREVU 120
#define DOBA_PREDEHREVU 60
 
#define TEPLOTA_VRCHOLU 210
#define DOBA_VRCHOLU 5
 
// CPU IO rozhrani
#define LCD_RS PIN_C1 // rizeni registru LCD displeje
#define LCD_E PIN_C2 // enable LCD displeje
#define LCD_DATA_LSB PIN_D0 // data LCD
#include "lcd.c"
 
#define TL1 PIN_B3 // tlacitko S1
#define TL2 PIN_B2 // tlacitko S2
#define TL3 PIN_B1 // tlacitko S3
#define TL4 PIN_B0 // tlacitko S4
 
#define POWER_T3 PIN_C4 // ovladani optotriaku T3
#define POWER_T4 PIN_C5 // ovladani optotriaku T4
#define POWER_T5 PIN_C6 // ovladani optotriaku T5
 
#define ADC_PIN PIN_A0 //info, nelze menit - pin pouzit jako input analog
#define ADC_PIN_NC PIN_A1 //info, nelze menit - pin pouzit jako input analog
#define REF_PIN PIN_A3 //info, nelze menit - pin pouzit jako input reference 2.5V
 
// interni
#define PowerOn() output_low(POWER_T4);output_low(POWER_T5)
#define PowerOff() output_high(POWER_T4);output_high(POWER_T5)
 
// globalni promenne
struct time
{
volatile signed int8 hod;
volatile signed int8 min;
volatile signed int8 sec;
}cas;
 
unsigned int top_heat_power=0; // range 0-200% nad 100% je ale teleso jiz pretizene
unsigned int bottom_heat_power=0; // contains heating power range 0-100%
unsigned int period;
 
float temp_last=0;
float temp_slope=0;
 
 
void GeneralCpuInit() // inicializace
{
output_high(POWER_T4);
output_high(POWER_T5);
port_b_pullups(true);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_64); //nepouzit
setup_timer_1(T1_INTERNAL|T1_DIV_BY_1); // rizeni
setup_timer_2(T2_DIV_BY_16,249,10); //rtc 40ms
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
enable_interrupts(GLOBAL);
enable_interrupts(INT_TIMER2);
enable_interrupts(INT_TIMER0);
setup_adc_ports(AN0_AN1_VSS_VREF); //A0 vstup cidla, A1 nepozit, A3 - ref. 2.5V
setup_adc(ADC_CLOCK_DIV_8);
SET_ADC_CHANNEL(0); //AN0, PIN_A0
}
 
void heat_failure() // exception in case of heating fail
{
top_heat_power=0;
bottom_heat_power=0;
 
lcd_gotoxy(1,2);
printf(lcd_putc,"HEATING FAILURE!");
while(true);
 
}
 
unsigned int16 adc(void) // adc read and filtering
{
unsigned int16 analog;
unsigned int8 a;
 
analog = 0;
for (a=0;a<32;a++)
{
analog += read_adc();
delay_us(50);
}
return (analog >> 5 ); // prumer = analog/32
}
 
float teplota(void) // temperature measuring
{
return (0.674201*adc() - 294.35); // temperature calculaton (linear aproximation)
}
 
void top_heating()
{
if (period < top_heat_power){
output_low(POWER_T4);
output_low(POWER_T5);
}
else{
output_high(POWER_T4);
output_high(POWER_T5);
}
}
 
void bottom_heating()
{
 
if (period < 2*bottom_heat_power){
output_low(POWER_T3);
}
else{
output_high(POWER_T3);
}
}
 
#int_TIMER0
void heating_control() //rizeni topnych teles pri preteceni casovace
{
float temp;
 
top_heating();
bottom_heating();
if ((period == 100) || (period == 0))
{
temp=teplota();
temp_slope=(temp - temp_last) /(100.0*256.0/62500.0); // vypocet strmosti narustu teploty ve stupnich/s
temp_last = temp;
printf("%02u %02u %3.3f \r\n",cas.min,cas.sec,temp); //vypis pro zaznam profilu
}
if (period < 200) period++;
else period=0;
}
 
#int_TIMER2
void Rtc(void) //40ms
{
static unsigned int8 ms40=0;
struct time* time;
time=&cas;
if ( ++ms40 < 25) return;
ms40=0;
if (++(time->sec) >= 60)
{
time->sec=0; //1min
if (++(time->min) >= 60)
{
time->min = 0; //1hod
(time->hod)++;
}
}
}
 
void slope_control(float ramp, unsigned int balance) // P proporcionalni rizeni narustu teploty predpoklada periodicke volani 1x/s
{
float slope_deviation;
 
slope_deviation = temp_slope - ramp; // vypocet strmosti a odchylky od pozadovane strmosti
 
if(slope_deviation < 0)
{
top_heat_power= 67 + balance;
bottom_heat_power= 100;
}
else{
top_heat_power=0;
bottom_heat_power=0;
}
}
 
void level_control(float level) // P proporcionalni rizeni teploty
{
if (teplota() > level)
{
top_heat_power=0;
bottom_heat_power=0;
}
else
{
top_heat_power=70;
bottom_heat_power=80;
}
}
 
 
void nullcas(struct time* time)
{
disable_interrupts(INT_TIMER2);
time->sec=0;
time->hod=0;
time->min=0;
enable_interrupts(INT_TIMER2);
}
 
void reflow_solder()
{
 
struct time process_time;
 
// ------------------- PREHEAT ---------------------
 
nullcas(&cas);
lcd_gotoxy(1,2);
printf(lcd_putc,"PREHEAT");
printf("#PREHEAT\r\n");
 
do {
slope_control(PREHEAT_SLOPE, 0); // hlida strmost predehrevu
 
lcd_gotoxy(1,1);
printf(lcd_putc,"%3.1f\21C ",teplota());
 
lcd_gotoxy(12,1);
printf(lcd_putc,"%02u:%02u",cas.min,cas.sec);
 
lcd_gotoxy(10,2);
printf(lcd_putc,"%1.1f\21C/s ",temp_slope);
 
delay_ms(200);
if (cas.min>3) heat_failure();
}
while (teplota() < SOAK_TEMP);
 
// ----------- SOAK ---------------
nullcas(&cas);
process_time.min = SOAK_TIME/60;
process_time.sec = SOAK_TIME - process_time.min*60;
 
lcd_clr();
lcd_gotoxy(1,2);
printf(lcd_putc,"SOAK ");
printf(lcd_putc,"#SOAK\r\n");
 
while (process_time.sec!=0 || process_time.min!=0)
{
level_control(SOAK_TEMP);
 
lcd_gotoxy(1,1);
printf(lcd_putc,"%3.1f\21C ",teplota());
 
if ((process_time.sec = process_time.sec - cas.sec)<0) process_time.sec=59;
 
process_time.min = (SOAK_TIME - cas.min*60 - cas.sec)/60;
process_time.sec = (SOAK_TIME - cas.min*60 - cas.sec) - process_time.min*60;
 
lcd_gotoxy(9,1);
printf(lcd_putc,"%02u:%02u", process_time.min, process_time.sec);
delay_ms(200);
}
//----------------- solder ----------------------------
 
nullcas(&cas);
lcd_clr();
lcd_gotoxy(1,2);
printf(lcd_putc,"SOLDER");
printf("#SOLDER\r\n");
 
do {
slope_control(SOLDER_SLOPE, 10); // hlida strmost predehrevu
 
lcd_gotoxy(1,1);
printf(lcd_putc,"%3.1f\21C ",teplota());
 
lcd_gotoxy(12,1);
printf(lcd_putc,"%02u:%02u",cas.min,cas.sec);
 
lcd_gotoxy(10,2);
printf(lcd_putc,"%1.1f\21C/s ",temp_slope);
 
delay_ms(200);
if (cas.min>2) heat_failure();
}
while (teplota() < SOLDER_TEMP);
 
// ---------------- TAO ------------------------
 
 
while (process_time.sec!=0 || process_time.min!=0)
{
level_control(SOLDER_TEMP);
 
lcd_gotoxy(1,1);
printf(lcd_putc,"%3.1f\21C ",teplota());
 
if ((process_time.sec = process_time.sec - cas.sec)<0) process_time.sec=59;
 
process_time.min = (SOLDER_TIME - cas.min*60 - cas.sec)/60;
process_time.sec = (SOLDER_TIME - cas.min*60 - cas.sec) - process_time.min*60;
 
lcd_gotoxy(9,1);
printf(lcd_putc,"%02u:%02u", process_time.min, process_time.sec);
delay_ms(200);
}
 
// ---------------- COOLING ------------------------
 
top_heat_power=0;
bottom_heat_power=0;
 
lcd_clr();
 
lcd_gotoxy(1,2);
printf(lcd_putc,"REFLOW COMPLETE");
printf("COOLING \r\n");
 
 
while(true)
{
lcd_gotoxy(1,1);
printf(lcd_putc,"%3.1f\21C ",teplota());
 
lcd_gotoxy(10,1);
printf(lcd_putc,"%1.1f\21C/s ",temp_slope);
}
}
 
void main() // main loop
{
GeneralCpuInit();
PowerOff();
lcd_init();
lcd_define_char(1,LCD_CHAR_STUPEN);
nullcas(&cas);
while(true)
{
delay_ms(300);
reflow_solder();
}
}
/Designs/Tools/reflow2/SW/reflow.hex
0,0 → 1,461
:100000000A308A00B02A0000FF00030E8301A1001D
:100010000A08A0008A010408A2007708A300780853
:10002000A4007908A5007A08A600831383128C30F7
:100030008400801C1D288C1832288B1E21280B1947
:100040003528220884002308F7002408F800250832
:10005000F9002608FA0020088A00210E8300FF0E0E
:100060007F0E09008A110A12932D8A110A12202C80
:100070000A108A100A11820728340C34013406341D
:10008000C822412A49274710C62049265529C510AC
:100090000000DE01DD01DF015F081F3C031C622858
:1000A0001F151F19512883161E088312DD071E080D
:1000B00003181E0FDE071030F700F70B5D28000055
:1000C000DF0A4C285E0CFA005D0CF900FA0CF90C02
:1000D000FA0CF90CFA0CF90CFA0CF90C0730FA05C9
:1000E0007908F8007A08F90008008E30F7005E08F9
:1000F000F8005D08F900FA01F808031D892879085D
:10010000F800F9010830F702F808031D8928F70103
:1001100091280310F81B9028F90DF80DF703892892
:10012000F81308006A0803190229F2006E0803197F
:100130000229F2070318A3287F30F202031C0229C8
:1001400003190229A7288130F2070318022972082F
:10015000F700F801F901FA016B08F600F6176C08D0
:10016000F5006D08F4001830F200F301741CD0287B
:100170007108FA07031CC228F90A031DC228F80AED
:100180000319F3177008F907031CC928F80A0319A3
:10019000F3176F08EC00EC176C08F8070318F31757
:1001A000F30DF80CF90CFA0CF60CF50CF40C03102A
:1001B000F20BB5280130F70703180229F81BE728CE
:1001C000F60DFA0DF90DF80DF70303190229F61FC4
:1001D000F828FA0A031DF828F90A031DF828F80A76
:1001E000031DF828F80CF90CFA0CF70A0319022978
:1001F0006B08F3006F08F306F31F0029F8170629B0
:10020000F8130629F701F801F901FA010800803016
:100210008318E806ED01EE016408EC006808EC06BE
:1002200063080319F729EB00F70067080319002A90
:10023000EB0203199C29031C5A296808F100F117E5
:100240006908F0006A08EF00EE010310F10CF00CF1
:10025000EF0CEE0CEB0B2429EC1F31296D14142A42
:100260006D106B106D16663084008313292A6D1291
:10027000EC1B44296B1C4F29F10CF00CEF0CEE0C1D
:10028000F70A03190F2A4F29F11B52290310EE0D0B
:10029000EF0DF00DF10DF70303190F2A44296D1727
:1002A000BC296D136408EC00EC1F5829F117082ACB
:1002B000F113082A6708EB00F7006308EB026408F3
:1002C000F100F1176508F0006608EF00EE01031079
:1002D000F10CF00CEF0CEE0CEB0B6629EC1F732904
:1002E000ED14142AED106B10ED166A3084008313A0
:1002F000292AED12EC1B86296B1C9129F10CF00CBC
:10030000EF0CEE0CF70A03190F2A9129F11B94291F
:100310000310EE0DEF0DF00DF10DF70303190F2A89
:100320008629ED17BC29ED136808EC00EC1F9A290B
:10033000F117082AF113082A6808F100F117690873
:10034000F0006A08EF00EC1FA929F1136D15142ABB
:100350006D11EE016B10663084008313292AEC1BAB
:10036000D2296408EC006B1CBC29F10CF00CEF0CDA
:10037000EE0CF70A03190F2AEE1FCD29EF0A031D11
:10038000CD29F00A031DCD29F10A031DCD29F10C59
:10039000F00CEF0CF70A03190F2A6D1B5129ED1B06
:1003A0009329F1298030F106F11FDA29142A68080F
:1003B000EC00E7296408EC00F108031DE729F008C8
:1003C000031DE729EF08031DE729F701082AF11BA0
:1003D000F1290310EE0DEF0DF00DF10DF70BE729EC
:1003E0000F2AEC1FF529F117082AF113082A6708CC
:1003F000F7006808F1006908F0006A08EF00082AB1
:100400006308F7006408F1006508F0006608EF0073
:100410007108F8007008F9006F08FA00472AF70120
:10042000F801F901FA01472AEE01EF09F009F10993
:10043000EE09EE0A031D222AEF0A031D222AF00A02
:100440000319F10A6D183029ED1872296D19A829C0
:10045000D7290008EF07031C332AF00A031D332AAB
:10046000F10A03196B1484030008F007031C3B2AEC
:10047000F10A03196B1484030008801F803AF10706
:1004800003186B146D1A3729ED1A7929AF29080062
:1004900049207908FA007808DD007908DE00752027
:1004A0007030ED009830EC002C30EB007E30EA002C
:1004B0007A08F1007908F0007808EF007708EE007C
:1004C00092207708DD007808DE007908DF007A08DE
:1004D000E000E2010408E1006210831B621483144F
:1004E0007A08E6007908E5007808E4007708E30078
:1004F000CD30EA002C30E9001330E8008730E70007
:1005000007216108840083136218831708006008BC
:10051000F8015F0203188F2A5F08F7009B2AF70192
:100520000830E100DF0DF70D600877020318F700CF
:10053000F80DE10B922A08008316861383128613A6
:100540000830F800A32A0000F817B42AF813EA0CC0
:1005500003188617031C86137817B42A7813F80B30
:10056000A72AB22A000086171C308400840BB62A02
:10057000B92AF81BA62A781BAE2A080078085D085D
:10058000DF006430E00087227708DD007808303033
:10059000031DD12ADE1CD82ADE19D82A5E1A203083
:1005A000D42ADE115E125E14F8077808EA009C2255
:1005B0005D08DF000A30E00087227708DD00780858
:1005C0003030031DE92ADE19ED2A5E1CED2A5E1A81
:1005D0002030F8077808EA009C223030DD075D08FB
:1005E000EA009C2208006A08B63CEA00FA016B089F
:1005F000EE00EB170310EB0CEC0CED0CFA0CF90C05
:10060000F80CF70CEA0BFA2AEE1F112BF709F80980
:10061000F909FA09F70A0319F80A0319F90A03197B
:10062000FA0A0800F701F801F901FA01F201F301F1
:10063000F401F501710870046F046E040319502B66
:100640002030F6000310EA0DEB0DEC0DED0DF20D70
:10065000F30DF40DF50D71087502031D392B7008AB
:100660007402031D392B6F087302031D392B6E08AA
:100670007202031C4A2B6E08F2026F08031C6F0FF4
:10068000F3027008031C700FF4027108031C710F51
:10069000F5020314F70DF80DF90DFA0DF60B222BE8
:1006A00072308400831308000408E2006108E4004B
:1006B0000319732B6008ED005F08EC005E08EB0087
:1006C0005D08EA00F101F0012030EF008230EE0019
:1006D00092207A08E0007908DF007808DE007708C9
:1006E000DD00E40B5A2B6008ED005F08EC005E08AB
:1006F000EB005D08EA00F3227A08E0007908DF00E9
:100700007808DE007708DD00E01F932BE203E21695
:10071000DD09DE09DF09E009DD0A0319DE0A031934
:10072000DF0A0319E00A3B30E9009A30E800CA30DA
:10073000E700E6010A30E40061080319E20A6008F4
:10074000ED005F08EC005E08EB005D08EA00690858
:10075000F1006808F0006708EF006608EE00122359
:100760000008DD00840A0008DE00840A0008DF00BB
:10077000840A0008E000FD308407F708031DD32B2E
:10078000610A64020319D32B62080319D52B0F39B0
:1007900064020319CD2B0318052CE21B052C621BE8
:1007A000D52B2030012C2030E205E21EE32BE21293
:1007B0006108031DE2037708E2002D30EA009C2265
:1007C0006208F700E20161086402031DF12B77085B
:1007D000E2002E30EA009C226208F7002030E20599
:1007E00000303030E21E012CE2126108031DE203EA
:1007F0007708E2002D30EA009C226208F700E2014F
:100800003030F7077708EA009C226908ED00680895
:10081000EC006708EB006608EA00F101F001EF0167
:100820000A30EE0012237A08E9007908E800780817
:10083000E7007708E600E40B9F2B8A110A127F2D50
:100840002C082E020318312CA812280883168700C2
:100850008312871228132808831687008312071330
:100860003D2CA812280883168700831287162813A8
:100870002808831687008312071703102D0D2E02F8
:100880000318492C281228088316870083120712A0
:100890004F2C2812280883168700831207162E086B
:1008A000643C0319562CAE08031D882D48227A0893
:1008B000DC007908DB007808DA007708D9008314B7
:1008C0005C08E6005B08E5005A08E4005908E3000C
:1008D0003208EA003108E9003008E8002F08E70094
:1008E00007217708DD007808DE007908DF007A0844
:1008F000E0006008E4005F08E3005E08E2005D08D5
:10090000E1001730E800B730E7005130E6007D30F5
:10091000E500610803194E2DED00650803194E2D01
:10092000ED02031C982C7F30ED0703184E2D9E2CF2
:100930008130ED02031C4E2D03194E2D6D08F7007A
:10094000F801F901FA01EC016208EB00EB1763080A
:10095000EA006408E9001930ED006808E9020318AC
:10096000C12C0130EA020318C12CEB020318C12C80
:10097000EC020318C12CEC0AEB0AEA0A6808E90742
:10098000F32C6708EA020318DC2C0130EB02031891
:10099000DC2CEC020318DC2CEC0AEB0A6708EA07F3
:1009A0006808E907031CF32CEA0A031DF32CEB0A81
:1009B000031DF32CEC0AF32C66088038EB020318B5
:1009C000F22C0130EC020318F22CEC0A6608803895
:1009D000EB076708EA07031CD02CEB0A031DD02C99
:1009E000EC0AD02C7A14ED0BF62C012D0310E90D36
:1009F000EA0DEB0DEC0D0310FA0DF90DF80DEE0DEF
:100A0000AD2C6E1C092D0310F80CF90CFA0CEE0C31
:100A10000C2DF70303194E2DEE1B352D0310E90D98
:100A2000EA0DEB0DEC0D6808E9020318212D0130E9
:100A3000EA020318212DEB020318212DEC02031CFE
:100A4000442D6708EA0203182C2D0130EB0203182D
:100A50002C2DEC02031C442D66088038EB02031891
:100A6000352D0130EC02031C442DFA0A031D442DE0
:100A7000F90A031D442DF80A031D442DF70A031932
:100A80004E2DF80CF90CFA0C6208ED006608ED0624
:100A9000ED1F4C2DF817522DF813522DF701F801C8
:100AA000F901FA017A08B6007908B5007808B400AF
:100AB0007708B3005C08B2005B08B1005A08B000C8
:100AC0005908AF002A08DD000130DE00BE222030C8
:100AD000EA009C222B08DD000130DE00BE2220301F
:100AE000EA009C22893084005C08E0005B08DF009B
:100AF0005A08DE005908DD000330E100542B203095
:100B0000EA009C220D30EA009C220A30EA009C2276
:100B10002E08C73C031C8E2DAE0A8F2DAE010B1183
:100B20008A110A122128DA012930D900B70A3708B8
:100B3000183C0318CA2DB7010230590784008313EB
:100B40005A188317800A801BCA2D00083B3C0318E3
:100B5000CA2D02305907840083135A188317800165
:100B600001305907840083135A188317800A801BA9
:100B7000CA2D00083B3C0318CA2D013059078400D8
:100B800083135A18831780015908840083135A1855
:100B90008317800A8C108A110A12212850294524B3
:100BA000C52054002328D222C822412A0D05000066
:100BB000A519AE18E60843102000A518AE18E608DF
:100BC000C31773102000D327C12520102010000167
:100BD000A329CF20CB060A00A519AE18E6084310BA
:100BE0002000D3274C2245290001A3294F26C422E7
:100BF000D2060A00A519AE18E60843102000A51871
:100C0000AE18E608C31773102000A519AE18E60841
:100C100043102000D2224626CF2BA021CF265026DB
:100C2000452A4500C3274F26492747100D050001D7
:100C3000A519AE18E60843102000A518AE18E6085E
:100C4000C317731020000634093409340634803485
:100C50008034803480340034A8122808831687003A
:100C60008312871628132808831687008312071714
:100C700083168113091283129412A812280883166E
:100C80008700831228162808831687008312A8116C
:100C900028088316870001308312940000308316E1
:100CA00094000108C0390538810085308312900016
:100CB0004830F80006389200F93083169200073069
:100CC0009C00050885000330F700F70B652E1C0813
:100CD00083120D1383169D01C03083128B0483167B
:100CE0008C1483128B1683161F149F101F159F11CF
:100CF0001F1383121F179F1383169F1783121F142E
:100D00000030F8001F08C73978049F008A150A12BE
:100D1000CF2A4D3084008313000803199D2E013023
:100D2000F800F701F70B922EF80B912E4A30F700DE
:100D3000F70B982E9B2E800B8F2E08000808F03999
:100D4000D50053080F3955048800071528112808C5
:100D500083168700000083120711281128088316C4
:100D6000870083120800D108031DB82E8710B92E02
:100D70008714A8102808831687008312D20E520801
:100D8000D3009E26D20E5208D3009E260D30F700C7
:100D9000F70BC82E0800C830CD008926F030831626
:100DA000880583128710A8102808831687008312ED
:100DB000071128112808831687008312B801380804
:100DC000023C031CEB2E0230CD0089260330D300F9
:100DD0009E26B80ADF2E0D30F700F70BED2E0230FD
:100DE000D3009E260D30F700F70BF42EB80138081B
:100DF000023C031C072F38083820B900D1013908FC
:100E0000D200B3260230CD008926B80AF72E8A1503
:100E10000A12DE2A831603178C170C140000000038
:100E200083128C080319312F0D080313B800031720
:100E30000F080313B90003170C080313BA0001309D
:100E4000D1003A08D200B326380803178D000313E7
:100E5000390803178F008D0A03198F0A03130A2F0D
:100E6000031703138A150A12F22A83168C10023014
:100E700083123B07840083133C18831780013B08CF
:100E8000840083133C188317800101303B078400E2
:100E900083133C188317800183168C148312080077
:100EA00001304D02CF004E08023C031D592F403047
:100EB000CF074F088038D000D1015008D200B326A8
:100EC00008004C080C3A03196C2F063A0319742FCA
:100ED000073A03197A2F7F2FD1010130D200B326B0
:100EE0000230CD0089268B2F0130CD000230CE009C
:100EF00050278B2F0130CD00CE0050278B2F4C0870
:100F00001F3C031C852F0730CC050130D1004C0855
:100F1000D200B3268B2F0800831603178C170C14EE
:100F20000000000083120C087F390319D02F03132F
:100F3000BB0003170D080313BC0003170F080313AE
:100F4000BD003B08CC0061273C0803178D0003134C
:100F50003D0803178F0083168C170C140000000047
:100F600083120C0D0E0D7F390319D02F0313BB0014
:100F700003170D080313BC0003170F080313BD006C
:100F80003B08CC0061273C0803178D0003133D0884
:100F900003178F008D0A03198F0A03138C2F031771
:100FA00003130800F701F8013C0803103D18F70788
:100FB000F70CF80CBD18F707F70CF80C3D19F707FC
:100FC000F70CF80CBD19F707F70CF80C3D1AF707EA
:100FD000F70CF80CBD1AF707F70CF80C3D1BF707D8
:0E0FE000F70CF80CBD1BF707F70CF80C080017
:10100000831603178C170C140000000083120C08C1
:101010007F39031954280313BB0003170D0803136A
:10102000BC0003170F080313BD00A7018B1BA717F4
:101030008B133B08EA008A119C228A15A71B8B1789
:101040003C0803178D0003133D0803178F00831618
:101050008C170C140000000083120C0D0E0D7F394C
:10106000031954280313BB0003170D080313BC0016
:1010700003170F080313BD00A7018B1BA7178B13C2
:101080003B08EA008A119C228A15A71B8B173C0893
:1010900003178D0003133D0803178F008D0A0319F2
:1010A0008F0A031300280317031308004508CC0018
:1010B0004908CC06CC1F612803110310C51B03147B
:1010C00094284508CC004808CD004408CD020319F7
:1010D0006F28CC1F94280308013A830094284908FC
:1010E000CD004508CD0203197B28CC1F94280308A6
:1010F000013A830094284A08CD004608CD0203191E
:101100008728CC1F94280308013A830094284B08B1
:10111000CD004708CD0203199328CC1F942803085B
:10112000013A83009428031008008314A7018B1B45
:10113000A7178B133608E6003508E5003408E400ED
:101140003308E3003E08EA003D08E9003C08E800F7
:101150003B08E7008A1107218A15A71B8B177A081D
:10116000C3007908C2007808C1007708C0004308AE
:10117000C7004208C6004108C5004008C400CB01B2
:10118000CA01C901C8015620031CCC2843303F07BF
:10119000AC006430AD00CE28AC01AD0108000408FD
:1011A000C4004308C6000319F628A7018B1BA71724
:1011B0008B134208ED004108EC004008EB003F08AB
:1011C000EA00F101F0012030EF008230EE008A11D8
:1011D00092208A15A71B8B177A08C2007908C100D4
:1011E0007808C0007708BF00C60BD528A7018B1B65
:1011F000A7178B134208ED004108EC004008EB00F4
:101200003F08EA008A11F3228A15A71B8B177A0878
:10121000C2007908C1007808C0007708BF00C21F6B
:101220001E29C403C416BF09C009C109C209BF0AE7
:101230000319C00A0319C10A0319C20A3B30CB00C3
:101240009A30CA00CA30C900C8010A30C600430833
:101250000319C40AA7018B1BA7178B134208ED00C3
:101260004108EC004008EB003F08EA004B08F100A1
:101270004A08F0004908EF004808EE008A111223DE
:101280008A15A71B8B170008BF00840A0008C0003E
:10129000840A0008C100840A0008C200FD308407E7
:1012A000F708031D6629430A460203196629440804
:1012B000031968290F394602031960290318A02968
:1012C000C41BA029441B682920309A292030C4055A
:1012D000C41E7829C4124308031DC4037708C40040
:1012E0002D30CC008A1161278A154408F700C4010B
:1012F00043084602031D88297708C4002E30CC001D
:101300008A1161278A154408F7002030C40500308F
:101310003030C41E9A29C4124308031DC403770841
:10132000C4002D30CC008A1161278A154408F700CB
:10133000C4013030F7077708CC008A1161278A157D
:10134000A7018B1BA7178B134B08ED004A08EC0075
:101350004908EB004808EA00F101F001EF010A300A
:10136000EE008A1112238A15A71B8B177A08CB006F
:101370007908CA007808C9007708C800C60B2A296E
:101380000800831603178C170C14000000000318C4
:10139000F22983120C087F390313C00003170D08CC
:1013A0000313C10003170F080313C2004008CC0049
:1013B0008A1161278A15410803178D00031342081B
:1013C00003178F0083168C170C1400000000831283
:1013D0000313BF0BEC29EF2983160317F229132AF5
:1013E0008316031783120C0D0E0D7F390313C000F3
:1013F00003170D080313C10003170F080313C200DE
:101400004008CC008A1161278A15410803178D0016
:101410000313420803178F008D0A03198F0A031064
:101420000313BF0BC12908007808A7018B1BA7175E
:101430008B133B08DF006430E0008A1187228A1595
:10144000A71B8B177708BB0078083030031D2F2AA5
:10145000BC1C382ABC19382A3C1A2030322ABC114C
:101460003C123C14F8077808CC008A1161278A15D1
:10147000A7018B1BA7178B133B08DF000A30E00086
:101480008A1187228A15A71B8B177708BB0078085B
:101490003030031D512ABC19572A3C1C572A3C1ACC
:1014A0002030F8077808CC008A1161278A1530307F
:1014B000BB073B08CC008A1161278A150800A701E9
:1014C0008B1BA7178B138A1148228A15A71B8B1712
:1014D0007708BF007808C0007908C1007A08C20008
:1014E0003E08C7003D08C6003C08C5003B08C400D4
:1014F0004208CB004108CA004008C9003F08C800A4
:101500005620031C862AAC01AD018A2A4630AC0065
:101510005030AD0008003D083E068039C000BD1FB8
:10152000932ABD09BD0ABE1F972ABE09BE0A3E08FE
:10153000F8013D0203189F2A3D08F700AB2AF70186
:101540000830BF00BD0DF70D3E0877020318F70005
:10155000F80DBF0BA22AC01FAF2AF809F80A08002D
:10156000840183131F308305831686138312861725
:10157000AC01AD01B201B101B001AF01B601B501DD
:10158000B401B301B70183161F149F141F159F11D7
:1015900007309C00FF308312A8008A112C2E8A1578
:1015A000A812280883168700831287162813280894
:1015B00083168700831207178A11CB2E8A15D10153
:1015C0004830D2008A11B3268A150230CD008A1124
:1015D00089268A15233003178D0006308F008A1163
:1015E00003130A2F8A15D1010330D2008A11B326C2
:1015F0008A150230CD008A1189268A15BC0129304E
:10160000BB008A1135278A150230B8009630CD000C
:101610008A1189268A15B80B062BBC012930BB001C
:101620008A1135278A150130CD000230CE008A118B
:1016300050278A15CE3003178D0005308F008A1190
:1016400003138C278A15D23003178D0005308F00C5
:1016500003130020BE01BD01BC017F30BB00BF01F0
:1016600095200130CD00CE008A1150278A15A701A0
:101670008B1BA7178B138A1148228A15A71B8B1760
:101680007708BB007808BC007908BD007A08BE0066
:10169000023084007A08C2007908C1007808C000CE
:1016A0007708BF000130C300CF20DA3003178D0068
:1016B00005308F00031404300313BF00C1210C3028
:1016C000CD000130CE008A1150278A152A08BB00B0
:1016D0000130BC0014223A30CC008A1161278A15EF
:1016E0002B08BB000130BC0014220A30CD000230B0
:1016F000CE008A1150278A15893084003608C2002E
:101700003508C1003408C0003308BF000130C300F1
:10171000CF20DF3003178D0005308F000314063013
:101720000313BF00C121C830CD008A1189268A1554
:10173000AA1BB12B2A08033C0318B12BAC01AD0145
:101740000130CD000230CE008A1150278A1540307A
:1017500003178D0000308F008A1103138C278A1520
:10176000B02BA7018B1BA7178B138A1148228A1550
:10177000A71B8B177708BB007808BC007908BD0051
:101780007A08BE00C7003D08C6003C08C5003B08FB
:10179000C400CB01CA011630C9008630C8005620EB
:1017A00003182A2BBC012930BB008A1135278A1562
:1017B0000130B9003908BC003C30BD008A11D22785
:1017C0008A157808643CBA000C30CC008A11612775
:1017D0008A150130CD000230CE008A1150278A15BB
:1017E000E33003178D0005308F008A1103138C2717
:1017F0008A15E83003178D0005308F008A11031316
:101800008C278A15BA08031D082CB9080319892CDE
:10181000BE01BD011630BC008630BB005F22013026
:10182000CD00CE008A1150278A15A7018B1BA71760
:101830008B138A1148228A15A71B8B177708BB00C8
:101840007808BC007908BD007A08BE000230840028
:101850007A08C2007908C1007808C0007708BF0084
:101860000130C300CF20EE3003178D0005308F000C
:10187000031404300313BF00C1212B08BA02BA1F9E
:10188000432C3B30BA002A08BC003C30BD008A1112
:10189000D2278A157808643CF8002B087802BC002F
:1018A000BD003C30BE008B227808B9002A08BC007D
:1018B0003C30BD008A11D2278A157808643CF800B4
:1018C0002B087802BB003908BC003C30BD008A11EF
:1018D000D2278A1578083B02BA000930CD000130C2
:1018E000CE008A1150278A153908BB000130BC0090
:1018F00014223A30CC008A1161278A153A08BB00BD
:101900000130BC001422C830CD008A1189268A1506
:10191000022CBC012930BB008A1135278A150C30F6
:10192000CC008A1161278A150130CD000230CE002B
:101930008A1150278A15F13003178D0005308F006A
:101940008A1103138C278A15F53003178D00053093
:101950008F0003130020BE01BD012030BC00803089
:10196000BB000A30BF0095200130CD00CE008A11A7
:1019700050278A15A7018B1BA7178B138A114822A2
:101980008A15A71B8B177708BB007808BC0079085D
:10199000BD007A08BE00023084007A08C2007908CF
:1019A000C1007808C0007708BF000130C300CF2015
:1019B000FC3003178D0005308F000314043003132F
:1019C000BF00C1210C30CD000130CE008A1150275C
:1019D0008A152A08BB000130BC0014223A30CC0022
:1019E0008A1161278A152B08BB000130BC00142224
:1019F0000A30CD000230CE008A1150278A15893076
:101A000084003608C2003508C1003408C00033081D
:101A1000BF000130C300CF20013003178D00063016
:101A20008F00031406300313BF00C121C830CD005E
:101A30008A1189268A15AA1B342D2A08023C03180C
:101A4000342DAC01AD010130CD000230CE008A1141
:101A500050278A15403003178D0000308F008A11FF
:101A600003138C278A15332DA7018B1BA7178B1304
:101A70008A1148228A15A71B8B177708BB007808A4
:101A8000BC007908BD007A08BE00C7003D08C6004A
:101A90003C08C5003B08C400CB01CA015230C90054
:101AA0008630C80056200318AB2CBA08031D5B2DE6
:101AB000B9080319DC2DBE01BD015230BC008630CF
:101AC000BB005F220130CD00CE008A1150278A155D
:101AD000A7018B1BA7178B138A1148228A15A71BF6
:101AE0008B177708BB007808BC007908BD007A081E
:101AF000BE00023084007A08C2007908C10078086C
:101B0000C0007708BF000130C300CF2007300317A3
:101B10008D0006308F00031404300313BF00C12171
:101B20002B08BA02BA1F962D3B30BA002A08BC0017
:101B30003C30BD008A11D2278A157808053CF80090
:101B40002B087802BC00BD003C30BE008B22780818
:101B5000B9002A08BC003C30BD008A11D2278A1582
:101B60007808053CF8002B087802BB003908BC0057
:101B70003C30BD008A11D2278A1578083B02BA0092
:101B80000930CD000130CE008A1150278A1539085E
:101B9000BB000130BC0014223A30CC008A1161270E
:101BA0008A153A08BB000130BC001422C830CD00B1
:101BB0008A1189268A15552DAC01AD010C30CC0057
:101BC0008A1161278A150130CD000230CE008A11BA
:101BD00050278A150A3003178D0006308F008A11AE
:101BE00003138C278A15123003178D0006308F00DF
:101BF000031300200130CD00CE008A1150278A1532
:101C0000A7018B1BA7178B138A1148228A15A71BC4
:101C10008B177708BB007808BC007908BD007A08EC
:101C2000BE00023084007A08C2007908C10078083A
:101C3000C0007708BF000130C300CF201A3003175F
:101C40008D0006308F00031404300313BF00C12140
:101C50000A30CD000130CE008A1150278A15893014
:101C600084003608C2003508C1003408C0003308BB
:101C7000BF000130C300CF201F3003178D00063096
:101C80008F00031406300313BF00C121FA2D042B6B
:021C90006300EF
:02400E003A3F37
:00000001FF
;PIC16F877A
;CRC=9291 CREATED="29-V-11 14:13"
/Designs/Tools/reflow2/SW/process.h
0,0 → 1,12
 
// reflow soldering profile difinition
#define PREHEAT_SLOPE 1.0 // preheat ramp up time
#define SOAK_TEMP 150 // soak temperature
 
#define SOAK_TIME 100 // time to soak
 
#define SOLDER_SLOPE 2.5
#define SOLDER_TEMP 210
#define SOLDER_TIME 5
 
 
/Designs/Tools/reflow2/SW/reflow.PJT
0,0 → 1,44
[PROJECT]
Target=reflow.HEX
Development_Mode=2
Processor=0x877A
Processor_Text=PIC16F877A
ToolSuite=CCS
 
[Directories]
Include=
Library=
LinkerScript=
 
[Target Data]
FileList=D:\MLAB\Designs\Tools\reflow2\SW\reflow.c
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[reflow.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=reflow.c
 
[Windows]
0=0000 reflow.c 0 0 796 451 3 0
 
[Opened Files]
1=reflow.c
2=reflow.h
3=C:\Program Files\PICC\devices\16F877A.h
4=process.h
5=C:\Program Files\PICC\drivers\math.h
6=lcd.c
7=
[Units]
Count=1
1=reflow (main)
/Designs/Tools/reflow2/SW/reflow.h
0,0 → 1,16
#include <16F877A.h>
#device adc=10
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
 
#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8)
 
/Designs/Tools/reflow2/SW/LCD.C
0,0 → 1,318
// LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem
// (c)miho 2002,2005
//
// Historie:
//
// 0.00 Uvodni verze se snadnou definici portu LCD displeje
// 0.01 Oprava portu (zapomenute stare identifikatory)
// 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty
// 0.03 Doplnena procedura lcd_clr pro smazani displeje
//
//
// Funkce:
//
// lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni
//
// lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky
// \f = \x0C - nova stranka - smazani displeje
// \n = \x0A - odradkovani (prechod na druhou radku)
// \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet
// \r = \x0D - goto home to position 1,1
// \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM
// \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM
// Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce)
//
// lcd_gotoxy(x,y) presune kurzor na uvedenou adresu
// nekontroluje parametry
//
// lcd_cursor_on zapne kurzor
// lcd_cursor_off vypne kurzor
//
// lcd_clr smaze displej
//
// lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho
// retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM.
// Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7.
// Na konci se provede lcd_gotoxy(1,1).
// Na konci teto knihovny je priklad pouziti definovanych znaku
//
//
// Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
//
// #define LCD_RS PIN_B2 // rizeni registru LCD displeje
// #define LCD_E PIN_B1 // enable LCD displeje
// #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
//
//
// Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov)
//
// #define LCD_RS PIN_B2 // rizeni registru LCD displeje
// #define LCD_E PIN_B1 // enable LCD displeje
// #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty
// #define LCD_D1 PIN_C3 // D1
// #define LCD_D2 PIN_C4 // D2
// #define LCD_D3 PIN_C5 // D3
 
 
 
 
// Privatni sekce, cist jen v pripade, ze neco nefunguje
 
 
 
 
#ifdef LCD_DATA_LSB
// Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne
// bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva
// v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu
//
#define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu
#define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu
#define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru
#define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu
//
#if LCD_SHIFT>4 // kontrola mezi
#error LCD data port LSB bit not in range 0..4
#endif
#endif
 
 
// Definice konstant pro LCD display
//
#define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem
#define LCD_CURSOR_OFF_ 0x0C // zadny kurzor
#define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky
 
 
// Definice rezimu LCD displeje
//
BYTE const LCD_INIT_STRING[4] =
{
0x28, // intrfejs 4 bity, 2 radky, font 5x7
LCD_CURSOR_OFF_, // display on, kurzor off,
0x01, // clear displeje
0x06 // inkrement pozice kurzoru (posun kurzoru doprava)
};
 
 
// Odesle nibble do displeje (posle data a klikne signalem e)
//
void lcd_send_nibble( BYTE n )
{
#ifdef LCD_DATA_LSB
// data jsou za sebou na 4 bitech jednoho portu
*LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej
#else
// data jsou na libovolnych 4 bitech libovolnych portu
output_bit(LCD_D0,bit_test(n,0));
output_bit(LCD_D1,bit_test(n,1));
output_bit(LCD_D2,bit_test(n,2));
output_bit(LCD_D3,bit_test(n,3));
#endif
output_bit(LCD_E,1); // vzestupna hrana
delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat
output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us)
}
 
 
// Odesle bajt do registru LCD
//
// Pokud je Adr=0 .. instrukcni registr
// Pokud je Adr=1 .. datovy registr
//
void lcd_send_byte( BOOLEAN Adr, BYTE n )
{
output_bit(LCD_RS,Adr); // vyber registr
swap(n);
lcd_send_nibble(n); // posli horni pulku bajtu
swap(n);
lcd_send_nibble(n); // posli spodni pulku bajtu
delay_us(40); // minimalni doba na provedeni prikazu
}
 
 
// Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje
//
// Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur
//
void lcd_init()
{
 
int i; // pocitadlo cyklu
 
delay_ms(200); // spozdeni pro provedeni startu displeje po zapnuti napajeni
 
#ifdef LCD_DATA_LSB
// data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy
*LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD
#endif
 
output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav
output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav
 
for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice
{
delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel
lcd_send_nibble(3); // rezim 8 bitu
}
 
delay_us(40); // cas na zpracovani
lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu)
delay_us(40); // cas na zpracovani
 
for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod)
{
lcd_send_byte(0,LCD_INIT_STRING[i]);
delay_ms(2);
}
}
 
 
// Proved presun kurzoru
//
// Pozice 1.1 je domu
//
void lcd_gotoxy( BYTE x, BYTE y)
{
 
BYTE Adr;
 
Adr=x-1;
if(y==2)
Adr+=LCD_LINE_2;
 
lcd_send_byte(0,0x80|Adr);
}
 
 
// Zapis znaku na displej, zpracovani ridicich znaku
//
void lcd_putc( char c)
{
 
switch (c)
{
case '\f' : lcd_send_byte(0,1); // smaz displej
delay_ms(2);
break;
case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky
case '\r' : lcd_gotoxy(1,1); break; // presun home
// case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet
default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F
lcd_send_byte(1,c); break; // zapis znak
}
}
 
 
// Zapni kurzor
//
void lcd_cursor_on()
{
lcd_send_byte(0,LCD_CURSOR_ON_);
}
 
 
// Vypni kurzor
//
void lcd_cursor_off()
{
lcd_send_byte(0,LCD_CURSOR_OFF_);
}
 
 
// Smaz displej
//
void lcd_clr()
{
lcd_putc('\f');
}
 
 
// Definice vlastnich fontu
//
// Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje
// Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden
// priklad pouziti definovanych znaku.
 
 
// Pomocna procedura pro posilani ridicich dat do radice displeje
//
void lcd_putc2(int Data)
{
lcd_send_byte(1,Data);
}
 
 
// Pomocne definice pro programovani obsahu CGRAM
//
#define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2)
#define lcd_define_def(String) printf(lcd_putc2,String);
#define lcd_define_end() lcd_send_byte(0,3); delay_ms(2)
 
 
// Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def
//
#define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end();
 
 
// Pripravene definice fontu vybranych znaku
// V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80
//
#define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */
#define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */
 
#define LCD_CHAR_BAT20 "\x0E\x1F\x11\x11\x11\x11\x1F\x1F" /* symbol baterie 20% */
#define LCD_CHAR_BAT40 "\x0E\x1F\x11\x11\x11\x1F\x1F\x1F" /* symbol baterie 40% */
#define LCD_CHAR_BAT60 "\x0E\x1F\x11\x11\x1F\x1F\x1F\x1F" /* symbol baterie 60% */
#define LCD_CHAR_BAT80 "\x0E\x1F\x11\x1F\x1F\x1F\x1F\x1F" /* symbol baterie 80% */
 
#define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */
#define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */
#define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */
#define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */
#define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */
#define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */
#define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */
#define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */
#define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */
#define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */
#define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */
#define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */
#define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */
#define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */
#define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */
#define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */
#define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */
#define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */
#define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */
#define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */
#define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */
#define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */
#define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */
#define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */
#define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */
#define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */
#define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */
#define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */
#define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */
#define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */
#define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */
#define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */
#define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */
 
#define LCD_CHAR_STUPEN "\x06\x09\x09\x06\x80\x80\x80\x80" /* ° stupen C */
 
// Priklad pouziti definovanych znaku
//
//
//void lcd_sample()
//{
// lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0
// lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2
// // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji
// // jediny definicni retezec)
// printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3
// delay_ms(1000);
// lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0
// delay_ms(1000);
//}