Benutzer-Werkzeuge

Webseiten-Werkzeuge


projects:430eforth:start

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
projects:430eforth:start [2020-05-31 19:15] – [An important difference between the Arduino IDE and Forth] juergenukprojects:430eforth:start [2022-01-14 04:49] (aktuell) – [TI Launchpad] mka
Zeile 1: Zeile 1:
-====== eForth  - a small Forth by Dr. Chen-Hanson Ting ======+====== eForth  - a small Forth in many incarnations   by Dr. Chen-Hanson Ting ======
  
-There are many eForth variants that Ting did over the years. In the past the TI MSP430 was a good target, as the TI Launchpad was a low-cost option with included programmer.+There are many eForth variants that Ting developed  over the years.  
 +In the past the TI MSP430 was a good target, as the TI Launchpad was a low-cost option with included programmer.
  
  
Zeile 10: Zeile 11:
 {{ :projects:430eforth:eforth_appendix_wordsv3_9.pdf |Appendix}}- Die 430eForth Kommandos\\ {{ :projects:430eforth:eforth_appendix_wordsv3_9.pdf |Appendix}}- Die 430eForth Kommandos\\
  
-Here the documentation of a complete Forth on one page - ok it is a large one, but there is a link to print it as normal A4 pages +Here you can find the documentation of a complete Forth on one page  
 +- ok it is a large one, e.g.A1 size, but there is a link to print it as normal A4 pages 
 https://wiki.forth-ev.de/doku.php/en:projects:430eforth:start https://wiki.forth-ev.de/doku.php/en:projects:430eforth:start
  
