Posts

Showing posts from May, 2017

Adam Taylor MicroZed Chronicles: Issue 106 Interrupt Latency Part 2

Image
Continuing with Adam Taylor's tutorials in his MicroZed Chronicles on the XADC. This post relates to issue 106, which can be found using the link at the bottom of the page. What I learned from Adam's Tutorial: This tutorial is a continuation of issue 105. Here, the interrupt latency we will be measuring is the time required to start executing the ISR. We left off in Vivado having just created the Bitstream. Now we are ready to move into SDK. Export Hardware > Check Include Bitstream > Launch SDK Once in SDK: File > New > Board Support Package > Finish File > New > Application Project > Hello World > Finish Copy and paste in the .C file from Adam Taylor's github (https://github.com/ATaylorCEngFIET/MicroZed-Chronicles) and replace it with helloworld.c and SAVE IT. Next launch minicom > Program FPGA > Run You should see something similar to this within minicom:   This is reading the value on the AXI Timer as soon as the ...

Adam Taylor MicroZed Chronicles: Interrupt Latency

Image
Continuing with Adam Taylor's tutorials in his MicroZed Chronicles on the XADC. This post relates to issue 105, which can be found using the link at the bottom of the page. What I learned from Adam's Tutorial: Interrupt Latency: The time between the interrupt being raised and the interrupt being serviced. Once a signal is in the XADC and the Zynq SoC, it is necessary to ensure that the application has been designed properly to meet the requirements and perform in the way intended. Interrupt latency plays a major role in performance.  Some issues that can impact interrupt latency are: The presence of an operating system The complexity of the ISR (Interrupt Service Routine) If interrupt latency is not considered, the application could fail depending upon the latency period, latency consistency and the time taken for the ISR. If latency is too great or ISR execution is too long, events can be missed. When this happens, it results in an unreliable system with sp...

Adam Taylor Microzed Chronicles: XADC with Real World Signals

Continuing with Adam Taylor's tutorials in his MicroZed Chronicles on the XADC. This post relates to issue 104, which can be found using the link at the bottom of the page. What I learned from Adam's Tutorial: An XADC is used to read in an analog signal and process the information. To interface with the XADC an AXI interface is needed Interface Options Include:  Connecting with an AXI4-Lite Interface Adding an AXI streaming interface to add further signal processing (like the FIR Filter) The first choice that needs to be made is the selection of the input pins The XADC has two dedicated differential input pins, Vp and Vn, which can be used to sample analog signals. There are also 16 auxiliary inputs that can be used. These have a lower FRBW (Full Resolution Bandwidth) of 250 kHz whereas the dedicated inputs have an FRBW of 500 kHz . If using signals near the max Nyquist frequency, use the dedicated  inputs.  If there are more than one signal ...

Adam Taylor MicroZed Chronicles: XADC Alarms and Interrupts

Image
Continuing with Adam Taylor's tutorials in his MicroZed Chronicles on the XADC. This post relates to issue 43, which can be found using the link at the bottom of the page. What I learned from Adam's Tutorial: The Zynq SoC has the ability to monitor its own supply voltages and temperature. We can use this ability to verify the initial supply voltages and operating temperature. We can also check to ensure that the parameters remain within the specified ranges throughout operation.  This can help us to determine if the Zynq SoC's environment has any problems that could possibly result in a failure over time. An example could be a drifting power supply. The SoC has a number of maskable interrupts that can interrupt the 2 on-chip ARM processors if an alarm parameter exceeds its range. A maskable interrupt can be disabled by the programmer, so if an interrupt happens, the CPU can ignore it and not have to respond. Above definition from: https://www.quora....

Adam Taylor MicroZed Chronicles: XADC

Image
Adam Taylor has multiple tutorials in his MicroZed Chronicles on the XADC. This post relates to issue 7 and 8. These can be found using the link at the bottom of the page. What I learned from Adam's Tutorials: The Zynq SoC's XADC block contains two 12-bit ADC inputs with additional input channels connected to on-chip voltages and temp sensors.   The XADC is capable of unipolar (only + or only -) or bipolar (both + and - range) measurements. Each analog input is differential. The 17 differential inputs are split between one dedicated analog input pair (VP/VN) and 16 auxiliary inputs that can be configured as either analog or digital I/O pins (VAuxP/VAuxN). The effective input signal band width depends on which input is being utilized VP/VN = 500kHz Axiliary = < 251kHz To add the XADC to the Block Diagram Add the Zynq Processing System and the XADC Wizard then run the block automation and the connection automation. It should look similar to the picture b...

ADC/DAC and Digital Audio Processing

https://embeddedcentric.com/adc-dac-and-digital-audio-processing/ LAB 8 ***Helpful Note: The tutorial doesn't specify this, but you will need minicom open when running the program. Also if a warning appears after you have created the HDL wrapper you should be okay to continue anyway. Summary: In this lab, we use the ADAU1761 audio codec chip (coder-decoder) mounted on the Zed board, to output different pitches using the switches. Inside the codec are two ADCs, Right Channel and Left Channel, that we used to sample audio. The NCO generates samples of the sine waves at the designated frequencies and these samples are superpositioned and sent to the DACs through the I2S bus, so that they can be played on the speaker. ADAU1761 is and audio codec chip located on the Zedboard used for audio processing. Used for acoustic purposes (playing, recording, processing). The sample frequency is generated by the PLL logic which is driven by a master clock supplied by an external s...

Problem Running on FPGA

If you encounter a problem where you are unable to run a program on the FPGA board after it has been programmed, here are some things to try: 1) Instead of right clicking on the folder --> Run As --> Launch on Hardware GDB, try running it using the green play button at the top of SDK 2) If you are still unable to run, try relaunching SDK from Vivado and run it again.

