Tags:
view all tags
%DASHBOARD{ section="dashboard_start" }% %DASHBOARD{ section="banner" image="%PUBURLPATH%/Cosmac/RaspiElf/raspi-elfmemcard-s.jpg" title="!RaspiElf Keypad" titlestyle="color:#F00000;" }% %DASHBOARD{ section="box_start" title="Intro" width="485" height="200"}% %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" title="Contents" width="460" height="200"}% %TOC% %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="400" }% ---+ Hardware %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="600" }% ---+ Software for the Raspberry Pi %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="380" }% ---+ How to get and build the RaspiElf Keypad Software Get the source from the [[https://github.com/spyren/RaspiElf][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: <pre> pi@cosmac:~/elf $ <b>git clone https://github.com/spyren/RaspiElf</b> 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 $ </pre> Build (compile) from the sources: <pre> pi@cosmac:~/elf $ <b>cd RaspiElf</b> pi@cosmac:~/elf/RaspiElf $ <b>cd tools/</b> pi@cosmac:~/elf/RaspiElf/tools $ <b>make</b> 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 $ </pre> Install the binaries into =/usr/local/bin= <pre> pi@cosmac:~/elf/RaspiElf/tools $ <b>sudo make install</b> install -m 557 elf2bin bin2elf elf /usr/local/bin </pre> %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="600" }% ---+ Sample session Type only the bold text after the $ sign. Initialise the Elf memory with 00H (32 Kib): <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>bin2elf -e 7fff </dev/zero</b> 0x8000 bytes written </pre> Upload and run the chase lighting program (details see ChaseLighting): <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>bin2elf -w -r chase.bin</b> 0x002d bytes written </pre> Stop the program an go into the load state: <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>elf load</b> 01 1 0 0 1 1 0 0c </pre> Hexdump the Elf memory until address 0x3f (hexdump is standard UNIX tool and is included in Raspbian and other GNU/Linux'): <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>elf2bin -e 3f | hexdump -C</b> 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 </pre> Get the mode and the data (LEDs and swiches) <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>elf</b> 02 1 1 0 1 1 1 ff pi@cosmac:~/elf/RaspiElf/chase $ <b>elf -v </b> LED:01 Q:1 Rx:1 IN:0 WAIT:1 CLR:1 READ:0 SWITCH:0c </pre> Write enable (not READ) <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>elf -n read</b> 02 1 1 0 1 1 0 ff </pre> Run mode (starts the chase lighting again) <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>elf run</b> </pre> Put 0000'0000B to the switches (chase LEDs from right to left) <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>elf put 0</b> 40 1 1 0 0 0 0 00 </pre> Put 1000'0000B to the switches (chase LEDs from left to right) <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>elf put 80</b> 10 1 1 0 0 0 0 80 </pre> Get the mode and data while the program is running (LEDs and Q are changing) <pre> pi@cosmac:~/elf/RaspiElf/chase $ <b>elf -v</b> LED:40 Q:1 Rx:1 IN:0 WAIT:0 CLR:0 READ:0 SWITCH:80 pi@cosmac:~/elf/RaspiElf/chase $ <b>elf -v</b> LED:02 Q:0 Rx:1 IN:0 WAIT:0 CLR:0 READ:0 SWITCH:80 </pre> %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="dashboard_end" }% -- %USERSIG{PeterSchmid - 2018-05-03}% ---++!! Comments
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r12
|
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2018-05-03
-
PeterSchmid
Home
Site map
Cosmac web
MRR web
MecrispCube web
SuperRandonnee web
TWiki web
Ursula web
Velo web
Cosmac Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Edit
Attach
Copyright © 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