Difference: RaspiElfKeypad (1 vs. 12)

Revision 122018-12-16 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 18 to 18
 

Hardware

Added:
>
>

Pics

 
gal 2000 G84-4700 2 persp.jpg
Cherry Keypad G84-4700, original key caps
hex-keypad.jpg
Hex Keypad
keypad-display.jpg
Keypad and display
Added:
>
>

elfdisplay (COSMICOS II) Function Keys

 
Short Mode Key Keycode Notes
IN Input I, [CR] 96 Increment address, in LOAD mode causes the data byte shown to be written to the address shown
LD Load L, + 78 Goes to the LOAD mode. In the LOAD mode goes to the address entry mode
Line: 31 to 34
  The modes are shown in the display by the decimal points.
Changed:
<
<

RCA COSMAC Microterminal

>
>

Some Other COSMAC Keypads

RCA COSMAC Microterminal

  RCA COSMAC Microterminal
Line: 44 to 48
 
$P
Start Addressed Program: starts program execution at the location shown in the address display.
CA
Clear Address: clears (resets) the address display to 0000.
Changed:
<
<

QUEST Super Elf

>
>

QUEST Super Elf

 
I
Input
L
Load mode
Line: 55 to 59
 
S
Single step
P
Protect memory
Changed:
<
<

Elf 2000

>
>

Elf 2000

 
R
RESET
G
RUN

Revision 112018-05-31 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 6 to 6
  title="!RaspiElf Keypad" titlestyle="color:#F00000;" }%
Changed:
<
<
Intro
>
>
Intro
 The Elf Membership Card has 8 data switches, 3 mode switches, and a IN push button on its front panel. The data is displayed on 8 LEDs (binary). It is a error prone but educational task to "switch in" (load) the program.

I have got an old external keypad because my old notebook did not have any numeric keypad. The keys looks similar to those old Elf hex keypads, why not use this spare keypad for the Elf Membership Card? It is a Cherry keyboard and I have an other Cherry keyboard with the same type of key caps and it was easy to replace the two upper rows with the A to F caps.

See also the RaspiElfDisplay (TIL311 like LED display).

Changed:
<
<
Contents
>
>
Contents
 
Line: 23 to 23
 
keypad-display.jpg
Keypad and display

Short Mode Key Keycode Notes
Changed:
<
<
IN Input I, [CR] 96  
LD Load L, + 78  
R/S Run/Wait R, . 83 R/S is a reminiscence of HP pocket calculators
MP Memory Protect M, - 74  
SW Switch/Keypad S, [BS] 14  
>
>
IN Input I, [CR] 96 Increment address, in LOAD mode causes the data byte shown to be written to the address shown
LD Load L, + 78 Goes to the LOAD mode. In the LOAD mode goes to the address entry mode
R/S Run/Wait R, . 83 Toggles between Run and Wait. R/S is a reminiscence of HP pocket calculators
MP Memory Protect M, - 74 Shows data byte from the address shown
SW Switch/Keypad S, [BS] 14 Toggles between front panel switches and keypad

The modes are shown in the display by the decimal points.

RCA COSMAC Microterminal

RCA COSMAC Microterminal

R
Reset: resets the logic of the Microterminal and microprocessor system. Puts the CDP1802 in Reset state.
RU
Run Utility: starts execution of the Utility Program (UT5), which is at location 8000.
RP
Run Program: starts program execution at location 0000 with R0 as program counter.
CONT/STEP
Slide switch to enable continous or single-step operation of the microprocessor system.
Arrow leftArrow right
Entry Mode Control: this key toggles between the address entry and data entry modes.
INC
Increment Address: each depression increments the address shown in the display. In the data entry mode, it also causes the data byte shown to be written to the address shown before incrementing the address.
$P
Start Addressed Program: starts program execution at the location shown in the address display.
CA
Clear Address: clears (resets) the address display to 0000.

QUEST Super Elf

