SPI Slave to PWM Generation

Similar documents
Reference Design RD1103

Panasonic Image Sensor Bridge

Temperature Monitoring and Fan Control with Platform Manager 2

Advanced Features of the ispmach 4000ZE Family

Temperature Monitoring and Fan Control with Platform Manager 2

ice40 Oscillator Usage Guide

Simple Sigma-Delta ADC Reference Design

Implementing VID Function with Platform Manager 2

PNI MicroMag 3. 3-Axis Magnetic Sensor Module. General Description. Features. Applications. Ordering Information

Power Consumption and Management for LatticeECP3 Devices

Power Estimation and Management for LatticeECP2/M Devices

MIPI D-PHY Interface IP

ACPL Data Sheet. Three-Channel Digital Filter for Sigma-Delta Modulators. Description. Features. Specifications.

RFPT Specifications. The CHARON is a SPI controlled high accuracy TCXO with embedded timer and alarm function. Product description

FPGA & Pulse Width Modulation. Digital Logic. Programing the FPGA 7/23/2015. Time Allotment During the First 14 Weeks of Our Advanced Lab Course

Programmable Clock Generator

CAT bit Programmable LED Dimmer with I 2 C Interface DESCRIPTION FEATURES APPLICATIONS TYPICAL APPLICATION CIRCUIT

ZKit-51-RD2, 8051 Development Kit

MicroMag2 2-Axis Magnetic Sensor Module

Figure 1: Functional Block Diagram

Using the High Voltage Physical Layer In the S12ZVM family By: Agustin Diaz

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board

CMOS Serial Digital Pulse Width Modulator INPUT CLK MODULATOR LOGIC PWM 8 STAGE RIPPLE COUNTER RESET LOAD FREQUENCY DATA REGISTER

High Resolution Pulse Generation

Roland Kammerer. 13. October 2010

LP3943/LP3944 as a GPIO Expander

Application Note. Smart LED Dimmer Controlled via Bluetooth AN-CM-225

ABRIDGED DATA SHEET. DS Input, 14-Output, Single DPLL Timing IC with Sub-ps Output Jitter

DS Input, 8-Output, Dual DPLL Timing IC with Sub-ps Output Jitter

PCA bit I 2 C LED driver with programmable blink rates INTEGRATED CIRCUITS May 05. Product data Supersedes data of 2003 Feb 20

PNI Axis Magneto-Inductive Sensor Driver and Controller with SPI Serial Interface. General Description. Features.

CMOS Serial Digital Pulse Width Modulator INPUT CLK MODULATOR LOGIC PWM 8 STAGE RIPPLE COUNTER RESET LOAD FREQUENCY DATA REGISTER

INTEGRATED CIRCUITS. PCA bit I 2 C LED dimmer. Product data Supersedes data of 2003 Feb May 02. Philips Semiconductors

The Frequency Divider component produces an output that is the clock input divided by the specified value.

802.11g Wireless Sensor Network Modules

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

INTEGRATED CIRCUITS. PCA bit I 2 C LED dimmer. Product data sheet Supersedes data of 2004 Sep Oct 01. Philips Semiconductors

CAT bit Programmable LED Dimmer with I 2 C Interface FEATURES DESCRIPTION APPLICATIONS TYPICAL APPLICATION CIRCUIT

Figure 1: Functional Block Diagram

INTEGRATED CIRCUITS. PCA bit I 2 C LED dimmer. Product data Supersedes data of 2003 May Oct 01. Philips Semiconductors

NVA-R661 Radar Module

Low-Power, Low-Glitch, Octal 12-Bit Voltage- Output DACs with Serial Interface

Four Quadrant Speed Control of DC Motor with the Help of AT89S52 Microcontroller

Multi-Channel Digital Up/Down Converter for WiMAX Systems

Utilizing the Trigger Routing Unit for System Level Synchronization

APPLICATION NOTE. AT11009: Migration from ATxmega64D3/128D3/192D3/256D3 Revision E to Revision I. Introduction. Features.

Using Power MOSFETs with Power Manager Devices

MC33596 PLL Tuned UHF Receiver for Data Transfer Applications

Training Schedule. Robotic System Design using Arduino Platform

Low-Jitter I 2 C/SPI Programmable CMOS Oscillator

EVAL-ADM8843. Evaluation Board for Charge Pump Driver for LCD White LED Backlights. Preliminary Technical Data