Zeile 30: Zeile 32:
 {{ :projects:430eforth:430eforth-ide.zip |430eforth-ide}} - die Hex-Datei des eForth ist in der IDE((Die 430eForth-IDE ist eine angepasste Reimplementation der 4e4th-IDE von Dirk Brühl -  http://www.somersetweb.com/430eForth/430eForth-IDE.zip )) enthalten, um mit dem [[http://www.ti.com/tool/MSP-EXP430G2|TI Launchpad]] zu programmieren\\ {{ :projects:430eforth:430eforth-ide.zip |430eforth-ide}} - die Hex-Datei des eForth ist in der IDE((Die 430eForth-IDE ist eine angepasste Reimplementation der 4e4th-IDE von Dirk Brühl -  http://www.somersetweb.com/430eForth/430eForth-IDE.zip )) enthalten, um mit dem [[http://www.ti.com/tool/MSP-EXP430G2|TI Launchpad]] zu programmieren\\
 {{ :projects:430eforth:eforth_lessons.pdf |Lektionen}} - Beispiele in eForth 430G2553((eForth ist //case sensitive//, alle Forth Worte sind in GROSSCHREIBUNG. ))\\ {{ :projects:430eforth:eforth_lessons.pdf |Lektionen}} - Beispiele in eForth 430G2553((eForth ist //case sensitive//, alle Forth Worte sind in GROSSCHREIBUNG. ))\\
 +
 +Und hier ist Ting's Quelle: {{ :projects:430eforth:eforth.zip}}
  
  
Zeile 41: Zeile 45:
 **( This part is in English, as the link to this location is shared )** **( This part is in English, as the link to this location is shared )**
  
-How can you simply carry out a few Forth instructions?\\ +===== How can you simply carry out a few Forth instructions? ===== 
-And understand how Forth works?\\ + 
-OK, the execution of commands online without additional hardware has already been shown elsewhere in this Wiki, in the **A Start With Forth** documentation,  especially in chapters 4, 5, 6 and 7:\\ +And understand how Forth works? 
-: https://wiki.forth-ev.de/doku.php/projects:a-start-with-forth:start0\\ + 
-and in English\\ +OK, the execution of commands online without additional hardware has already been shown elsewhere in this Wiki, in the **A Start With Forth** documentation,  especially in chapters 4, 5, 6 and 7;\\ 
-https://wiki.forth-ev.de/doku.php/en:projects:a-start-with-forth:start0#a_start_with_forth_-_many_c_hapters_here_and_as_ebook_and_print_book\\+in [[projects:a-start-with-forth:start0|German]] and in  
 +[[en:projects:a-start-with-forth:start0#a_start_with_forth_-_many_c_hapters_here_and_as_ebook_and_print_book|English]].
  
  
Zeile 57: Zeile 62:
 But we recently discovered this special eForth version from Ting, which unfortunately had been hidden very well until now. But we recently discovered this special eForth version from Ting, which unfortunately had been hidden very well until now.
  
-Only this Arduino-specific sketch has to be downloaded using the link above and unpacked again. Upload it via the Aruino IDE and you're ready to program in Forth.+Only this Arduino-specific sketch has to be downloaded using the link above and unpacked again.  
 +Upload it via the Aruino IDE and you're ready to program in Forth.  
 +OK you have to get the Terminal software ready as well, but this is easy - all in the next PDF. 
 + 
 +We want to make it easy for anybody to try it out. 
 + 
 +===== The "39 Steps" to see HELLO WORLD on your display ===== 
 + 
 + 
 +So, Juergen sat down and recorded all of the steps necessery,  
 +from switching on the UNO/nano to displaying the usual  
 +**HELLO WORLD.** It turns out to take  
 +{{how_to_get_started_and_control_some_leds_in_forth_v4_a4.pdf|39 Steps}} 
 + 
 +And you will end by programming the ''HELLO WORLD'' and see the result: 
 +{{publication2.jpg}} 
 + 
 +[[https://uk.banggood.com/Geekcreit-ATmega328P-Nano-V3-Controller-Board-Improved-Version-Module-Development-Board-p-940937.html?gpla=1&gmcCountry=GB&currency=GBP&createTmp=1&utm_source=googleshopping&utm_medium=cpc_bgcs&utm_content=lijing&utm_campaign=pla-gbg-rm-all-purchase-pc&ad_id=323612825005&gclid=Cj0KCQjw-_j1BRDkARIsAJcfmTHNbV23Sl9zuJK9eh8oCP9oIJHQtR3dcUMdgcX3EYMRVgHzdnaJYtYaAiUTEALw_wcB&cur_warehouse=CN|Here a link to a low cost  ATmega328P Nano V3 Development Board]] as example (Geekcreit) if you need one.
  
 We soldered the headers on a nano pointing downwards,  We soldered the headers on a nano pointing downwards, 
-and the Arduino nano then fits wonderfully into a solderless breadboard for experiments.+and the Arduino nano then fits wonderfully onto a solderless breadboard for experiments.
  
 {{arduino_nano_on_breadboard.jpg?250}} {{arduino_nano_on_breadboard.jpg?250}}
  
-For example here a link to a low cost  ATmega328P Nano V3 Development Board as example (Geekcreit) if you ned one: 
-**https://uk.banggood.com/Geekcreit-ATmega328P-Nano-V3-Controller-Board-Improved-Version-Module-Development-Board-p-940937.html?gpla=1&gmcCountry=GB&currency=GBP&createTmp=1&utm_source=googleshopping&utm_medium=cpc_bgcs&utm_content=lijing&utm_campaign=pla-gbg-rm-all-purchase-pc&ad_id=323612825005&gclid=Cj0KCQjw-_j1BRDkARIsAJcfmTHNbV23Sl9zuJK9eh8oCP9oIJHQtR3dcUMdgcX3EYMRVgHzdnaJYtYaAiUTEALw_wcB&cur_warehouse=CN 
-** 
  
 The eForth is loaded as {{projects:430eforth:eforth328.zip| Arduino Sketch (C Sourcecode)}}, similar to a text file, then compiled via the Arduino IDE and uploaded into the board. The eForth is loaded as {{projects:430eforth:eforth328.zip| Arduino Sketch (C Sourcecode)}}, similar to a text file, then compiled via the Arduino IDE and uploaded into the board.
Zeile 79: Zeile 98:
  
 Download and install a terminal program, if you do not have one already, Download and install a terminal program, if you do not have one already,
-e.g. Teraterm or termite,+e.g. [[https://ttssh2.osdn.jp/index.html.en|Teraterm]] or termite,
 and then you are ready to go.  and then you are ready to go. 
 Set to 115k baud rate. Set to 115k baud rate.
  
-** https://ttssh2.osdn.jp/index.html.en ** 
  
 Enter (**CR)**   and you see **0 0 0 0 ok>** Enter (**CR)**   and you see **0 0 0 0 ok>**
Zeile 101: Zeile 119:
  
 {{some_examples_part_1.pdf|Here are some examples.}} {{some_examples_part_1.pdf|Here are some examples.}}
- +   
-**And the additional information  in the book**    +[[https://www.amazon.co.uk/dp/B088P1CW83/ref=sr_1_fkmr0_2?dchild=1&keywords=sforth+as+Arduino+Sketch&qid=1589713127&s=books&sr=1-2-fkmr0|And the additional information in the book]].
-https://www.amazon.co.uk/dp/B088P1CW83/ref=sr_1_fkmr0_2?dchild=1&keywords=sforth+as+Arduino+Sketch&qid=1589713127&s=books&sr=1-2-fkmr0+
  
 ===== Some small Examples ===== ===== Some small Examples =====
  
-The terminal display shows +The terminal display shows:  
 +  0  0  0  0  ok>   
 +These four zeros show the top 4 values of the Data stack.\\
  
-0  0  0  0  ok These four zeros show the top 4 values of the Data stack.  +With((<CRPress Carriage Return Button (enter))): 
-with +  <CR> 
-(CR) +  <CR> 
-(CR) +  <CR> 
-(CR) +  <CR> 
-4 CR) +it changes to: 
-it changes to +  1  2  3  4  ok>
-1  2  3  4  ok> +
-now try  +
-. (CR) +
-. (CR) +
-. (CR) +
-. (CR) +
-and the 4 values are displayed and disappear from the stack and back to 0  0  0  0  ok>+
  
  
-**The usual HELLO WORLD   we can achieve like this:**+Now try  
 +  . <CR> 
 +  . <CR> 
 +  . <CR> 
 +  . <CR> 
 +and the 4 values are displayed and disappear from the stack which is back to 
 +  0  0  0  0  ok>
  
-Define a new Forth Word 
-:   HELLO1  ." HELLO WORLD " ;  (CR) 
-:  start a new Word definition 
-HELLO1 the name of the new Word 
-."  Start a text definition 
-HELLO WORLD  the text to be printed 
-  Marker for the end of the text 
-; end of new Word definition 
  
-And try it out:+==== The usual HELLO WORLD   we can achieve like this====
  
-hello1 (CR)HELLO WORLD 
  
-and format the output bit:+Define new Forth Word: 
 +  :   HELLO1  ." HELLO WORLD " ;  <CR> 
 +'':'' starts a new Word definition, ''HELLO1'' is the name of the new Word. 
 +'' ." ''  starts a text definition. 
 +''HELLO WORLD'' is  the text to be printed. 
 +And ''"'' marks the end of the text. 
 +Finaly '';'' ends new Word definition.
  
-:  HELLO2  CR  CR  ." HELLO WORLD "  CR ;  (CR) +And try it out:
-a few additional CRs will make it better readable+
  
-hello2 (CR)+  hello1 <CR>  HELLO WORLD
  
-HELLO WORLD+and format the output a bit. A few additional CRs will make it better readable: 
 +  :  HELLO2  CR  CR  ." HELLO WORLD  CR ;  <CR> 
 +   
 +  hello2 <CR> 
 +   
 +  HELLO WORLD 
 + 
  
  
 +==== And now let us control one Bit in the IO. Here the on-board LED ====
  
-**And now let us control one Bit in the IO. Here the on-board LED** +  20 24 POKE <CR> 
- +  Will set bit 5 of the port to OUTPUT in the Data Direction Register    0  1  0    0  0  0  0 
- +  \ 20 is the data bit to be stored, and 24 is the DDR Register address in hex 
-20 24 POKE (CR) +   
-will set bit 5 of the port to OUTPUT in the Data Direction Register    0  1  0    0  0  0  0 +  20 25 POKE (CR) 
-\ 20 is the data bit to be stored, and 24 is the DDR Register address in hex +  \  Will set Bit 5 in the OUTPUT Register to HIGH  - LED is on            0  0  1  0    0  0  0  0  
- +  \  20 is the OUTPUT bit to be stored and 25 in hex is the Output Port Register 
-20 25 POKE (CR) +   
-\  Will set Bit 5 in the OUTPUT Register to HIGH  - LED is on            0  0  1  0    0  0  0  0  +  00 25 POKE (CR)  
-\  20 is the OUTPUT bit to be stored and 25 in hex is the Output Port Register +  \  Will set Bit 5 in the OUTPUT Register to LOW  - LED is off 
- +  \  here 00 is stored in the Output Register
-00 25 POKE (CR)  +
-\  Will set Bit 5 in the OUTPUT Register to LOW  - LED is off +
-\  here 00 is stored in the Output Register +
- +
-The data sheet I used is http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf+
  
 +I used this [[http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf
 +|ATmega328P Datasheet]]. 
 And for now only page 280 is important, which shows the addresses for the ports,  And for now only page 280 is important, which shows the addresses for the ports, 
-especially here now Port B: \\ +especially here now those two Port-B-addresses
-24 HEX  is the DDR (DDR = Data Direction Register) to set bits to OUTPUT and  +  *24 HEX is the DDR (DDR = Data Direction Register) to set bits to OUTPUT and  
-25 HEX for the OUTPUT Register to set bits to 1 or 0  HIGH or LOW.+  *25 HEX for the OUTPUT Register to set bits to 1 or 0  HIGH or LOW.
  
 **And the relevant file of these examples** **And the relevant file of these examples**
Zeile 183: Zeile 201:
 With Forth we can poke around in all internals using the Forth commands, read and write IOs - even mess up the CPU – so please be careful as you might have to restart the Forth and loose the work done before. With Forth we can poke around in all internals using the Forth commands, read and write IOs - even mess up the CPU – so please be careful as you might have to restart the Forth and loose the work done before.
 And this is done using only 2 commands, added especially to this eForth version: And this is done using only 2 commands, added especially to this eForth version:
-**PEEK**   Read the contents at memory location  xx +  *PEEK  -  Read the contents at memory location  xx 
-**POKE**   Overwrite contents at memory location xx with new data yy.+  *POKE  -  Overwrite contents at memory location xx with new data yy.
  
 And if you have now licked blood and have the appropriate know-how and tools, you can flash in the extended version of this eForth - but then the bootloader will be overwritten. And if you have now licked blood and have the appropriate know-how and tools, you can flash in the extended version of this eForth - but then the bootloader will be overwritten.
Zeile 197: Zeile 215:
 but then you have to find a way or sombody to flash the hex file - overwriting the Bootloader permanently. but then you have to find a way or sombody to flash the hex file - overwriting the Bootloader permanently.
 http://forth.org/OffeteStore/2159_328eforth.zip http://forth.org/OffeteStore/2159_328eforth.zip
-or as well book at https://www.amazon.co.uk/gp/product/1726868478/ref=dbs_a_def_rwt_bibl_vppi_i21+ 
 +or as well as book at  
 +[[https://www.amazon.co.uk/gp/product/1726868478/ref=dbs_a_def_rwt_bibl_vppi_i21|amazon]].
 \\ \\
 \\ \\
  
-//This page is work in progress! Last change and more to come as time allows: 04/05/_2020// +//This page is work in progress! Last change and more to come as time allows: 05/05/_2020  now 08/06/2020 // 
  
  
  
  
projects/430eforth/start.1590945328.txt.gz · Zuletzt geändert: 2020-05-31 19:15 von juergenuk