User Tools

Site Tools


anchordemo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
anchordemo [2021/06/07 20:26]
dpisuperadmin [Overview]
— (current)
Line 1: Line 1:
-====== Anchor Demonstration Board ====== 
- 
-==== Introduction ==== 
-Anchor Electronics sells a selection of new and surplus Demand Peripherals boards. 
-The project described on this page gives Anchor customers a quick, visual 
-introduction to the Demand Peripherals product line and and open-source peripherals. 
- 
- 
-==== Overview ==== 
-{{ ::anchordemo.jpg?200|}}This page is organized as follows: 
-  * Peripheral and hardware selection 
-  * Physical construction and wiring notes 
-  * Linux configuration 
-  * Applications 
-    * distance 
-    * rgbled 
-    * motordemo 
- 
-==== Peripheral and Hardware Selection ==== 
-Our goal was to give Anchor customers a simple demonstration of the capabilities of the Demand Peripherals software defined peripherals. There are three separate applications running on the demo system. 
- 
-The first  is an ultrasonic distance sensor whose reading are displayed on a 6 digit LCD.  The distance is shown in inches and tenths of an inch.  We use the us8 peripheral ([[http://exampldemandperipherals.com/peripherals/us8.htmle.com|us8]]) and card ([[https://demandperipherals.com/cards/us8.htmlh|us8]]).  The distance is shown in inches using the lcd6 peripheral ([[http://https://demandperipherals.com/peripherals/lcd6.html|lcd6]]) and the lcd6 card ([[http://https://demandperipherals.com/cards/lcd6.html|lcd6]]). The sensor is an Adafruit HC-SR04 ([[https://www.adafruit.com/product/3942|HC-SR04]]). 
- 
-The second application uses a quad slide potentiometer peripheral ([[https://demandperipherals.com/peripherals/slide4.html|slide4]]) and card ([[https://demandperipherals.com/cards/slider4.html|slider4]]) to control the red-green-blue brightness of a string of eight WS2812 LEDs from Adafruit ([[https://www.adafruit.com/product/1426|NeoPixel Stick]]). 
- 
-The third application uses a rotary encoder to control the speed and direction of a DC motor.  The RPM speed of the motor is displayed on a second 6 digit LCD.  The rotary encoder peripheral and card are the rotary encoder interface ([[https://demandperipherals.com/peripherals/roten.html|roten]]) and the rotary encoder card([[https://demandperipherals.com/cards/roten.html|roten]]). We use a DC gearhead motor from Adafruit ([[https://www.adafruit.com/product/4416|Geared DC Motor]]).  The motor is controlled with the dual DC motor controller peripheral ([[https://demandperipherals.com/peripherals/dc2.html|DC2]]) and the dual H-bridge card ([[https://demandperipherals.com/cards/d7hb.html|d7hb]]).  The motor has a magnetic quadrature encoder to measure the speed.  The encoder outputs go to a general purpose IO card ([[https://demandperipherals.com/cards/gpio4.html|gpio4]]) and from there to a dual quadrature decoder peripheral ([[https://demandperipherals.com/peripherals/quad2.html|quad2]]).  A second LCD6 card and peripheral display the speed of the motor in revolutions per minute. 
- 
-The command 'dplist' shows the peripherals in the system and the names of the resources available for each peripheral.  The dplist for this project is shown below.  Use the 'Build your FPGA Image' page ([[https://demandperipherals.com/support/build_fpga.html|FPGA Image]] to request an FPGA binary with the listed peripheral.  Of course you can change the requester peripherals and you can build the image from the Verilog sources if you wish. 
-<code> 
-  Slot/Name         Description 
-   0 / enumerator   FPGA Interface and ROM contents 
-                  - port : dpget dpset  
-                  - text : dpget  
-   1 /      bb4io   The buttons and LEDs on the Baseboard 
-                  - buttons : dpget dpcat  
-                  - leds : dpget dpset  
-   2 /        us8   Octal interface to SRF04 distance sensor 
-                  - distance : dpcat  
-                  - enable : dpget dpset  
-   3 /       lcd6   Six digit 7-segment LCD display 
-                  - display : dpget dpset  
-                  - segments : dpget dpset  
-   4 /       ws28   Quad WS2812 LED driver 
-                  - led : dpset  
-                  - config : dpget dpset  
-   5 /     slide4   Quad slide potentiometer 
-                  - positions : dpget dpcat  
-   6 /      quad2   Dual Quadrature Decoder 
-                  - counts : dpcat  
-                  - update_period : dpget dpset  
-   7 /        dc2   Dual DC motor controller 
-                  - mode0 : dpget dpset  
-                  - mode1 : dpget dpset  
-                  - power0 : dpget dpset  
-                  - power1 : dpget dpset  
-                  - pwm_frequency : dpget dpset  
-                  - watchdog : dpget dpset  
-   8 /      roten   General purpose rotary encoder input 
-                  - encoder : dpget dpcat  
-                  - led : dpget dpset  
-   9 /       lcd6   Six digit 7-segment LCD display 
-                  - display : dpget dpset  
-                  - segments : dpget dpset  
-  10 /      gpio4   Quad General Purpose Input/Output 
-                  - pins : dpget dpset dpcat  
-                  - direction : dpget dpset  
-                  - interrupt : dpget dpset  
-</code> 
- 
- 
-==== Physical Construction and Wiring ==== 
- TBD with final construction 
- 
-==== Linux Configuration ==== 
-We use an ODroid XU4 [[https://ameridroid.com/products/odroid-xu4q-with-passive-heatsink|ODROID-XU4Q]] single board computer as the controller for this project.  Almost any computer will work as long as it has an available USB port. 
- 
-A minimal Linux distribution is appropriate of this simple demo unit so we choose DietPi ([[https://dietpi.com/]]). We added gcc, the libc development headers, an editor (nvi) and the 'daemonize' utility.  We found we did not need to install D-Bus and most of the usual desktop daemons.  Dpdaemon built cleanly following the instructions on the DPI downloads page ([[https://demandperipherals.com/support/downloads.html|Downloads]]). 
- 
-We enabled /etc/rc.local with the following in /etc/systemd/system/rc-local.service. 
-<code> 
-[Unit] 
-Description=/etc/rc.local Compatibility 
-Wants=network-online.target 
-After=network-online.target dietpi-boot.service 
- 
-[Service] 
-Type=forking 
-ExecStart=/etc/rc.local start 
-KillMode=process 
-TimeoutSec=0 
-StandardOutput=tty 
-RemainAfterExit=yes 
- 
-# Hardenings 
-PrivateTmp=false 
-CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE 
-LimitNPROC=10 
-DeviceAllow=/dev/ttyUSB0 rw 
-DeviceAllow=/dev/null rw 
-DeviceAllow=/dev/net/tun rw 
-ProtectSystem=true 
-ProtectHome=read-only 
- 
-[Install] 
-WantedBy=multi-user.target 
-</code> 
- 
-We start our three application program from /etc/rc.local with the following: 
-<code> 
- 
-#!/bin/sh 
-### BEGIN INIT INFO 
-# Provides:          rc.local 
-# Required-Start:    $remote_fs 
-# Required-Stop:     $remote_fs 
-# Default-Start:     2 3 4 5 
-# Default-Stop:      0 1 6 
-# Short-Description: Script to recover nvi edit sessions. 
-### END INIT INFO 
- 
-. /lib/lsb/init-functions 
- 
-/usr/local/bin/dpdaemon -l /etc/dpdaemon/DPCore.bin 
-sleep 5 
-daemonize /usr/local/anchordemo/distance 
-daemonize /usr/local/anchordemo/rgbled 
-daemonize /usr/local/anchordemo/motordemo 
- 
-exit 0 
-</code> 
- 
-==== Applications ==== 
-= distance = 
-= rgbled =  
-= demomotor = 
- 
- 
  
anchordemo.1623097613.txt.gz ยท Last modified: 2021/06/07 20:26 by dpisuperadmin