Benutzer-Werkzeuge

Webseiten-Werkzeuge


en:projects:4e4th:start

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
en:projects:4e4th:start [2018-05-12 11:39]
mka [What Terminal is the right one?]
en:projects:4e4th:start [2018-05-13 00:17] (aktuell)
mka
Zeile 1: Zeile 1:
-====== 4E4th ====== +====== 4E4th -  the New Version 2018 ====== 
  
-4E4th is a small Forth running on TI's **LaunchPad**, residing inside the MSP430G2553.+4E4th is a small Forth running on TI's **LaunchPad**, residing inside the MSP430G2553 Flash memory.
  
-Communication with the 4E4th works with its line editoraccessed by a terminal  emulator. +Communication with the 4E4th works with its line editor accessed by a terminal  emulator. 
  
 4E4th((4e4th05a May 2018)) is based on MSP430 CamelForth version 0.5a written by B. J. Rodriguez for the TI MSP430G2553 Launchpad board. http://www.camelforth.com/  4E4th((4e4th05a May 2018)) is based on MSP430 CamelForth version 0.5a written by B. J. Rodriguez for the TI MSP430G2553 Launchpad board. http://www.camelforth.com/ 
  
-It is an ANS Forth subset, needs 6K of the MSP430G2553 MCU FLASH (0xE000-0xFFFF). +It covers an ANS Forth subset, needs 6K of the MSP430G2553 MCU FLASH (0xE000-0xFFFF). 
 There are 8K (0xC000-0xDFFF) free for your own Experiments. There are 8K (0xC000-0xDFFF) free for your own Experiments.
  
Zeile 17: Zeile 17:
 ===== Bootstrap Loading ===== ===== Bootstrap Loading =====
  
-  * You have a LaunchPad with TI's MSP430G2553 MCU and **4E4th inside**? - you have nothing further to do before starting.+  * If you have a LaunchPad with TI's MSP430G2553 MCU and **4E4th inside** you have nothing further to do before starting.
  
