annotate code_part1/OSTC_code_asm_part1/docu/README.txt @ 225:2dc4a7340510

BUGFIX Gas usage for unsorted gas list. + Fix detection of saturation (6553.5 l). + Better handling of unsorted gas list.
author JeanDo
date Thu, 03 Mar 2011 15:52:16 +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