Programming and Interfacing

Single-wire Signal Aggregation Reference Design

AP 3152 F G - 7. Green G : Green. 7 Tape and Reel Device Package Code (Note 2) AP3152FG-7 F DFN /Tape & Reel -7.

Single Phase Two-Channel Interleaved PFC Operating in CrM Using the MC56F82xxx Family of Digital Signal Controllers

Imaging serial interface ROM

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

Application Note. Low Power DC/DC Converter AN-CM-232

NVA-R631 Radar Module

CHAPTER III THE FPGA IMPLEMENTATION OF PULSE WIDTH MODULATION

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

Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU

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

Review for Final Exam

Graphical Control Panel User Manual

LatticeECP3 I/O Protocol Board to Texas Instruments ADC/DAC Adapter Board User Guide

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

iw Channel LED Driver for LCD Panel Backlighting 1.0 Features 2.0 Description 3.0 Applications

Digital Controller Chip Set for Isolated DC Power Supplies

Digital Systems Design

MAX11300PMB1 Peripheral Module and Munich (USB2PMB1) Adapter Board Quick Start Guide

EE 308 Apr. 24, 2002 Review for Final Exam

FEATURES DESCRIPTION BENEFITS APPLICATIONS. Preliminary PT4501 Sub-1 GHz Wideband FSK Transceiver

CoolEx User Manual 2008 XDIMAX LTD. Revision 1.0

Topics Introduction to Microprocessors

The ST7588T is a driver & controller LSI for graphic dot-matrix liquid crystal display systems. It contains 132 segment and 80

Stratix II Filtering Lab

ELCT 912: Advanced Embedded Systems

MC33696 PLL Tuned UHF Transceiver for Data Transfer Applications

Oct 30 Announcements. Bonus marked will be posted today Will provide 270 style feedback on multiple-choice questions. [3.E]-1

AMS0805WAH. CATALOG No.: AMS0805WAH. Motion Sensor Data Sheet Ver Advanced Material on Technology

DS1065 EconOscillator/Divider

LED controllers. Voltage-switch drivers, constant-current drivers, and Flash LED drivers

PART MAX4584EUB MAX4585EUB TOP VIEW

SSD1607. Product Preview. Active Matrix EPD 200 x 300 Display Driver with Controller

10-Port Constant-Current LED Drivers and I/O Expanders with PWM Intensity Control

EIE/ENE 334 Microprocessors

16-Bit Hardware Pulse Width Modulator Data Sheet

The High-Performance Data Acquisition Circuit

CALIFORNIA SOFTWARE LABS

SZ007A Preliminary Specification

IMPLEMENTATION OF QALU BASED SPWM CONTROLLER THROUGH FPGA. This Chapter presents an implementation of area efficient SPWM

µchameleon 2 User s Manual

ADS9850 Signal Generator Module

Implementation of Multiquadrant D.C. Drive Using Microcontroller

I2C Demonstration Board LED Dimmers and Blinkers PCA9531 and PCA9551

CD4541BC Programmable Timer

2014 Paper E2.1: Digital Electronics II

AN3332 Application note

How to Use the MC33596 Stephane Lestringuez Freescale RF Application Engineer Microcontroller Solutions Group Toulouse, France

Transcription:

April 2011 Introduction Reference Design RD1107 Pulse-width modulation (PWM) uses a rectangular pulse wave whose pulse width is modulated resulting in the variation of the average value of the waveform. Every PWM signal is a continuous succession of high and low pulses. The length of each pulse is defined by the desired duty cycle and frequency. In mobile phones and other consumer electronic products, the Light Emitting Diode (LED) is increasingly being used as a display backlight. PWM offers an ideal solution for LED controllers as the dimming intensity of the LED can be controlled by changing duty cycle and frequency of the pulse. This design provides a bridge between a microprocessor and a PWM generator. The SPI slave interface is used to receive command and data from an external SPI master. The command and data in turn are used to set the frequency and duty cycle of the PWM. In this design the Embedded Function Block (EFB) in the MachXO2 device is used to generate the PWM signal. A typical application of this design includes interfacing a SPI compliant on-board microprocessor and a LED device. This design can also be used as a reference to generate PWM for analog dimming. Figure 1. Top-Level Block Diagram MachXO2 WISHBONE Interface and Custom Logic SPI Interface SPI Slave EFB Timer PWM Out Internal Register Reset Internal Oscillator Features This design provides a bridge between the microprocessor and PWM generator via a SPI slave interface. The features include: Programmable frequency varying from 1 KHz to 100 KHz Programmable duty cycle Built-in look up table (LUT) for frequency and duty cycle counter generation Internal oscillator to generate clock signal 2011 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal. All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice. www.latticesemi.com 1 rd1107_01.0