-  * In case you have your own LaunchPad with MSP430G2553 you need to FLASH the [[https://github.com/mikalus/4e4th05a|4e4th05a.hex]] Image, Intel Hex Format. Section "Programmer" below will tell you how.  +  * In case you have a new LaunchPad with an MSP430G2553 on it, then you need to FLASH the [[https://github.com/mikalus/4e4th05a|4e4th05a.hex]] Image, Intel Hex Format. Section "Programmer" below will tell you how.  
  
  
Zeile 25: Zeile 25:
 ===== LaunchPad Adjustments =====  ===== LaunchPad Adjustments ===== 
  
-Starting with Rev1.5 TI's LaunchPad has jumpers to switch Rx and Tx pins between Software UART and Hardware UART. +Starting with Rev1.5TI's LaunchPad has jumpers to switch the Rx and Tx pins from the interface between Software UART and Hardware UART function. The LaunchPad TXD and RXD jumpers on J3 at the LaunchPad board when delivered are set to the SW UART position by TI. 4E4th needs the hardware UART function, so the position of the TXD and RXD jumpers on J3 have to be changed as shown in the image of the MSP-EXP430G2 LaunchPad Quick Start Guide (SLAC432) to ensure that the Rx and Tx pins are properly configured for the HW UART.\\ 
-The LaunchPad TXD and RXD jumpers on J3 at the LaunchPad board are in SW UART position when delivered by TI. 4E4th needs the hardware UART, so position the TXD and RXD jumpers on J3 as shown with the image of the MSP-EXP430G2 LaunchPad Quick Start Guide (SLAC432) to ensure that the Rx and Tx pins are properly configured for the HW UART. \\ +
 {{:projects:4e4th:start:rxd-txd-launchpad-rev15.png?100|}} {{:projects:4e4th:start:rxd-txd-launchapd-rev15-schema.png?100|}} {{:projects:4e4th:start:rxd-txd-launchpad-rev15.png?100|}} {{:projects:4e4th:start:rxd-txd-launchapd-rev15-schema.png?100|}}
  
-In case you are using 4E4th with an older LaunchPad version, remove the TXD and RXD jumpers and connect the TXD and RXD pins crosswise. \\  {{:projects:4e4th:start:txt-rxt-launchpad-rev13.png?200|}} {{:projects:4e4th:start:txt-rxt-launchpad-rev13-schema.png?200|}}+In case you are using 4E4th on an older LaunchPad version, remove the TXD and RXD jumpers and connect the TXD and RXD pins crosswise. \\  {{:projects:4e4th:start:txt-rxt-launchpad-rev13.png?200|}} {{:projects:4e4th:start:txt-rxt-launchpad-rev13-schema.png?200|}}
      
  
Zeile 42: Zeile 41:
        
  
-== Windows XP, 710 ==+== Windows XP, 7 and 10 ==
  
-LaunchPad Windows USB Drivers have to be installed. +Here, the LaunchPad Windows USB Drivers have to be installed. 
   Further information is found at TI's document slau278h.pdf, page 139, Hardware Installation Guide.    Further information is found at TI's document slau278h.pdf, page 139, Hardware Installation Guide. 
-Source: http://www.ti.com/lit/ug/slau278h/slau278h.pdf 
  
-  * TeraTerm works fine. http://www.heise.de/download/teraterm-pro.html +  * TeraTerm will work fine. http://www.heise.de/download/teraterm-pro.html 
   * HyperTerminal does, too.    * HyperTerminal does, too. 
   If HyperTerminal doesn't work properly with 4E4th, check    If HyperTerminal doesn't work properly with 4E4th, check 
Zeile 54: Zeile 52:
   Only "Wrap lines that exceed terminal width" may be checked.    Only "Wrap lines that exceed terminal width" may be checked. 
   Line Feeds and Echo are not allowed.    Line Feeds and Echo are not allowed. 
-  * 4E4th-Terminal is a special Terminal Emulation for Forth Applications. Will be launched later+  * 4E4th-IDE is a special Terminal Emulation for Forth Applications. http://www.4e4th-ide.org/ 
  
 == macOSX == == macOSX ==
Zeile 79: Zeile 77:
 == Linux ==  == Linux == 
  
-Seems to be working without special drivers. Disconnecting and reconnecting USB is an almost foolproof way to make the connection. Note: on most GNU/Linux distributions ''screen'' is installed by default while ''kermit'' requires manual installation.+Seems to be working without special drivers. Disconnecting and reconnecting USB is an almost foolproof way to set the serial communication connection.  Note: on most GNU/Linux distributions ''screen'' is installed by default while ''kermit'' requires manual installation.
  
 Tested on: Tested on:
Zeile 102: Zeile 100:
 ===== Starting 4E4th =====  ===== Starting 4E4th ===== 
  
-Start with connecting the LaunchPad to your PC or laptop, using the USB cable out of the LaunchPad box.  +As first step start with connecting the LaunchPad to your PC or laptop, using the USB cable out of the LaunchPad box. This USB connection is at the same time the LaunchPad's power supply and as well the serial Interface to your Terminal emulator.
-The USB connection is the LaunchPad's power supply and the serial Interface to your Terminal emulator. +
  
 As soon as the LaunchPad is connected, Forth is started (both LEDs are switched on) - assuming your Laptop or PC is switched on. For testing and to start Forth again, use the LaunchPad's Reset button.  As soon as the LaunchPad is connected, Forth is started (both LEDs are switched on) - assuming your Laptop or PC is switched on. For testing and to start Forth again, use the LaunchPad's Reset button. 
  
-4E4th starts with its latest saved status. To get back to the status at delivery, push and hold LaunchPad's button S2 and push the Reset button while holding S2. ReFlashing is done over the USB cable, too. +4E4th starts with its latest saved status. To get back to the status at delivery, push and hold LaunchPad's button S2 and push the Reset button while holding S2. Reflashing is done over the USB cable, too. 
  
 //Attention:  //Attention: 
Zeile 117: Zeile 114:
      
  
-===== Communication with the 4E4th ===== +===== Communication with 4E4th ===== 
  
  
Zeile 125: Zeile 122:
 To become familiar with 4E4th, try this:  To become familiar with 4E4th, try this: 
 Type    Type   
-      red cclr +      red cclrb 
-      red cset  +      red csetb  
 or    or   
-      green cclr  +      green cclrb  
-      green cset+      green csetb
 and <Enter>, of course. The red or the green LED will be lit, respectively.  and <Enter>, of course. The red or the green LED will be lit, respectively. 
  
 Type  Type 
       11 22 33        11 22 33 
-The answer "oktells you that these numbers are on the data stack now - as soon as you have pressed <Enter>+The answer ''ok'' tells you that these numbers are on the data stack now - as soon as you have pressed <Enter>
  
-Type      .S  +Type ''.s'' (a dot and character "s") and <Enter>
-(a dot and a capital "S") and <Enter>+4E4th will show the typed values which are on the stack.   
-4E4th answers with the quantity of the typed values and shows the typed values which are on the stack.  +You may repeat the ''.S'' command several times. You should always get the same result. 
-You may repeat the .S command several times. You should always get the same result. +
  
-4E4th is capable of different number bases. 4E4th starts in DECIMAL mode and then accepts only decimal numbers. To make Embedded Systems programming easier, you may switch to HEX mode, and 4E4th only accepts hex numbers then. Typing DECIMAL switches back to decimal mode. +4E4th is capable of different number bases. 4E4th starts in DECIMAL mode and then accepts only decimal numbers. To make Embedded Systems programming easier, you may switch to HEX mode, and 4E4th only accepts hex numbers then. Typing DECIMAL switches back to decimal mode. Using hex numbers A B C D E F in decimal mode will produce an error message.
  
-Here another Test.  +Here another Test. Type this text – and end with <enter>:
-Type this text:+
  
-: TEST ." I am here " ; +  : TEST ." I am here " ; 
  
-4E4th answers with "ok", as usual, to show that your input is accepted.  +4E4th answers with ok as usual, to show that your input has been accepted.  
-You just created a new command, and this command has just been added to the 4E4th system. +You have just created a new command, and this command has as well been added to the 4E4th system. 
  
 Now type  Now type 
Zeile 156: Zeile 151:
  
 and look what this command does. You just learned that for creating of a new command you first  and look what this command does. You just learned that for creating of a new command you first 
-type a colon ":", and at the end of this definition you type a semicolon ";"+type a colon '':'', and at the end of this definition you type a semicolon '';''
  
-More examples you will find in Forth Tutorials - look at "Starting Forth online edition" which you will find at http://www.forth.com/starting-forth+See chapter 11a, b and c in A Start With Forth https://wiki.forth-ev.de/doku.php/en:projects:a-start-with-forth:start0
  
-//All Forth words in the examples are written in CAPITAL letters. The 4e4th does not care whether you type CAPITAL or small letters uses. This behavior is called case insensitive. You can toggle this behavior: With ''0 CAPS !'' 4et4h will be case sensitive, and with ''-1 CAPS !'' 4e4th will be case insensitive.// 

+More examples you will find in Forth Tutorials - for example look at the classic "Starting Forth online edition" which you will find at http://www.forth.com/starting-forth/  
 + 
 +//All Forth words in the examples are written in CAPITAL letters. The 4e4th does not care whether you type CAPITAL or small letters uses. This behavior is called case insensitive. // 


  
 ===== Saving your Program =====  ===== Saving your Program ===== 
Zeile 169: Zeile 166:
 It is possible to upload and save the MCUs image using a Programmer.  It is possible to upload and save the MCUs image using a Programmer. 
  
-To remove your program, type WIPE. Be careful. This is a powerful instruction. When typing WIPE, your work of may be several hours will be gone. That's why 4E4th-Terminal logs all your typing, and you will be able to download your work again. +To remove your program, type WIPE. Be careful. This is a powerful instruction. When typing WIPE, your work of may be several hours will be gone. That's why 4E4th-IDE logs all your typing, and you will be able to download your work again. 
  
 Another way to remove your programs is by pressing the LaunchPad's S2 button and then the RESET button while holding S2.  Another way to remove your programs is by pressing the LaunchPad's S2 button and then the RESET button while holding S2. 
Zeile 178: Zeile 175:
 ===== Troubleshooting ===== ===== Troubleshooting =====
  
-If nothing is working anymore, the ultima ratio is to ReFLASH the MCU.+If 4e4th staopped working completely, the ultima ratio is to ReFLASH the MCU.
  
-Having Windows, start the Programmer and the same source again, using the FET-Pro430 and AUTOPROG. Jumpers stay as they are.+Assuming Windows, start the Programmer and the same source again, using the FET-Pro430 and AUTOPROG. Jumpers stay as they are.
  
 The Programmer uses Port USB HID00xx to connect to LaunchPad using the same USB Port the Terminal uses. The Terminal may stay connected. The Programmer uses Port USB HID00xx to connect to LaunchPad using the same USB Port the Terminal uses. The Terminal may stay connected.
Zeile 189: Zeile 186:
 ===== Making your own Forth Kernel ===== ===== Making your own Forth Kernel =====
  
-In case you like to edit the 4E4th kernel, start this project in IAR "kickstart"+In case you like to edit the 4E4th kernel, clone this project https://github.com/mikalus/4e4th05a.
-http://www.ti.com/tool/iar-kickstart+
  
-Get the actual CF430G2553 Project - the base of 4E4th - from the Repository http://www.forth-ev.de/repos/CF430G2553/  +There is a readme.430 file and some other documentation which tells you how to get your own special Forth done. 
-There is a readme.430 file which tells you how to get your Forth done by yourself+
  
-This webpage contains  all the code you need to generate your Forth by using IAR's "kickstart",  +Github contains all the code and programs you need to generate your Forth. The binary image 4e4th05a.hex you can directly load into the LaunchPad's MSP430G2553 chip. The *.asm files hold the complete 4E4th source code.
-the binary image is 4e4th.a43, you can load it into the LaunchPad's MSP430G2553 directly +
-The *.s43 files hold the complete 4E4th source code. +
  
  
Zeile 203: Zeile 196:
  
  Memory   Memory 
-  SAVE ( -- )  Saves the typed additions. Stacks unchanged. Saves actual uarea. +  SAVE ( -- )  Saves the typed additions. Stacks are unchanged. Saves actual uarea. Defines as well the last definition for autostart
   WIPE ( -- )  Back to original status. Stacks unchanged. uarea back to original.    WIPE ( -- )  Back to original status. Stacks unchanged. uarea back to original. 
-  APP  ( -- adr ) User area execution token address for an Application. Default APP is NOOP.+
  
  Peripherals - Port1 and Port2    Peripherals - Port1 and Port2  
-  cset          adr --                    set port pins at address with mask  +  csetb          addr --                    set port pins at address with mask  
-  cclr          adr --                    clear port pins at address with mask  +  cclrb          addr --                    clear port pins at address with mask  
-  red           -- m adr                    red LED mask and port1 address  +  red           -- m addr                    red LED mask and port1 address  
-  green         -- m adr                    green LED mask and port1 address+  green         -- m addr                    green LED mask and port1 address
   S?            -- f                        test button S2, true when pressed    S?            -- f                        test button S2, true when pressed 
  
  
-The complete 4E4th vocabulary you will find here:  +The complete 4E4th vocabulary you will find in the Glossary.pdf 
-http://www.forth-ev.de/repos/CF430G2553/Glossary.pdf +
  
 == How can I switch a LED on and off again? == == How can I switch a LED on and off again? ==
Zeile 225: Zeile 217:
   P1.6 = LED2 = green   P1.6 = LED2 = green
      
-The Forth words ''cset'' and ''cclr'' are working bit wise. ''cset'' needs a Bit-Mask and address on stack, ''cclr'', too.  +The Forth words ''csetb'' and ''cclrb'' are working bit wise. ''csetb'' needs a bit-mask and address on stack, ''cclrb'', too.  
-Such a Mask is a Byte with the needed Bits set. The Forth Words ''red'' and ''green'' put such masks onto data stack along with an address to work on:+Such a mask is a byte with the needed bits set. The Forth Words ''red'' and ''green'' put such masks onto data stack along with an address to work on:
  
   red     0x01 = 00000001   0x21 = Port1 output register   red     0x01 = 00000001   0x21 = Port1 output register
Zeile 234: Zeile 226:
 Anyway, here are the commands: Anyway, here are the commands:
  
-  red cclr     --> turns red LED off. +  red cclrb     --> turns red LED off. 
-  green cclr   --> turns green LED off.  +  green cclrb   --> turns green LED off.  
-  red cset     --> turns red LED on. +  red csetb     --> turns red LED on. 
-  green cset   --> turns green LED on.+  green csetb   --> turns green LED on.
  
 Next step: Blinking the LEDs! Next step: Blinking the LEDs!
Zeile 243: Zeile 235:
   DECIMAL   DECIMAL
   : blink BEGIN    : blink BEGIN 
-    red cset green cclr 100 MS +    red csetb green cclrb 100 MS 
-    red cclr green cset 100 MS+    red cclrb green csetb 100 MS
     KEY? UNTIL ;      KEY? UNTIL ; 
  
 This is a simple and a complete program. To make your LaunchPad running this program when switched on again, type This is a simple and a complete program. To make your LaunchPad running this program when switched on again, type
  
-  ' blink APP ! SAVE+  SAVE
      
-It is good habit to have an exit from your app back to Forth. Otherwise a WIPE is due in case you like to interact with 4e4th again: press S2+reset. +It is good practice to have an exit from your app back to Forth. Otherwise a WIPE is due in case you like to interact with 4e4th again: press S2 + reset buttons
    
 We hope we soon will have a nice 4E4th collection of [[projects:4e4th:4e4th:start:beispiele|example programms]] and you are allowed to add your examples there to be used by the 4E4th community. We hope we soon will have a nice 4E4th collection of [[projects:4e4th:4e4th:start:beispiele|example programms]] and you are allowed to add your examples there to be used by the 4E4th community.
Zeile 260: Zeile 252:
  
 ====== Requirements ====== ====== Requirements ======
-To communicate with the LaunchPad's MCU, you need a Terminal or a Terminal Emulator on your PC. It's good to have a Programmer Softwaretoo, to reFLASH the chip. All these programs need the correct drivers for the LaunchPad. These drivers must have been installed at your Operating System first.+To communicate with the LaunchPad's MCU, you need a Terminal or a Terminal Emulator on your PC. It is important to have a Programmer Software too, to reFLASH the chip. All these programs need the correct drivers for the LaunchPad. These drivers must have been installed in your Operating System first.
  
 Ti's engineers assume that you program your LaunchPad using C or Assembler. Therefore TI offers so called Integrated Development Environment (IDE) software - the IAR "Kickstart" and Code Composer are downloadable as free but limited versions. The free Code Composer can be used for free for a limited time, the free IAR Kickstart is free only for projects up to 4k. For now (March 2012) there is no special free TI-IDE. Ti's engineers assume that you program your LaunchPad using C or Assembler. Therefore TI offers so called Integrated Development Environment (IDE) software - the IAR "Kickstart" and Code Composer are downloadable as free but limited versions. The free Code Composer can be used for free for a limited time, the free IAR Kickstart is free only for projects up to 4k. For now (March 2012) there is no special free TI-IDE.
  
-But there is an odd loopholecomplete projects may be developed with Kickstart, and programmed with another program.+We used Naken Assembler instead. https://www.mikekohn.net/micro/naken_asm.php
  
  
Zeile 276: Zeile 268:
 Start LaunchPad_Driver.exe (mouse double click). Start LaunchPad_Driver.exe (mouse double click).
 There seems to be no result, but after this action LaunchPad will be recognized and is ready to go. This works for 32 bit  and 64 bit systems. There seems to be no result, but after this action LaunchPad will be recognized and is ready to go. This works for 32 bit  and 64 bit systems.
- 
-With this little action you avoid to install IAR's "Kickstart". 
  
 Connect your LaunchPad to USB (remember: connect cable to LaunchPad first), you should get a ready to go message. Connect your LaunchPad to USB (remember: connect cable to LaunchPad first), you should get a ready to go message.
Zeile 325: Zeile 315:
 ===== Programmer ===== ===== Programmer =====
  
-You find the 4E4th binary image at the Forth-Gesellschaft Repository: http://www.forth-ev.de/repos/, see section Bootstrap Loading for a link. It has to be loaded into the MCU using a suitable programmer.+You find the 4E4th binary image at GitHub, see section Bootstrap Loading for a link. It has to be loaded into the MCU using a suitable programmer.
  
 == Windows XP and Windows 7 == == Windows XP and Windows 7 ==
Zeile 375: Zeile 365:
 There is a group which is collecting tools: There is a group which is collecting tools:
 http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_Mac_OS_X http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_Mac_OS_X
 +
 ===== Source Upload via Terminal ===== ===== Source Upload via Terminal =====
  
Zeile 471: Zeile 462:
            
 


If I remove the LaunchPad from the USB while TeraTerm still is running, the connection of the two remains disturbed. Thus Hotplug does not go. So far it only helps to close TeraTerm. Afterwards (!) disconnect LaunchPad from USB, wait for the sound sequence, connect again, and wait for the sound sequence again, then open the terminal. 

When using the FET-Pro430 Programmer, follow those instructions, too. I had good experiences to connect the terminal first and then start the Programmer. The MCU can be flashed even when terminal is active. mk  


If I remove the LaunchPad from the USB while TeraTerm still is running, the connection of the two remains disturbed. Thus Hotplug does not go. So far it only helps to close TeraTerm. Afterwards (!) disconnect LaunchPad from USB, wait for the sound sequence, connect again, and wait for the sound sequence again, then open the terminal. 

When using the FET-Pro430 Programmer, follow those instructions, too. I had good experiences to connect the terminal first and then start the Programmer. The MCU can be flashed even when terminal is active. mk 
 +
 +Looks like the newest TeraTerm can hot plug the Launchpad. mk 20180510
  
 ====== Acknowledgements ====== ====== Acknowledgements ======
Zeile 476: Zeile 469:
 Many thanks to the groundbreaking work creating CamelForth done by Brad Rodriguez.  Many thanks to the groundbreaking work creating CamelForth done by Brad Rodriguez. 
 Thanks to Dirk Bruehl for his untiring and altruistic support of the 4E4th Project, by ordering the appropriate hardware and encouraging with many hints and ideas to go on until CamelForth was running on the LaunchPad.  Thanks to Dirk Bruehl for his untiring and altruistic support of the 4E4th Project, by ordering the appropriate hardware and encouraging with many hints and ideas to go on until CamelForth was running on the LaunchPad. 
-mk 03-14-2012 +mk 20120314  
 + 
 +Thank you again, Brad Rodriguez, for transferring CamelForth to Naken Assembler! And thanks to Jürgen Pintaske, who persuaded me to transfer 4e4th to the Naken Assembler. mk 20180512
  
 ====== Links ====== ====== Links ======
Zeile 490: Zeile 485:
 http://www.ti.com/product/msp430g2553 http://www.ti.com/product/msp430g2553
  
-(mk20121224)+revisions mk20121224 mk20180512 mk20180513 
 + 
 +4e4th05a May 2018
en/projects/4e4th/start.1526117980.txt.gz · Zuletzt geändert: 2018-05-12 11:39 von mka