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
anchordemo [2021/12/25 21:44]
dpisuperadmin removed
— (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 a Raspberry Pi 3 single board computer as the controller for this project.  Almost any computer will work as long as it has an available USB port. 
- 
-We start our three application program from /etc/rc.local with the following: 
-<code> 
- 
-/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 
- 
-</code> 
- 
-==== Applications ==== 
-We chose to implement the demo application as three stand-alone application.  We could have as easily made one larger application that managed all sensors, actuators, and UI components.  A tarball with all three applications is available here: {{ :anchordemo.tgz |anchordemo.tgz}} 
- 
-=== distance === 
-The C implementation of the distance application uses blocking reads of the us8 peripheral followed by a write to the lcd6 peripherals with the distance in inches.  The ultrasonic sensor has a wide field of view and so seems a little useless unless the object is close to the sensor.  The relevant dp commands for the distance application are: 
-<code> 
-dpset us8 enable 1 
-dpcat us8 distance 
-dpset lcd6 display %7.1f 
-</code> 
- 
-=== rgbled === 
-The rgbled has two events that affect execution flow.  The first is a reading from the quad potentiometer with a new setting from the user.  The second event is a timeout.  Timeouts cause the mode of operation transition from automatic scrolling to user set RGB values.  A select() is used to capture events from the timer and from the quad slide pot.  A 74HC14 is used as a level translator to convert the 3.3 volt output from the FPGA up to the 4 volt minimum required by the WS2812 (Neopixel) LEDs. The relevant dp commands for the rgbled application are: 
-<code> 
-dpset ws28 config 1 
-dpcat slide4 positions 
-dpset bb4io leds %x 
-dpset ws28 led 4 %x 
-</code> 
- 
-=== motordemo === 
-The motor demonstration application has events from the UI rotary encoder, the quadrature decoder, and from a timer.  The timer turns the motor off 30 seconds after the last input from the rotary encoder.  The lcd6 that displays the motor speed is the second one in the system.  For this reason we have to use its slot number (9) when sending commands to it. The relevant dp commands are: 
-<code> 
-dpset quad2 update_period 50 
-dpcat quad2 counts 
-dpcat roten encoder 
-dpset dc2 mode0 f 
-dpset dc2 mode0 r 
-dpset dc2 power0 %4.1f 
-dpset 9 display %11.5f 
-</code> 
- 
- 
  
anchordemo.1640468652.txt.gz ยท Last modified: 2021/12/25 21:44 by dpisuperadmin