OSDN Git Service

v 162, added Conditionnal Compilation and bootloader
[fast-forth/master.git] / MSP430-FORTH / SD_TEST.f
1
2 \ how to test SD_CARD driver on your launchpad:
3
4
5 \ remove the jumpers RX, TX of programming port (don't remove GND, TST, RST and VCC)
6 \ wire PL2303TA/HXD: GND <-> GND, RX <-- TX, TX --> RX
7 \ connect it to your PC on a free USB port
8 \ connect the PL2303TA/HXD cable to your PC on another free USB port
9 \ configure TERATERM as indicated in forthMSP430FR.asm
10
11
12 \ if you have a MSP-EXP430FR5994 launchpad, program it with MSP_EXP430FR5994_3Mbds_SD_CARD.txt
13 \ to do, drag and drop this file onto prog.bat
14 \ nothing else to do!
15
16
17 \ else edit forthMSP430FR.asm with scite editor
18 \   uncomment your target, copy it
19 \   paste it into (SHIFT+F8) param1
20 \   set DTC .equ 1
21 \       FREQUENCY   .equ 16
22 \       THREADS     .equ 16
23 \       TERMINALBAUDRATE    .equ 3000000
24 \         
25 \   uncomment:  CONDCOMP
26 \               MSP430ASSEMBLER
27 \               SD_CARD_LOADER
28 \               SD_CARD_READ_WRITE
29
30 \   compile for your target (CTRL+0)
31 \
32 \   program your target via TI interface (CTRL+1)
33 \
34 \   then wire your SD_Card module as described in your MSP430-FORTH\target.pat file
35
36
37
38
39 \ format FAT16 or FAT32 a SD_CARD memory (max 64GB) with "FRxxxx" in the disk name
40 \ drag and drop \CONDCOMP\MISC folder on the root of this SD_CARD memory (FastForth doesn't do yet)
41 \ put it in your target SD slot
42 \ if no reset, type COLD from the console input (teraterm) to reset FAST FORTH
43
44 \ with MSP430FR5xxx or MSP430FR6xxx targets, you can first set RTC:
45 \ by downloading RTC.f with SendSourceFileToTarget.bat
46 \ then terminal input asks you to type (with spaces) (DMY), then (HMS) (or (HM)),
47 \ So, subsequent copied files will be dated:
48
49 \ with CopySourceFileToTarget_SD_Card.bat (or better, from scite editor, menu tools):
50
51 \   copy TESTASM.4TH        to \MISC\TESTASM.4TH    (add path \MISC in the window opened by TERATERM)
52 \   copy TSTWORDS.4TH       to \TSTWORDS.4TH
53 \   copy CORETEST_xMPY.4TH  to \CORETEST.4TH        (x=S for FR4133, else x=H; suppr _xMPY in the window opened by TERATERM)
54 \   copy SD_TOOLS.f         to \SD_TOOLS.4TH
55 \   copy SD_TEST.f          to \SD_TEST.4TH
56 \   copy PROG10k.f          to \PROG10k.4TH
57 \   copy RTC.f              to \RTC.4TH             ( doesn't work with if FR2xxx or FR4xxx)
58
59
60
61
62 : SD_TEST
63     ECHO CR
64     ."    1 Load ANS core tests" CR
65     ."    2 Load, compile and run a 10k program "
66             ." from its source file (quiet mode)" CR
67     ."    3 Read only this source file (quiet mode)" CR
68     ."    4 Write a dump of the FORTH kernel to yourfile.txt" CR
69     ."    5 append a dump of the FORTH kernel to yourfile.txt" CR
70     ."    6 Load truc (test error)" CR
71     ."    7 Set date and time" CR
72     ."    your choice : "
73     KEY
74     48 - 
75     DUP 1 = 
76     IF  .
77         LOAD" CORETEST.4TH"
78     ELSE DUP 2 =
79         IF  .
80             LOAD" PROG10K.4TH"
81         ELSE DUP 3 =
82             IF  .
83                 READ" PROG10K.4TH"
84                 BEGIN
85                     READ    \ sequentially read 512 bytes
86                 UNTIL       \ prog10k.4TH is closed
87             ELSE DUP 4 =
88                 IF  .
89                     DEL" YOURFILE.TXT"
90                     WRITE" YOURFILE.TXT"
91                     ['] SD_EMIT IS EMIT
92                     PROGRAMSTART HERE OVER - DUMP
93                     ['] (EMIT) IS EMIT
94                     CLOSE
95                 ELSE DUP 5 =
96                     IF  .
97                         WRITE" YOURFILE.TXT"
98                         ['] SD_EMIT IS EMIT
99                         PROGRAMSTART HERE OVER - DUMP
100                         ['] (EMIT) IS EMIT
101                         CLOSE
102                     ELSE DUP 6 =
103                         IF  .
104                             LOAD" truc"
105                         ELSE DUP 7 =
106                             IF  .
107                                 LOAD" RTC.4TH"
108                             ELSE 
109                                 DROP ." ?"
110                                 CR ."    loading TSTWORDS.4TH..."
111                                 LOAD" TSTWORDS.4TH"
112                             THEN
113                         THEN
114                     THEN
115                 THEN
116             THEN
117         THEN
118     THEN
119 ;
120
121 ;      It's done..."
122
123 SD_TEST