Functional Description This design consists of three programmable registers for PWM signal generation. These registers are programmed by the microprocessor via the SPI interface. The internal oscillator is used to generate the clock signal for the design. Table 1 lists the I/O ports of the design. Table 1. Pin Descriptions Design Description The design has multiple sub-modules as shown in Figure 1. These modules include logic for SPI Slave, WISH- BONE interface, internal registers, and embedded timer block. The SPI slave can operate with different CPOL, CPHA and DIRECTION settings. The top-level generic sets these parameters. The SPI slave receives a command from the external SPI master. The custom logic then programs the appropriate register in timer block. Table 2 lists the internal registers of the design. These are WRITE only registers. Table 2. Internal Register Table 3 lists descriptions of the internal register bits. Table 3. Internal Register Bits Signal Width Type Description SPI Interface sclk 1 Input Serial clock mosi 1 Input Serial data in miso 1 Output Serial data out SSn 1 Input Slave select PWM Interface Pwm_out 1 Output PWM signal Rst_n 1 Input Master reset Internal Register Address Width Access Description Command 0x00 8 Bits W Control register Frequency 0x01 8 Bits W Frequency for the PWM signal Duty cycle 0x02 8 Bits W Duty Cycle for the PWM signal Name Address Width R/W Purpose Command 0x00 8 Bits W Frequency 0x01 8 Bits W Duty Cycle 0x02 8 Bits W The purpose of this register is to enable or disable the EFB Timer block. Bit[7]: Enable timer block Bit[6]: Disable timer block Bit [5-0]: Reserved for future purpose The purpose of this register is to divide the clock frequency by the programmed value. Bit[7]: Reserved Bit[6:0]: Frequency value 0,1- Frequency will be set to 1 KHz >100- Frequency will be set to 100 KHz Value 1-99 will correspond to frequency between 1 KHz to 100 KHz The purpose of this register is to set duty cycle for the PWM signal. Bit[7]: Reserved Bit[6:0]: Duty cycle Value >100 will correspond to duty cycle of 100% 2

SPI Command Format The SPI slave command format is quite simple. An external SPI Master needs to send the 8-bit register address followed by the data. There are no protocol overheads such as start, stop, status or acknowledgement token/packets associated with SPI transfer. All internal registers are write-only so there is no data present on the MISO line. Register Address Data Common Operation Sequence The design operation sequence is quite simple as well. Using the SPI interface, sequentially program the three internal registers of the design. The design will start driving the PWM output according to the programmed frequency and duty cycle. Figure 2. Flow Start Enable Timer Set Frequency Set Duty Cycle HDL Simulation and Verification The SPI slave based PWM controller design is simulated using a standard SPI master model. The model programs the internal register of the timer-counter block. This model contains tasks for programming various registers in the design. The following timing diagrams show the major timing milestones in the simulation. Figure 3. Programming of the Control Register 3

Figure 4. Programming of the Frequency Register Figure 5. Programming of the Duty Cycle Register Figure 6. PWM Output with Varying Duty Cycle Implementation This design is implemented in Verilog. When using this design in a different device, density, speed, or grade, performance and utilization may vary. Default settings are used during the fitting of the design. Table 4. Performance and Resource Utilization Family Language Speed Grade Utilization f MAX (MHZ) I/Os Architecture Resources MachXO2 1 Verilog -4 389 LUTs >10 6 EFB 1.Performance and utilization characteristics are generated using LCMXO2-640HC-4TG100C, with Lattice Diamond 1.2 design software. 4

References SPI Specification from Freescale Semiconductors WISHBONE interface from OpenCores MachXO2 Family Data Sheet Technical Support Assistance Hotline: 1-800-LATTICE (North America) +1-503-268-8001 (Outside North America) e-mail: techsupport@latticesemi.com Internet: www.latticesemi.com Revision History Date Version Change Summary April 2011 01.0 Initial release. 5