annotate code_part1/OSTC_code_asm_part1/docu/README.txt @ 485:e83f883c96b2

quick fix for wrong wait routines
author heinrichsweikamp
date Sat, 15 Oct 2011 13:45:15 +0200
parents ba5309c01dd7
children
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
242
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
43 - Make sure the IDE is configured to find the "clib.lib" file
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
44 (needed even with precompiled p2_deco.o)
193
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
242
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
50 - If you want to compile in DEBUG mode, select "Debug" in the build configuration
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
51 menu in the top-bar of the IDE.
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
52 It adds more safety tests into the code, so it is easier to spot bugs,
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
53 but generate firware NOT SUITABLE for diving !
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
54 ==> Always revert to Release and recompile everything once debugging is done.
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
55
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
56 - If you want a translated version (FRENCH, SPANISH, etc.), uncomment
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
57 the corresponding #define in definitions.asm
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
58
191
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
59 - Hit F10 to recompile everything.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
60 --> You should get a .hex file where you saved your project.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
61
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
62
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
63 Installing the new firmware
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
64 ---------------------------
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
65
242
ba5309c01dd7 Minor corrections in doc.
JeanDo
parents: 193
diff changeset
66 - Get the .hex file you want to flash onto the OSTC Mk2.
191
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
67
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
68 - Connect the OSTC, wake it up.
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 - 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
71 the communication port.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
72
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
73 - Once it is ready, Click Browse to select the .hex file
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
74 ==> DO NOT HIT Write Flash YET !
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 - On the OSTC, go to the reset menu, select Reboot OSTC
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
77 ==> DO NOT CONFIRM YET !
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
78
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
79 - 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
80
192
c8816e4bc724 GF Model
JeanDo
parents: 191
diff changeset
81 - 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
82 The OSTC should have the blue and red led blinking rapidly.
192
c8816e4bc724 GF Model
JeanDo
parents: 191
diff changeset
83 The upload time is ~ 20 secondes.
191
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
84
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
85 - Once done, the OSTC finishes its reboot.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
86
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
87 - 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
88 instead of choosing the reboot menu, during the 10sec timeslot after
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
89 starting bootloader write flash.
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
90
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
91
a08fc66fee28 New README.txt for install, recompile and flash.
JeanDo
parents:
diff changeset
92