Download presentation
Presentation is loading. Please wait.
1
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell WHYP -- An Extensible Language Chapter 4
2
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell WHYP--An Extensible Language A Closer Look at WHYP Defining New WHYP Words Variables Constants EEPROM
3
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell A Closer Look at WHYP
4
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell WHYP--An Extensible Language A Closer Look at WHYP Defining New WHYP Words Variables Constants EEPROM
5
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Colon Definitions : --- --- --- --- ; : squared ( n -- n 2 ) DUP * ; 16 4104 JSR DUP 16 4337 JSR * 3D RTS
6
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell
7
WHYP12.CFG
8
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell SEE and SHOW see squared squared DUP * ; ok show squared squared 16 41 4 16 43 37 3D ok see cubed cubed DUP squared * ; ok show cubed cubed 16 41 4 16 50 0 16 43 37 3D ok
9
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Single Stepping ok 5 step squared squared DUP * ; S:[1] 5 R:[0] DUP S:[2] 5 5 R:[0] * S:[1] 19 R:[0] Exit single step ok. 25 ok
10
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Single Stepping ok 5 step cubed cubed DUP squared * ; S:[1] 5 R:[0] DUP S:[2] 5 5 R:[0] squared S:[2] 5 19 R:[0] * S:[1] 7D R:[0] Exit single step ok. 125 ok
11
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Loading WHYP words from a file square.whp
12
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Loading WHYP words from a file
13
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell CR and." : bar( -- )\ print a bar CR." ******" ; : post( -- )\ print a post CR." *" CR." *" ;
14
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell CR and." : C( -- )\ print a C bar post bar cr ; : E( -- )\ print an E bar post bar cr;
15
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell WHYP--An Extensible Language A Closer Look at WHYP Defining New WHYP Words Variables Constants EEPROM
16
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Variables VARIABLEmy.name my.name. 800 ok 16 451EJSR (LIT)0800 3DRTS Stores the following code at tdp. my.name executes this code.
17
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Variables Variables are stored in memory at address vdp. The value of vdp can be changed by pressing F8. VHERE puts the current value of vdp on the data stack.
18
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Fetch and Store
19
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Examples of @ and ! C:\WHYP\WHYP12>whyp12 Using WHYP12.HED Communicating with COM1 68HC12 WHYP12 - Version 4.6 Press or type BYE to exit ok VARIABLEmy.name ok hex ok my.name. 800 ok 7my.name ! ok 800 10 dump 0 1 2 3 4 5 6 7 8 9 A B C D E F 0800 00 07 86 80 52 00 80 02 09 00 28 18 90 00 83 00..R. (.. ok my.name @. 7 ok 12 my.name c! ok 34 my.name 1+ c! ok 800 10 dump 0 1 2 3 4 5 6 7 8 9 A B C D E F 0800 12 34 86 80 52 00 80 02 09 00 28 18 90 00 83 00 4..R. (.. ok my.name c@. 12 ok my.name 1+ c@. 34 ok
20
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 code for !, @, C!, and C@
21
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Plus-store 1 my.name +!
22
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell 68HC12 code for 2!, and 2@
23
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell System Variables: SP0, RP0
24
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Arrays VARIABLE my.array 8 VALLOT my.array 3 2* + @. will print the value of my.array[3]
25
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Arrays VARIABLE my.array 8 VALLOT my.array 3 2* + @. will print the value of my.array[3] : A@ ( ix addr -- n ) SWAP 2* + @ ; 3 my.array A@. Chap 13: 3 my.array @. 1234 3 my.array !
26
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell WHYP--An Extensible Language A Closer Look at WHYP Defining New WHYP Words Variables Constants EEPROM
27
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Constants 25 CONSTANT quarter 16 451EJSR (LIT)0019 3DRTS Stores the following code at tdp. quarter executes this code. quarter. will print the value 25 on the screen.
28
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Examples of using CONSTANTs
29
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Tables CREATE table
30
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell HEX CREATE table 5, 8, 23,
31
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Example of creating a table
32
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell HEX CREATE table 5 C, 8 C, 23 C,
33
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell EEPROM MC68HC812A4 –4 Kbytes of EEPROM –$1000 - 1FFF MC68HC912B32 –768 bytes of EEPROM –$0D00 - $0FFF
34
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell EEPROM Initial Position Register
35
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell MC68HC812A4 EEPROM Block Protect Register
36
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell MC68HC912B32 EEPROM Block Protect Register In WHYP12: CLR EEPROT
37
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell The EEPROM Control Register
38
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Erasing an EEPROM Byte
39
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Delay 10 Milliseconds
40
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Erase Entire EEPROM
41
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Program an EEPROM Byte
42
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell
43
Examples of using EEPROM memory access words
44
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell
45
square.hed
46
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell whyp12.cfg
47
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.