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-06-10 18:22] – [An important difference between the Arduino IDE and Forth] mkaprojects:430eforth:start [2022-01-14 04:49] (aktuell) – [TI Launchpad] mka
Zeile 32: 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 122: Zeile 124:
 ===== 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**
projects/430eforth/start.1591806178.txt.gz · Zuletzt geändert: 2020-06-10 18:22 von mka