I
Input
L
Load mode
R
Reset
G
Go (run mode)
W
Wait (processor clock could be stopped)
M
enable Monitor ROM
S
Single step
P
Protect memory

Elf 2000

R
RESET
G
RUN
L
LOAD
M
MP Memory Protect
I
INPUT
 
Deleted:
<
<
http://www.decodesystems.com/cosmac/mpm-212.pdf
 

Revision 102018-05-30 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 29 to 29
 
MP Memory Protect M, - 74  
SW Switch/Keypad S, [BS] 14  
Added:
>
>
http://www.decodesystems.com/cosmac/mpm-212.pdf
 

Revision 92018-05-20 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Changed:
<
<
image="/twiki/pub/Cosmac/RaspiElf/raspi-elfmemcard-s.jpg"
>
>
image="/twiki/pub/Cosmac/RaspiElfKeypad/hex-keypad-s.jpg"
  title="!RaspiElf Keypad" titlestyle="color:#F00000;" }%
Intro
Changed:
<
<
The Elf Membership Card has 8 data switches, 3 mode switches, and a IN push button on its front panel. The data is displayed on 8 LEDs (binary). It is a error prone but educational task to "switch in" in (load) the program.
>
>
The Elf Membership Card has 8 data switches, 3 mode switches, and a IN push button on its front panel. The data is displayed on 8 LEDs (binary). It is a error prone but educational task to "switch in" (load) the program.
  I have got an old external keypad because my old notebook did not have any numeric keypad. The keys looks similar to those old Elf hex keypads, why not use this spare keypad for the Elf Membership Card? It is a Cherry keyboard and I have an other Cherry keyboard with the same type of key caps and it was easy to replace the two upper rows with the A to F caps.
Added:
>
>
See also the RaspiElfDisplay (TIL311 like LED display).
 
Line: 144 to 146
 

How to get and build the RaspiElf Keypad/Display Software

Changed:
<
<
The elfdisplay is part of the tools package. See RaspiElf#How_to_get_and_build_the_RaspiEl
>
>
The elfdisplay is part of the RaspiElf tools package. See RaspiElf#How_to_get_and_build_the_RaspiEl
 

Sample session

Changed:
<
<
>
>
TBC (video)
 
Line: 162 to 164
 
META FILEATTACHMENT attachment="gal_2000_G84-4700_2_persp.jpg" attr="" comment="" date="1525901809" name="gal_2000_G84-4700_2_persp.jpg" path="gal_2000_G84-4700_2_persp.jpg" size="90914" user="PeterSchmid" version="1"
META FILEATTACHMENT attachment="hex-keypad.jpg" attr="" comment="" date="1526500836" name="hex-keypad.jpg" path="hex-keypad.jpg" size="468139" user="PeterSchmid" version="1"
Added:
>
>
META FILEATTACHMENT attachment="hex-keypad-s.jpg" attr="" comment="" date="1526841774" name="hex-keypad-s.jpg" path="hex-keypad-s.jpg" size="43746" user="PeterSchmid" version="1"

Revision 82018-05-20 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 14 to 14
 
Changed:
<
<
>
>
 

Hardware

|
gal 2000 G84-4700 2 persp.jpg
Cherry Keypad G84-4700, original key caps
|
hex-keypad.jpg
Hex Keypad
Changed:
<
<
Microdot pHAT.jpg
Microdot_pHAT on Raspberry Pi Zero
>
>
keypad-display.jpg
Keypad and display

Short Mode Key Keycode Notes
IN Input I, [CR] 96  
LD Load L, + 78  
R/S Run/Wait R, . 83 R/S is a reminiscence of HP pocket calculators
MP Memory Protect M, - 74  
SW Switch/Keypad S, [BS] 14  
 

Software for the Raspberry Pi

Changed:
<
<
No special software needed. Keyboard drivers are already built in.
>
>
No special software needed. Keyboard drivers are already built in Raspbian.