Hexadecimal Review

Base 16 number system using 16 digits Each place is a power of 16 0 1 2 3 4 5 6 7 8 9 A B C D E F A - 10 B - 11 C -12 D - 13 E - 14 F - 15 231 in hexadecimal: E7 (E sixteens + 7 ones) = 14*16 + 7*1 = 231

DMA (Direct Memory Access controller) and Animation

https://embeddedcentric.com/dma-and-animation/ This lab reviews how to transfer data in and out of memory. More specifically, we are able to transfer bitmap frames of a character to the display controller memory region (the OLED screen on the Zedboard). We then were able to manipulate the C code to move the character according to the push buttons. The DMAC we are utilizing uses the AXI bus to perform transfers between the system memories and the Zynq programmable logic. This lab uses 2 bitmaps that are slightly different, and when showed on the OLED screen sequentially it looks as if the legs of the image are moving, making it animated. There are 12 frames in the all_frames file, which we can upload directly. The DMA controller swaps between the two bitmaps in the frames to make the animation appear to be moving.  A Timer is used to time the period of transferring to a new frame.   To make the animation move, OLED is thought of as a 2-D screen, and e...

Miscellaneous Linux Code

#!/bin/bash sudo /home/pi/MMA8451cpp/mma8451/setup.sh killall -9 read8451 sleep 10 /home/pi/MMA8451cpp/mma8451/read8451 > /home/pi/acceleration/data/`date +\%Y-\%m-\%d_\%H:\%M:\%S` 2> /home/pi/acceleration/data/`date +\%Y-\%m-\%d_\%H:\%M:\%S`.log This kills the running code, gives it some time to kill and then begins running it again. The arrows (>) are used to send data to different folders/files. Output gets sent to one and error to another.

Helpful Terminal Commands

Common Terminal Commands: cd ~  ---> Brings you back home pwd ---> Outputs the name of the current working directory (tells you where you  are) ls ---> Lists what is in the directory ls -a ---> Lists all the contents even what is hidden cd ---> Switches you into the directory you specify (cd bin, brings you into bin) mkdir --->  Creates a new directory in the working directory touch ---> Creates a new file inside the working directory control a ---> Brings you to the front of the command To kill/quit a program that is frozen, open the terminal and cd out of home. Once out of home, type the command xkill . You can know force close any window or program by clicking on it once with the mouse.

Binary Count on LEDs Where Buttons Control Directon and Speed

https://embeddedcentric.com/zedboard-tutorials/ Follow the tutorial for lab 1 in the link provided above. The LEDs display a binary count from 1 to 255 (00000001 to 11111111) and the buttons control the speed and direction of the counting. Helpful Hints and Clarifications: H Step 2 --> Site = Package Pin                 I/O std                                    T18                        LVCMOS25                                    R18 ...

C Coding

MIT course for Practical Programming in C for electrical engineers This is a two course sequence Course 1:   https://ocw.mit.edu/courses/ electrical-engineering-and- computer-science/6-087- practical-programming-in-c- january-iap-2010/ Course 2:   https://ocw.mit.edu/courses/ electrical-engineering-and- computer-science/6-088- introduction-to-c-memory- management-and-c-object- oriented-programming-january- iap-2010

Learning Matlab Helpful Links

Frederik  J Simons Princeton: Youtube Videos http://serc.carleton.edu/matlab_computation2016/essays/159977.html Mathworks MATLAB Onramp: Interactive https://matlabacademy.mathworks.com/

Minicom

Minicom is an application like gtkterm and putty. To install: 1. In the terminal type: 'sudo apt-get install minicom' 2. Type Y to continue with the download 3. To connect to the FPGA, type the following command: 'sudo minicom -D /dev/ttyACM0 -b 115200 -8 -o'

Helpful Links for using FPGAs

The links below provide helpful information and tutorials on the ADC: 1) https://embeddedcentric.com/zedboard-tutorials/ This link provides multiple step by step tutorials using the Zedboard. Lab 8 specifically, ADC/DAC and Digital Audio Processing, which provides an in depth explanation of how the embedded ADC and DAC function. Analog to digital converters (ADC) are used to digitize audio signals and digital to analog converters (DAC) convert the stream of digital values into an analog signal, and this newly constructed analog signal could be sent to a speaker for playing. It provides an in depth tutorial for using the ADAU1761 audio Codec (coder-decoder) chip that is mounted on the Zedboard and used for audio processing such as, playing, recording, and processing. This lab makes it so that the switches control different pitches.   2) https://www.trosteltech.com/20 16/09/13/an-fpga-tutorial-usin g-the-zedboard-beyond-circuits / This link provides 27 tutorials f...

Getting Started: Switching from Windows to Ubuntu and Downloading Vivado

Switching from CentOS 6 to Ubuntu: 1. Shut down the computer and unplug the Windows hard drive. 2. Restart computer, if CentOS opens you unplugged the correct hard drive. 3. Put Ubuntu CD in the disk drive. 4. Restart computer again, and when 'Dell' pops up on the screen, press and hold down the F12 key. This switches from CentOS to Ubuntu. 5. When prompted, Download and Install. 6. Check both boxes. 7. Under Erase disk, check 'use LVM', and install now. 8. Use New York area, and English. 9. Name the computer, and create a password. Your username will be provided. 10. When finished restart computer and remove the disk. Hit enter. To Download Vivado Design Suite: Use the following link to locate the download: https://www.xilinx.com/support/download.html 1. Choose Vivado Design Suite - HLx Editions for Linux 2. Log in and follow steps provided. 3. Once downloaded open the terminal to run the .bin file. 4. Type the following commands:      ...