Lab 2.2 Custom slave programmable interface

Similar documents
Lab 1.2 Joystick Interface

Lab 1.1 PWM Hardware Design

DASL 120 Introduction to Microcontrollers

ZKit-51-RD2, 8051 Development Kit

FPGA-Based Autonomous Obstacle Avoidance Robot.

Using an FPGA based system for IEEE 1641 waveform generation

Design and Simulation of Universal Asynchronous Receiver Transmitter on Field Programmable Gate Array Using VHDL

EECS 192: Mechatronics Design Lab

Project Name Here CSEE 4840 Project Design Document. Thomas Chau Ben Sack Peter Tsonev

SV613 USB Interface Wireless Module SV613

Training Schedule. Robotic System Design using Arduino Platform

Homework 9: Software Design Considerations

Digital Systems Design

Web-Enabled Speaker and Equalizer Final Project Report December 9, 2016 E155 Josh Lam and Tommy Berrueta

I hope you have completed Part 2 of the Experiment and is ready for Part 3.

Hello, and welcome to this presentation of the STM32G0 digital-to-analog converter. This block is used to convert digital signals to analog voltages

Applications. Operating Modes. Description. Part Number Description Package. Many to one. One to one Broadcast One to many

Digital Logic Troubleshooting

Debugging a Boundary-Scan I 2 C Script Test with the BusPro - I and I2C Exerciser Software: A Case Study

TLE9879 EvalKit V1.2 Users Manual

CHAPTER III THE FPGA IMPLEMENTATION OF PULSE WIDTH MODULATION

RF4432 wireless transceiver module

USB Port Medium Power Wireless Module SV653

Project Final Report: Directional Remote Control

Embedded Radio Data Transceiver SV611

EECE494: Computer Bus and SoC Interfacing. Serial Communication: RS-232. Dr. Charles Kim Electrical and Computer Engineering Howard University

Meshreen MS5168 ZigBee Module MS5168-Mxx series USER MANUAL FCC ID :2AC2E-68M04

Iowa State University Electrical and Computer Engineering. E E 452. Electric Machines and Power Electronic Drives

SMARTALPHA RF TRANSCEIVER

Digital Logic ircuits Circuits Fundamentals I Fundamentals I

Ultrasonic Positioning System EDA385 Embedded Systems Design Advanced Course

Lesson UART. Clock Systems and Timing UART (Universal Asynchronous Receiver-Transmitter) Queues Lab Assignment: UART

Exercise 5: PWM and Control Theory

UART2PPM. User s Guide. Version 2.04 dated 02/20/16. Gregor Schlechtriem

Stratix II Filtering Lab

LAX016 Series Logic Analyzer User Guide

Datasheet DS0011 AM093 Wireless Meter-Bus Dual Band 169/868MHz Narrowband Modem Advance Information Production Status Production

32-bit ARM Cortex-M0, Cortex-M3 and Cortex-M4F microcontrollers

JTAG pins do not have internal pull-ups enabled at power-on reset. JTAG INTEST instruction does not work

INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES

Cyclone II Filtering Lab

Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs.

3.3V regulator. JA H-bridge. Doc: page 1 of 7

DNT2400. Low Cost 2.4 GHz FHSS Transceiver Module with I/O

VBRC 5. Radio Communicator. Installer Manual

Development of Software Defined Radio (SDR) Receiver

DESCRIPTION DOCUMENT FOR WIFI SINGLE DIMMER ONE AMPERE BOARD HARDWARE REVISION 0.3

FPGA-BASED PULSED-RF PHASE AND AMPLITUDE DETECTOR AT SLRI

Motor Control using NXP s LPC2900

Catalog

ST600 TRANSMITTER OPERATING INSTRUCTIONS

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

SC16A SERVO CONTROLLER

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

MIPI VGI SM for Sideband GPIO and Messaging Consolidation on Mobile System

Ocean Controls KT-5221 Modbus IO Module

MILFORD INSTRUMENTS Limited

CMU232 User Manual Last Revised October 21, 2002

Dynamic Wireless Decorative Lights

D16550 IP Core. Configurable UART with FIFO v. 2.25

2014, IJARCSSE All Rights Reserved Page 459

Blackfin Online Learning & Development

DNT900. Low Cost 900 MHz FHSS Transceiver Module with I/O

Wide Range Voltage to Frequency Converter using PSoC3 Microcontroller

Temperature Monitoring and Fan Control with Platform Manager 2

RF NiceRF Wireless Technology Co., Ltd. Rev

EECS150 Spring 2007 Lab Lecture #5. Shah Bawany. 2/16/2007 EECS150 Lab Lecture #5 1

CHAPTER 4 GALS ARCHITECTURE

AN 761: Board Management Controller