Here some ideas if you want to customize your own keypad.

 
Changed:
<
<
Mapping scancodes to keycodes is universal and not specific to Linux console or Xorg, which means that changes to this mapping will be effective in both.
>
>
pi@cosmac:~/elf/RaspiElf/tools $ $ test-key /dev/input/by-id/usb-046a_0014-event-kbd
Code: 82 0x52, value 1 key 0 pressed
Code: 82 0x52, value 0 key 0 released 
Code: 79 0x4f, value 1 key 1 pressed
Code: 79 0x4f, value 0 key 1 released
Code: 80 0x50, value 1 key 2 pressed
Code: 80 0x50, value 0 key 2 released
Code: 81 0x51, value 1 key 3 pressed
Code: 81 0x51, value 0 key 3 released
Code: 75 0x4b, value 1 key 4 pressed
Code: 75 0x4b, value 0 key 4 released
Code: 76 0x4c, value 1 key 5 pressed
Code: 76 0x4c, value 0 key 5 released
^C
 
pi@cosmac:~/elf/RaspiElf/tools $ udevadm info /dev/input/by-path/*-usb-*-kbd

Line: 67 to 92
 E: XKBMODEL=pc105
Added:
>
>
Mapping scancodes to keycodes is universal and not specific to Linux console or Xorg, which means that changes to this mapping will be effective in both.
 showkey --scancodes

evdev:input:bvpe-

Revision 72018-05-16 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 9 to 9
 
Intro
The Elf Membership Card has 8 data switches, 3 mode switches, and a IN push button on its front panel. The data is displayed on 8 LEDs (binary). It is a error prone but educational task to "switch in" in (load) the program.
Changed:
<
<
I have an old external keypad because my old notebook did not have a numeric keypad. The keys looks similar to those old Elf hex keypads, why not use this spare keypad for the Elf Membership Card? It is a Cherry keyboard and I have other Cherry keyboard with the same key caps.
>
>
I have got an old external keypad because my old notebook did not have any numeric keypad. The keys looks similar to those old Elf hex keypads, why not use this spare keypad for the Elf Membership Card? It is a Cherry keyboard and I have an other Cherry keyboard with the same type of key caps and it was easy to replace the two upper rows with the A to F caps.
 
Line: 17 to 17
 

Hardware

|
gal 2000 G84-4700 2 persp.jpg
Cherry Keypad G84-4700, original key caps
Changed:
<
<
|
LED module.jpg
LTP-305 Dot Matrix Display
>
>
|
hex-keypad.jpg
Hex Keypad
 
Microdot pHAT.jpg
Microdot_pHAT on Raspberry Pi Zero

Line: 136 to 136
 

Comments

META FILEATTACHMENT attachment="gal_2000_G84-4700_2_persp.jpg" attr="" comment="" date="1525901809" name="gal_2000_G84-4700_2_persp.jpg" path="gal_2000_G84-4700_2_persp.jpg" size="90914" user="PeterSchmid" version="1"
Added:
>
>
META FILEATTACHMENT attachment="hex-keypad.jpg" attr="" comment="" date="1526500836" name="hex-keypad.jpg" path="hex-keypad.jpg" size="468139" user="PeterSchmid" version="1"

Revision 62018-05-14 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 94 to 94
 


Added:
>
>
pi@cosmac:~ $ cat /dev/input/event0 | hexdump -C
 ESC 00008010 cb d9 f9 5a cc fd 04 00 04 00 04 00 29 00 07 00 |...Z........)...| 00008020 cb d9 f9 5a cc fd 04 00 01 00 01 00 01 00 00 00 |...Z............|

Revision 52018-05-14 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 82 to 82
  KEYBOARD_KEY_38=f # bind Alt to F
Added:
>
>
pi@cosmac:~ $ ls -l /dev/input/by-id/
total 0
lrwxrwxrwx 1 root root 9 May 14 20:23 usb-046a_0014-event-kbd -> ../event0
pi@cosmac:~ $ ls -l /dev/input/by-path/
total 0
lrwxrwxrwx 1 root root 9 May 14 20:23 platform-3f980000.usb-usb-0:1.4:1.0-event-kbd -> ../event0
pi@cosmac:~ $ ls -l /dev/input/event0
crw-rw---- 1 root input 13, 64 May 14 20:23 /dev/input/event0

ESC
00008010  cb d9 f9 5a cc fd 04 00  04 00 04 00 29 00 07 00  |...Z........)...|
00008020  cb d9 f9 5a cc fd 04 00  01 00 01 00 01 00 00 00  |...Z............|
00008030  cb d9 f9 5a cc fd 04 00  00 00 00 00 00 00 00 00  |...Z............|
00008040  cb d9 f9 5a b8 7a 05 00  04 00 04 00 29 00 07 00  |...Z.z......)...|
00008050  cb d9 f9 5a b8 7a 05 00  01 00 01 00 00 00 00 00  |...Z.z..........|
00008060  cb d9 f9 5a b8 7a 05 00  00 00 00 00 00 00 00 00  |...Z.z..........|

Ctrl
00008070  cf d9 f9 5a 66 55 06 00  04 00 04 00 e0 00 07 00  |...ZfU..........|
00008080  cf d9 f9 5a 66 55 06 00  01 00 1d 00 01 00 00 00  |...ZfU..........|
00008090  cf d9 f9 5a 66 55 06 00  00 00 00 00 00 00 00 00  |...ZfU..........|
000080a0  cf d9 f9 5a 94 f1 06 00  04 00 04 00 e0 00 07 00  |...Z............|
000080b0  cf d9 f9 5a 94 f1 06 00  01 00 1d 00 00 00 00 00  |...Z............|
000080c0  cf d9 f9 5a 94 f1 06 00  00 00 00 00 00 00 00 00  |...Z............|
 

Revision 42018-05-13 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 67 to 67
 E: XKBMODEL=pc105
Added:
>
>
showkey --scancodes
 evdev:input:bvpe-
Added:
>
>
File /etc/udev/hwdb.d/10-hexkeypad.hwdb
 
evdev:input:b*v046ap0014* # ML4700

Changed:
<
<
KEYBOARD_KEY_70039=leftalt # bind numlock to A KEYBOARD_KEY_70039=leftalt # bind numlock to B KEYBOARD_KEY_70039=leftalt # bind numlock to C KEYBOARD_KEY_700e2=leftctrl # bind ESC to D KEYBOARD_KEY_700e2=leftctrl # bind Ctrl to E KEYBOARD_KEY_700e2=leftctrl # bind Alt to F
>
>
KEYBOARD_KEY_45=a # bind numlock to A KEYBOARD_KEY_62=b # bind / to B KEYBOARD_KEY_37=c # bind * to C KEYBOARD_KEY_01=d # bind ESC to D KEYBOARD_KEY_1d=e # bind Ctrl to E KEYBOARD_KEY_38=f # bind Alt to F
 

Revision 32018-05-13 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 7 to 7
  titlestyle="color:#F00000;" }%
Intro
Added:
>
>
The Elf Membership Card has 8 data switches, 3 mode switches, and a IN push button on its front panel. The data is displayed on 8 LEDs (binary). It is a error prone but educational task to "switch in" in (load) the program.
 
Added:
>
>
I have an old external keypad because my old notebook did not have a numeric keypad. The keys looks similar to those old Elf hex keypads, why not use this spare keypad for the Elf Membership Card? It is a Cherry keyboard and I have other Cherry keyboard with the same key caps.
 
Line: 21 to 23
 

Software for the Raspberry Pi

Added:
>
>
No special software needed. Keyboard drivers are already built in.
 
Added:
>
>
 
Changed:
<
<

How to get and build the RaspiElf Keypad Software

>
>
Mapping scancodes to keycodes is universal and not specific to Linux console or Xorg, which means that changes to this mapping will be effective in both.
 
Deleted:
<
<
Get the source from the GIT repository (if you have not installed GIT yet, then install it with sudo apt-get install git), type only the bold text after the $ sign:
 

Changed:
<
<
pi@cosmac:~/elf $ git clone https://github.com/spyren/RaspiElf Cloning into 'RaspiElf'... remote: Counting objects: 68, done. remote: Compressing objects: 100% (37/37), done. remote: Total 68 (delta 32), reused 62 (delta 29), pack-reused 0 Unpacking objects: 100% (68/68), done. Checking connectivity... done. pi@cosmac:~/elf $
>
>
pi@cosmac:~/elf/RaspiElf/tools $ udevadm info /dev/input/by-path/*-usb-*-kbd P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:046A:0014.0002/input/input1/event0 N: input/event0 S: input/by-id/usb-046a_0014-event-kbd S: input/by-path/platform-3f980000.usb-usb-0:1.2:1.0-event-kbd E: BACKSPACE=guess E: DEVLINKS=/dev/input/by-id/usb-046a_0014-event-kbd /dev/input/by-path/platform-3f980000.usb-usb-0:1.2:1.0-event-kbd E: DEVNAME=/dev/input/event0 E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:046A:0014.0002/input/input1/event0 E: ID_BUS=usb E: ID_INPUT=1 E: ID_INPUT_KEY=1 E: ID_INPUT_KEYBOARD=1 E: ID_MODEL=0014 E: ID_MODEL_ENC=0014 E: ID_MODEL_ID=0014 E: ID_PATH=platform-3f980000.usb-usb-0:1.2:1.0 E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_2_1_0 E: ID_REVISION=0100 E: ID_SERIAL=046a_0014 E: ID_TYPE=hid E: ID_USB_DRIVER=usbhid E: ID_USB_INTERFACES=:030101: E: ID_USB_INTERFACE_NUM=00 E: ID_VENDOR=046a E: ID_VENDOR_ENC=046a E: ID_VENDOR_ID=046a E: MAJOR=13 E: MINOR=64 E: SUBSYSTEM=input E: USEC_INITIALIZED=69042133468 E: XKBLAYOUT=gb E: XKBMODEL=pc105

evdev:input:bvpe-

evdev:input:b*v046ap0014* # ML4700
 KEYBOARD_KEY_70039=leftalt  # bind numlock to A
 KEYBOARD_KEY_70039=leftalt  # bind numlock to B
 KEYBOARD_KEY_70039=leftalt  # bind numlock to C
 KEYBOARD_KEY_700e2=leftctrl # bind ESC     to D
 KEYBOARD_KEY_700e2=leftctrl # bind Ctrl    to E
 KEYBOARD_KEY_700e2=leftctrl # bind Alt     to F

 
Deleted:
<
<
Build (compile) from the sources:
pi@cosmac:~/elf $ cd RaspiElf
pi@cosmac:~/elf/RaspiElf $ cd tools/
pi@cosmac:~/elf/RaspiElf/tools $ make
cc -g -c elf2bin.c
cc -g -c raspi_gpio.c
cc -g -o elf2bin -lwiringPi elf2bin.o raspi_gpio.o
cc -g -c bin2elf.c
cc -g -o bin2elf -lwiringPi bin2elf.o raspi_gpio.o
cc -g -c elf.c
cc -g -o elf -lwiringPi elf.o raspi_gpio.o
pi@cosmac:~/elf/RaspiElf/tools $ 
 
Deleted:
<
<
Install the binaries into /usr/local/bin
pi@cosmac:~/elf/RaspiElf/tools $ sudo make install
install -m 557 elf2bin bin2elf elf /usr/local/bin
 
Changed:
<
<

Sample session

Type only the bold text after the $ sign.
>
>
 
Changed:
<
<
Initialise the Elf memory with 00H (32 Kib):
pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -e 7fff </dev/zero
0x8000 bytes written
>
>

How to get and build the RaspiElf Keypad/Display Software

The elfdisplay is part of the tools package. See RaspiElf#How_to_get_and_build_the_RaspiEl
 
Deleted:
<
<
Upload and run the chase lighting program (details see ChaseLighting):
pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -w -r chase.bin
0x002d bytes written

Stop the program an go into the load state:

pi@cosmac:~/elf/RaspiElf/chase $ elf load
01 1 0 0 1 1 0 0c
 
Changed:
<
<
Hexdump the Elf memory until address 0x3f (hexdump is standard UNIX tool and is included in Raspbian and other GNU/Linux'):
pi@cosmac:~/elf/RaspiElf/chase $ elf2bin -e 3f | hexdump -C
0x0040 bytes read
00000000  c0 00 03 e3 90 b3 f8 30  a3 f8 01 53 64 6c 23 fa  |.......0...Sdl#.|
00000010  fe 3a 1a f0 f6 c7 f8 80  30 1f f0 fe c7 f8 01 53  |.:......0......S|
00000020  f8 14 b2 22 92 3a 23 c5  7a 38 7b 30 0c 00 00 00  |...".:#.z8{0....|
00000030  04 ff 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040

Get the mode and the data (LEDs and swiches)

pi@cosmac:~/elf/RaspiElf/chase $ elf
02 1 1 0 1 1 1 ff
pi@cosmac:~/elf/RaspiElf/chase $ elf -v 
LED:01 Q:1 Rx:1 IN:0 WAIT:1 CLR:1 READ:0 SWITCH:0c

Write enable (not READ)

pi@cosmac:~/elf/RaspiElf/chase $ elf -n read
02 1 1 0 1 1 0 ff

Run mode (starts the chase lighting again)

pi@cosmac:~/elf/RaspiElf/chase $ elf run

Put 0000'0000B to the switches (chase LEDs from right to left)

pi@cosmac:~/elf/RaspiElf/chase $ elf put 0
40 1 1 0 0 0 0 00

Put 1000'0000B to the switches (chase LEDs from left to right)

pi@cosmac:~/elf/RaspiElf/chase $ elf put 80
10 1 1 0 0 0 0 80
>
>

Sample session

 
Deleted:
<
<
Get the mode and data while the program is running (LEDs and Q are changing)
pi@cosmac:~/elf/RaspiElf/chase $ elf -v
LED:40 Q:1 Rx:1 IN:0 WAIT:0 CLR:0 READ:0 SWITCH:80
pi@cosmac:~/elf/RaspiElf/chase $ elf -v
LED:02 Q:0 Rx:1 IN:0 WAIT:0 CLR:0 READ:0 SWITCH:80
 

Revision 22018-05-09 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 14 to 14
 

Hardware

Added:
>
>
gal 2000 G84-4700 2 persp.jpg
Cherry Keypad G84-4700, original key caps
LED module.jpg
LTP-305 Dot Matrix Display
Microdot pHAT.jpg
Microdot_pHAT on Raspberry Pi Zero
 

Software for the Raspberry Pi

Added:
>
>
 
Line: 136 to 141
 -- Peter Schmid - 2018-05-03

Comments

\ No newline at end of file
Added:
>
>
META FILEATTACHMENT attachment="gal_2000_G84-4700_2_persp.jpg" attr="" comment="" date="1525901809" name="gal_2000_G84-4700_2_persp.jpg" path="gal_2000_G84-4700_2_persp.jpg" size="90914" user="PeterSchmid" version="1"

Revision 12018-05-03 - PeterSchmid

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"
RaspiElf Keypad
Intro

Hardware

Software for the Raspberry Pi

How to get and build the RaspiElf Keypad Software

Get the source from the GIT repository (if you have not installed GIT yet, then install it with sudo apt-get install git), type only the bold text after the $ sign:

pi@cosmac:~/elf $ git clone https://github.com/spyren/RaspiElf
Cloning into 'RaspiElf'...
remote: Counting objects: 68, done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 68 (delta 32), reused 62 (delta 29), pack-reused 0
Unpacking objects: 100% (68/68), done.
Checking connectivity... done.
pi@cosmac:~/elf $

Build (compile) from the sources:

pi@cosmac:~/elf $ cd RaspiElf
pi@cosmac:~/elf/RaspiElf $ cd tools/
pi@cosmac:~/elf/RaspiElf/tools $ make
cc -g -c elf2bin.c
cc -g -c raspi_gpio.c
cc -g -o elf2bin -lwiringPi elf2bin.o raspi_gpio.o
cc -g -c bin2elf.c
cc -g -o bin2elf -lwiringPi bin2elf.o raspi_gpio.o
cc -g -c elf.c
cc -g -o elf -lwiringPi elf.o raspi_gpio.o
pi@cosmac:~/elf/RaspiElf/tools $ 

Install the binaries into /usr/local/bin

pi@cosmac:~/elf/RaspiElf/tools $ sudo make install
install -m 557 elf2bin bin2elf elf /usr/local/bin

Sample session

Type only the bold text after the $ sign.

Initialise the Elf memory with 00H (32 Kib):

pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -e 7fff </dev/zero
0x8000 bytes written

Upload and run the chase lighting program (details see ChaseLighting):

pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -w -r chase.bin
0x002d bytes written

Stop the program an go into the load state:

pi@cosmac:~/elf/RaspiElf/chase $ elf load
01 1 0 0 1 1 0 0c

Hexdump the Elf memory until address 0x3f (hexdump is standard UNIX tool and is included in Raspbian and other GNU/Linux'):

pi@cosmac:~/elf/RaspiElf/chase $ elf2bin -e 3f | hexdump -C
0x0040 bytes read
00000000  c0 00 03 e3 90 b3 f8 30  a3 f8 01 53 64 6c 23 fa  |.......0...Sdl#.|
00000010  fe 3a 1a f0 f6 c7 f8 80  30 1f f0 fe c7 f8 01 53  |.:......0......S|
00000020  f8 14 b2 22 92 3a 23 c5  7a 38 7b 30 0c 00 00 00  |...".:#.z8{0....|
00000030  04 ff 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040

Get the mode and the data (LEDs and swiches)

pi@cosmac:~/elf/RaspiElf/chase $ elf
02 1 1 0 1 1 1 ff
pi@cosmac:~/elf/RaspiElf/chase $ elf -v 
LED:01 Q:1 Rx:1 IN:0 WAIT:1 CLR:1 READ:0 SWITCH:0c

Write enable (not READ)

pi@cosmac:~/elf/RaspiElf/chase $ elf -n read
02 1 1 0 1 1 0 ff

Run mode (starts the chase lighting again)

pi@cosmac:~/elf/RaspiElf/chase $ elf run

Put 0000'0000B to the switches (chase LEDs from right to left)

pi@cosmac:~/elf/RaspiElf/chase $ elf put 0
40 1 1 0 0 0 0 00

Put 1000'0000B to the switches (chase LEDs from left to right)

pi@cosmac:~/elf/RaspiElf/chase $ elf put 80
10 1 1 0 0 0 0 80

Get the mode and data while the program is running (LEDs and Q are changing)

pi@cosmac:~/elf/RaspiElf/chase $ elf -v
LED:40 Q:1 Rx:1 IN:0 WAIT:0 CLR:0 READ:0 SWITCH:80
pi@cosmac:~/elf/RaspiElf/chase $ elf -v
LED:02 Q:0 Rx:1 IN:0 WAIT:0 CLR:0 READ:0 SWITCH:80

-- Peter Schmid - 2018-05-03

Comments

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback