annotate code_part1/OSTC_code_asm_part1/docu/README.txt @ 212:275befc5f39d

Debug GF model (bug #11 & #12). + ASSERT stops should be computed in order (bug#11). + BUGFIX: Mark GF_low reference at actual first stop, not predicted one. + BUGFIX: sim_to_first_stop() stops BEFORE first stop, not after (bug#11). + BUGFIX: check that calc_nextdecodepth() don't ascent faster than 10m/mn (bug#11). + BUGFIX: calc_nextdecodepth() should check gas switch, too (bug#11). + let gas switch detection in depth/meter (not ambientPresure/mbar). + BUGFIX OCR mode: bad diluent value in sim_alveolar_pressure() (bug#11). + BUGFIX: add deco distance (offset) only to compartiment integration, not to B?hlmann or GF criterion. + BUGFIX: add margin one meter above gas switch depth (bug#12) + BUGFIX: When ascenting too fast, cancel gas switch delay and history (bug#11).
author JeanDo
date Mon, 21 Feb 2011 22:36:48 +0100
parents 652e17b6267a
children ba5309c01dd7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
191
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
1 To recompile the OSTC code you will need to install the following:
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
2 ------------------------------------------------------------------
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
3
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
4 - A Mercurial client, to download the source code and updates easily.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
5 TortoiseHg is free, and works well.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
6
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
7 - The Microchip MPLab IDE. This is free, and enable to recompile
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
8 all the assembly code, link, and produce a .hex file.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
9
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
10 - If you want to modify the decompression algorithm, you will also
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
11 need the MPLab C18 compiler. There is a demo free for the first
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
12 30 days.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
13 If you don't modify p2_deco.c, you don't need the C18 compiler,
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
14 see below.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
15
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
16 - The Tiny bootloader for windows, see the HW site.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
17
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
18
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
19 Creating a working project:
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
20 ---------------------------
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
21
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
22 - Launch the MPLab IDE.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
23
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
24 - Create a new project (Project > Project Wizard...)
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
25 - Choose device PIC18F4685
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
26 - Select Microchip C18 Toolsuite (if you installed the C18 compiler)
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
27 or Microchip MPASM Toolsuite (if not)
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
28 --> Make sure the paths are corect.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
29 - Choose a name and a directoty.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
30
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
31 - Add the following files:
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
32 <my_source_path>/code_part1/OSTC_code_asm_part1/18f4685_ostc_mkII.lkr
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
33 <my_source_path>/code_part1/OSTC_code_asm_part1/MAIN.ASM
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
34 <my_source_path>/code_part1/OSTC_code_c_part2/p2_deco.o
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
35
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
36 (or use the .c instead of the .o if you have the C18 compiler)
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
37
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
38 - If you want to compile C code, configure it:
193
652e17b6267a Minor fixes.
JeanDo
parents: 192
diff changeset
39 Menu: Project > Build Options... > Project > MPLab C18
191
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
40 General: Default storage = Overlay (-sco)
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
41 Optimization: Enable all
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
42
193
652e17b6267a Minor fixes.
JeanDo
parents: 192
diff changeset
43 - Make sure the IDE is configured to find the clib.lib file
652e17b6267a Minor fixes.
JeanDo
parents: 192
diff changeset
44 (needed even with pé_deco.o)
652e17b6267a Minor fixes.
JeanDo
parents: 192
diff changeset
45 Menu : Project > Build Options ... > Project > Directories
652e17b6267a Minor fixes.
JeanDo
parents: 192
diff changeset
46 Set «Search Directories» for : «Library Seach Path» to the path of the
652e17b6267a Minor fixes.
JeanDo
parents: 192
diff changeset
47 “clib.lib” file (in c:\Program Files\Microship\MCC18\lib in my case)
652e17b6267a Minor fixes.
JeanDo
parents: 192
diff changeset
48 Set «Build Directory Policy» to «Assemble/Compile in source-file directory, link in output directory»
652e17b6267a Minor fixes.
JeanDo
parents: 192
diff changeset
49
191
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
50 - Hit F10 to recompile everything.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
51 --> You should get a .hex file where you saved your project.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
52
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
53
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
54 Installing the new firmware
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
55 ---------------------------
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
56
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
57 - Get the .hew file you want to flash onto the OSTC.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
58
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
59 - Connect the OSTC, wake it up.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
60
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
61 - Launch the Tiny bootloader. It should work for some time, trying to open
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
62 the communication port.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
63
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
64 - Once it is ready, Click Browse to select the .hex file
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
65 ==> DO NOT HIT Write Flash YET !
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
66
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
67 - On the OSTC, go to the reset menu, select Reboot OSTC
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
68 ==> DO NOT CONFIRM YET !
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
69
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
70 - Click "Write Flash" button. Now you have 10sec to confirm on OSTC too.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
71
192
c8816e4bc724 GF Model
JeanDo
parents: 191
diff changeset
72 - The bootloader should say it found a 18F6485 device, and start uploading.
191
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
73 The OSTC should have the blue and red led blinking rapidly.
192
c8816e4bc724 GF Model
JeanDo
parents: 191
diff changeset
74 The upload time is ~ 20 secondes.
191
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
75
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
76 - Once done, the OSTC finishes its reboot.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
77
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
78 - If you OSTC is stuck in some bad code, you can do the magic magnet reset
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
79 instead of choosing the reboot menu, during the 10sec timeslot after
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
80 starting bootloader write flash.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
81
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
82
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
83