Difference: RaspiElf (16 vs. 17)

Revision 172017-12-18 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 11 to 11
 
NAME
elf2bin - Copies the Elf (Membership Card) memory to a binary file on the Raspberry Pi.
Added:
>
>
SYNOPSIS
elf2bin [-s hexadr] [-e hexadr] [-w] [-r] [file]
 
Changed:
<
<
SYNOPSIS
elf2bin [-s hexadr] [-e hexadr] [-w] [-r] [_file_]

DESCRIPTION
Copies the Elf memory to a binary file (or stdout) on the Raspberry Pi. The Raspberry Pi GPIO is used as interface to the Cosmac Elf SBC (e.g. Elf Membership Card parallel port). The generated data is written to the standard output stream or to a file. Caution: Overwrite file if it exists. Use > for redirecting (save the file) or | for piping to another command (e.g. hexdump)
>
>
DESCRIPTION
Copies the Elf memory to a binary file (or stdout) on the Raspberry Pi. The Raspberry Pi GPIO is used as interface to the Cosmac Elf SBC (e.g. Elf Membership Card parallel port). The generated data is written to the standard output stream or to a file. Caution: Overwrite file if it exists. Use > for redirecting (save the file) or | for piping to another command (e.g. hexdump). All switches an the Elf Membership Card have to be on the up position except for the READ switch, the READ switch has to be on the down position.
 
OPTIONS
Non argument options that are duplicated on the command line are not harmful. For options that require an argument, each duplication will override the previous argument value.
-s hexadr
start address in hex (0 is default)
Line: 24 to 23
 

Changed:
<
<
>
>
 

bin2elf (upload tool)

Added:
>
>
NAME
bin2belf - Copies the content of binary file on the Raspberry Pi to Elf (Membership Card) memory .
 
Changed:
<
<
  • elf [-i] [-v] [-s ] [load|run|wait|reset|write|get|put] []
>
>
SYNOPSIS
bin2elf [-s hexadr] [-e hexadr] [-w] [-r] [file]
 
Changed:
<
<
LED Q IN WAIT CLEAR WRITE SWITCH
>
>
DESCRIPTION
Copies the content of binary file on the Raspberry Pi to Elf (Membership Card) memory. The Raspberry Pi GPIO is used as interface to the Cosmac Elf SBC (e.g. Elf Membership Card parallel port). Overwrite file if it exists. Use < for redirecting or | for piping from another command. All switches an the Elf Membership Card have to be on the up position except for the READ switch, the READ switch has to be on the down position.
 
Changed:
<
<
-i increment -v verbose
>
>
OPTIONS
Non argument options that are duplicated on the command line are not harmful. For options that require an argument, each duplication will override the previous argument value.
-s hexadr
start address in hex (0 is default)
-e hexadr
end adress in hex (0xFFFF is default)
-w
write enable when copying is finished
-r
go to run mode when copying is finished
 

elf (command line tool)

Added:
>
>
NAME
elf - Controls the mode, sets data switches and gets LED data of an Elf (Membership Card).

SYNOPSIS
elf [-s hexadr] [-i] [-n] [-v] [load|run|wait|reset|read|get|put] [switch]
 
Changed:
<
<
  • elf [-i] [-v] [-s ] [load|run|wait|reset|write|get|put] []
>
>
DESCRIPTION
Controls the mode, sets data switches and gets LED data of an Elf (Membership Card). The Raspberry Pi GPIO is used as interface to the Cosmac Elf SBC (e.g. Elf Membership Card parallel port). If a command is missing, the default command is then get. All switches an the Elf Membership Card have to be on the up position except for the READ switch, the READ switch has to be on the down position.
load
sets the mode to load (WAIT and CLR active, is equivalent to switches down)
run
sets the mode to run (WAIT and CLR inactive, is equivalent to switches up)
wait
sets the WAIT to active (is equivalent to switch down), option -n inverts the WAIT to inactive (is equivalent to switch down)
reset|clear
sets the CLR to active (is equivalent to switch down), option -n inverts the CLR to inactive (is equivalent to switch down)
read
sets the WE to active (is equivalent to switch down), option -n inverts the CLR to inactive (is equivalent to switch down)
get
gets the mode and the switch data and the LED data
put switch
puts the switch data to the data switches. The data is in hex.

OPTIONS
Non argument options that are duplicated on the command line are not harmful. For options that require an argument, each duplication will override the previous argument value.
-s hexadr
start address in hex (0 is default). Pre increment to the start address before the data is read and written.
-i
post increment. The IN is set active for > 100 us after the data is read and written
-n
not, invert the command. No effect for load, run, get, and put.
-v
verbose, output looks like "LED:01 Q:1 Rx:1 IN:0 WAIT:1 CLR:1 READ:0 SWITCH:0c"
 
Deleted:
<
<
LED Q IN WAIT CLEAR WRITE SWITCH
 
Deleted:
<
<
-i increment -v verbose
 
Changed:
<
<

How to get and build RaspiElf tools

>
>

How to get and build the RaspiElf tools

  Get the source from the GIT repository (if you have not installed GIT yet, then install it with sudo apt-get install git):
Line: 91 to 107
 0x8000 bytes written
Changed:
<
<
Upload the chase lighting program (details see ChaseLighting):
>
>
Upload and run the chase lighting program (details see ChaseLighting):
 
pi@cosmac:~/elf/RaspiElf/chase $ bin2elf -w -r chase.bin
0x002d bytes written
Line: 103 to 119
 01 1 0 0 1 1 0 0c
Changed:
<
<
Hexdump the Elf memory until address 0x3f:
>
>
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
Line: 114 to 130
 00000040
Changed:
<
<
Get the status
>
>
Get the mode and the data (LEDs and swiches)
 
pi@cosmac:~/elf/RaspiElf/chase $ elf
02 1 1 0 1 1 1 ff
Line: 133 to 149
 pi@cosmac:~/elf/RaspiElf/chase $ elf run
Changed:
<
<
Put 0000'0000B to the switches (LEDs from right to left)
>
>
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
Changed:
<
<
Put 1000'0000B to the switches (LEDs from left to right)
>
>
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
Changed:
<
<
Get the status (LEDs and Q are changing)
>
>
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
Line: 155 to 171
 

Wiring

Added:
>
>
The Raspberry Pi ARM processor supply voltage is 3.3 V and the GPIOs are not 5 V tolerant. The Elf supply voltage is 5 V. This means that the GPIOs (input) has to be protected from Elf. The easiest way is to use diodes e.g. 1N4148 to protect the GPIOs from the 5 V, but the GPIOS need then a pullup resistors. Thankfully the Raspi GPIOs have internal pullup and can be controlled by software. The cathode has to be on the Elf side.

It is possible that the Elf works with 3.3 V supply voltage, but this is not within the specifications. In this case the diodes are not needed. Connect the Raspi Pin 1 to P4 Pin 3 (do NOT connect Raspi Pin 2!).

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