DS1075. EconOscillator/Divider PRELIMINARY FEATURES PIN ASSIGNMENT FREQUENCY OPTIONS

DESCRIPTION DOCUMENT FOR WIFI / BT HEAVY DUTY RELAY BOARD HARDWARE REVISION 0.1

RF4432PRO wireless transceiver module

Catalog

Stratix Filtering Reference Design

LaserPING Rangefinder Module (#28041)

FPGA-based PID Controller Using SOPC Technology for DC Motor Speed Control

DS1075 EconOscillator/Divider

Serial Servo Controller

Triscend E5 Support. Configurable System-on-Chip (CSoC) Triscend Development Tools Update TM

Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU

Temperature Monitoring and Fan Control with Platform Manager 2

R Using the Virtex Delay-Locked Loop

TMS320F241 DSP Boards for Power-electronics Applications

MBI5051/MBI5052/MBI5053 Application Note

Hello, and welcome to this presentation of the STM32 Digital Filter for Sigma-Delta modulators interface. The features of this interface, which

Exercise 3: Serial Interface (RS232)

Serial Input/Output. Lecturer: Sri Parameswaran Notes by: Annie Guo

Laboration: Frequency measurements and PWM DC motor. Embedded Electronics IE1206

OPP;SLARSEN;MVO;JFR;SSE;CRASMUSSEN;BBR BBR;CRASMUSSEN;MHANSEN;JFR. Date CET Initials Name Justification

Single-wire Signal Aggregation Reference Design

a6850 Features General Description Asynchronous Communications Interface Adapter

RS-232 Electrical Specifications and a Typical Connection

Jaguar Motor Controller (Stellaris Brushed DC Motor Control Module with CAN)

Catalog

Controlling DC Brush Motor using MD10B or MD30B. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

FPGA Implementation of a PID Controller with DC Motor Application

Computer Architecture Laboratory

Mechatronics Laboratory Assignment 3 Introduction to I/O with the F28335 Motor Control Processor

Characteristic Sym Notes Minimum Typical Maximum Units Operating Frequency Range MHz. RF Chip Rate 11 Mcps RF Data Rates 1, 2, 5.

Transcription:

Lab 2.2 Custom slave programmable interface Introduction In the previous labs, you used a system integration tool (Qsys) to create a full FPGA-based system comprised of a processor, on-chip memory, a JTAG UART (the serial port used for standard output), and a simple programmable interface, the parallel input/output (PIO) port. In lab 2.0 you used a pre-existing standard PIO IP component. In lab 2.1 you created and used your own custom PIO IP component. Now that you know how to use all the tools, we are going to shift our focus towards creating more specialized IP components. Goal The goal of this lab is for you to design 1 of the following custom slave IP components: PWM Pulse Width Modulation Easy RTC Real-Time Clock Intermediate WS2812 Intermediate UART Universal Asynchronous Receiver Transmitter Hard You will then package your custom slave module as an IP component in Qsys and add it to a base Qsys system containing the following components: Nios II/e processor 128kB on-chip memory JTAG UART The processor will then access and program your IP component as needed to control an external peripheral. 1

Theory Documentation & Block diagrams A key part of this Embedded Systems course is learning to be autonomous. This is very important in industry as you will often be asked to implement a certain subsystem all by yourself. However, there come times when you will have to collaborate with others on your specific components, and it is therefore important to have clear documentation available such that the other parties can fully understand your ideas. Three diagrams are mandatory parts of any documentation: the block diagrams of the Full system (processor, memory, interconnect, peripherals, ) Custom IP component & its register map Top-level connections between your custom IP and the development board s pins The diagram of the full system is necessarily a high-level one, whereas the diagram of the custom IP component is a low-level one describing how the various components of your IP interact with each other. We insist that, before you start coding anything, you first create these block diagrams. The reason is simple: if you are stuck and have difficulty debugging something in your design, the very first thing the TAs will ask is to see the system and custom component s block diagrams. These schematics need to be available so we can understand the design you had in your head and to grasp all the assumptions you have about the design. We will not be able to help you unless you have these block diagrams ready and up-to-date with the code you are debugging (the same is true in industry). Clock Dividers No matter which peripheral you choose to design, you would need to supply it with a slow clock signal that is much lower than the 50 MHz oscillator available by default on the development board. Students generally make the mistake of generating a clock by using logic inside the FPGA. For example, to generate a clock that runs 3x slower than clk_in, they would generate the clk_out waveform shown in Figure 1 and connect the systems as shown in the schematic. FIGURE 1. Incorrect CLOCK DIVIDER (3X) 2

However, this is not the correct way to do things on FPGAs. Indeed, clock signals are routed through special channels to guarantee that the clock arrives at all components roughly at the same time (avoids clock skew). If you instead decide to create a clock manually by using logic within the FPGA, your clock will not be routed on the dedicated clock channels and will suffer from clock skew, therefore causing all logic driven by the custom clock to be unstable. The correct way to generate slow clocks in FPGAs is to not generate a clock, but to instead generate a clock divider. A clock divider is a component that periodically generates a pulse which is then fed to the slower components. Figure 2 shows an example waveform and schematic of a correct divider that divides the clock frequency by 3. FIGURE 2. Correct CLOCK DIVIDER (3X) Each component that requires a slow clock takes as input the standard clock of the FPGA (the one correctly routed through dedicated clock channels) along with the enable_out pulse generated by the clock divider. This pulse acts as an activation signal and triggers the operation of a component requiring a slow clock. For example, you can use the clock divider make a component behave as if it had a slow clock by writing its VHDL as shown below: process(clk) begin if rising_edge(clk) then if enable_out = 1 then -- insert your slow clock logic here end if; end if; end process; 3

Practice PWM Pulse Width Modulation You must construct an Avalon slave peripheral that is capable of outputting a PWM signal. Your component must support a programmable Period Duty cycle Polarity Figure 3 shows the relation between the period and the duty cycle. FIGURE 3. PWM WAVEFORMS [1] You will test your PWM implementation by connecting your IP component a servomotor and programming the period, duty cycle and polarity of the module accordingly. 4

RTC Real-Time Clock You must construct an Avalon slave peripheral that is capable of outputting an RTC on a 6-digit 7-segment display. The display we use in this lab is shown in Figure 4 and is connected to GPIO_1 on the DE0-Nano-SoC. FIGURE 4. 6-DIGIT 7-SEGMENT DISPLAY Your component must support 1 of the programmable display options below: Hours, minutes, seconds. Minutes, seconds, 1/100 seconds. You will need the module s schematic to see how the 7-segment displays are connected to the various pins on the board. The 6 displays are controlled by 3 signals: SelSeg[7.. 0] selects the which of the 7 segments (and 1 decimal point) available in each display are to be active. This signal is active-high. nseldig[5.. 0] selects which of the 6 displays are to be enabled. This signal is active-low. Reset_Led clears the accumulated charge on all displays. This signal is active-high. The procedure for displaying a digit on one of the displays is as follows: Enable 1 display using nseldig. Hold a bit pattern on SelSeg for some time to allow a charge to accumulate. Activate the Reset_Led signal to clear all displays. Note that only 1 display can be active at a time, so in order to display a value correctly on the 6 displays, you will need to periodically perform the steps above for each display. The refreshing frequency of the displays needs to be sufficiently low for enough charge to accumulate in each display (to have good brightness) and high enough for the human eye not to see any flickering (due to the periodic charge reset). A good refresh cycle is 1 ms and a good hold time is 1/6 ms. You will find the top-level VHDL file and pin assignment script for the extension board in the project template. 5

WS2812 You must construct an Avalon slave peripheral that is capable of controlling the WS2812 intelligent LED controller. This controller is used in numerous daisy-chained multi-color LEDs, some of which are shown in Figure 5. FIGURE 5. PRODUCTS USING THE WS2812 [2] The interface used by this component is too specific to detail in this lab statement, so we refer you to its datasheet (which you will have to read anyways ). UART This is a harder exercise than the other peripherals to implement. Warriors only, you have been warned! The UART protocol is a 2-pin serial communication protocol used extensively in embedded systems. For example, it is the protocol used when your Nios II processor calls the printf() function and you see the result transmitted back to your host PC s terminal. A simplified introduction to the UART protocol can be found at Electric Imp. FIGURE 6. EXAMPLE UART SIGNALING [3] 6

For this exercise you must construct an Avalon slave peripheral that is capable of sending and receiving data through the UART protocol. To test your IP component, you will connect your host PC to your peripheral s RX and TX pins through a USB-to-UART cable, and perform some communication. The communication consists of a simple calculator application where your host PC sends arithmetic expressions (additions only) to the Nios II processor through the UART peripheral and the Nios II will reply back with the answer that is to be displayed on the host PC s console. To use a UART console on your host PC, you can use either Teraterm (Windows), Putty (Windows), or minicom (Linux/Mac). Don t forget to configure the terminal for the correct baud rate, parity, as needed. Again, warriors only! FIGURE 7. EXAMPLE UART CALCULATOR. References [1] protostack, [Online]. Available: http://d32zx1or0t1x0y.cloudfront.net/2011/06/atmega168a_pwm_02_lrg.jpg. [2] Adafruit, [Online]. Available: https://cdn-shop.adafruit.com/970x728/1463-03.jpg. [3] electric imp, [Online]. Available: https://electricimp.com/docs/attachments/images/uart/uart3.png. 7