Programming Sequences for the QF1Da512

Similar documents
Programming Sequences for the QF1Da512

Installing FTDI Device Drivers for the QF4A512-DK under Windows XP

QF1Da512 Audio SavFIRe

QF1Da512. Simple and versatile FIR engine (SavFIRe TM ) FEATURES APPLICATIONS DESCRIPTION ORDERING INFORMATION

P R E L I M I N A R Y. Programming the QF4A512 EEPROM

Creating Inverse Transfer Functions with the QuickfilterPro Software

MSP-430 Host Software Example for the QF4A512

QF3DFX Profound Sound Audio Processor High performance, easy to use audio processing

Section 5 SERCOM. Tasks SPI. In this section you will learn:

EDBG. Description. Programmers and Debuggers USER GUIDE

1-4 Figure 1-1 Am186ER Microcontroller Block Diagram. Arrow pointing from control register bus down to the 32-Kbyte RAM box.

Embedded Simply Blue Application Note

USER GUIDE EDBG. Description

AVR42789: Writing to Flash on the New tinyavr Platform Using Assembly

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

USER GUIDE. Wireless Production Test Reference Protocol Specification Document. Atmel MCU Wireless. Description

SAM4 Reset Controller (RSTC)

Getting Started with ESPI Interface Using the Z8 Encore! XP F1680

ESP8266 Application Note Firmware Download Protocol

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

LED Manager for Intel NUC

SPI Overview and Operation

AT03262: SAM D/R/L/C System Pin Multiplexer (SYSTEM PINMUX) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

ED1021 I/O Expander with UART interface & analog inputs

DGILib USER GUIDE Atmel-42771A-DGILib_User Guide-09/2016

LMX9838 Cable Replacement

Ethernet1 Xplained Pro

AN3154 Application note

Image Processing The Easy Way

AT11512: SAM L Brown Out Detector (BOD) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AN2667 Application note

Family 15h Models 00h-0Fh AMD FX -Series Processor Product Data Sheet

APPLICATION NOTE. Atmel AT02260: Driving AT42QT1085. Atmel QTouch. Features. Description

Application Note Software Device Drivers for the M29Fxx Flash Memory Device

QT3 Xplained Pro. Preface. Atmel QTouch USER GUIDE

um-fpu Application Note 7 Developing a SPI Interface for um-fpu V2

A Complete Discussion of the S 2 Cwire Single-Wire Interface With tlat Specification

How to Create a.cibd File from Mentor Xpedition for HLDRC

AMD. Processor Recognition. Application Note

AT60142H/HT. Rad-Hard 512Kx8 Very Low Power CMOS SRAM ERRATA-SHEET. Active Errata List. Errata History. Abbreviations. 1.

Release Notes Compute Abstraction Layer (CAL) Stream Computing SDK New Features. 2 Resolved Issues. 3 Known Issues. 3.

How to Create a.cibd/.cce File from Mentor Xpedition for HLDRC

Native route discovery algorithm

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction

3 Volt Intel StrataFlash Memory to Motorola MC68060 CPU Design Guide

USER GUIDE. ATWINC1500 Xplained Pro. Preface

USER GUIDE. Atmel maxtouch Xplained Pro. Preface

AN2673 Application note

Preliminary Information. AMD-8111 TM HyperTransport TM I/O Hub Revision Guide

AT88CK101 HARDWARE USER GUIDE. Atmel CryptoAuthentication Development Kit. Atmel CryptoAuthentication AT88CK101 Daughterboard

Family 15h Models 10h-1Fh AMD Athlon Processor Product Data Sheet

Family 15h Models 00h-0Fh AMD Opteron Processor Product Data Sheet

One 32-bit counter that can be free running or generate periodic interrupts

USER GUIDE. Atmel OLED1 Xplained Pro. Preface

Intel Cache Acceleration Software for Windows* Workstation

Intel Atom Processor E3800 Product Family Development Kit Based on Intel Intelligent System Extended (ISX) Form Factor Reference Design

For More Information Please contact your local sales office for additional information about Cypress products and solutions.

Using LPC11Axx EEPROM (with IAP)

Application Note C Library Source Code for M29W256 Flash Memory Using the Flash Device Driver Software Interface

TP80301 Data Sheet Copyright SIGMATONE Version 1.0

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

DatasheetDirect.com. Visit to get your free datasheets. This datasheet has been downloaded by

APPLICATION NOTE. Generating Random Secrets. ATSHA204A, ATECC108A, and ATECC508A. Description. Topics

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

AN4113 Application note

Using the SmartDMA Controller with USB on the Am186 CC Microcontroller

Evaluation Board for CS3308. Description CS Channel. Digitally Controlled Analog Volume Control. PC or External Serial Control Input

User's Graphical User Interface(GUI) for LP555x Evaluation Board PowerWise Technology. Compliant Energy Management Unit AN Overview.

AN2676 Application note

AT21CS Series Reset and Discovery. Introduction. Serial EEPROM APPLICATION NOTE

AT10942: SAM Configurable Custom Logic (CCL) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AN10428 UART-SPI Gateway for Philips SPI slave bridges

L6460. SPI configurable stepper and DC multi motor driver. Features. Description

MIC705/706/707/708. General Description. Features. Applications. Typical Application. µp Supervisory Circuit

AN926: Reading and Writing Registers with SPI and I 2 C

AVR32752: Using the AVR32 UC3 Static Memory Controller. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

SCI Driver for the MC9S08GW64

Evaluation Board for CS4344

TECHNICAL PAPER Interfacing the Byte- Wide SmartVoltage FlashFile Memory Family to the Intel486 Microprocessor Family

ED1021 I/O Expander with UART interface & analog inputs

USER GUIDE. Atmel QT6 Xplained Pro. Preface

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents

AMD Processor Recognition. Application Note

CDB5346. Evaluation Board for CS5346. Features. Description CS5346. Single-ended Analog Inputs. Single-ended Analog Outputs

AN2430 Application note

MIC706P/R/S/T, MIC708R/S/T

Multifunction Serial Interface (PDL_MFS) Features. General Description. When to Use a PDL_MFS Component. Quick Start 1.0

OpenCL* and Microsoft DirectX* Video Acceleration Surface Sharing

AN2672 Application note

AN2663 Application note

APPLICATION NOTE. Atmel AVR3009: Driving QTouch Device with I 2 C Interface. Atmel QTouch. Introduction

MIC1832. General Description. Features. Applications. Typical Application

UM1488 User manual. STPMC1 evaluation software. Introduction

APPLICATION NOTE. How to Securely Switch Atmel s LIN Transceiver ATA6662/ATA6662C to Sleep Mode ATA6662/ATA6662C. Concerning Atmel ATA6662

Features. Applications

Sample for OpenCL* and DirectX* Video Acceleration Surface Sharing

APPLICATION NOTE. Atmel QT4 Xplained Pro User Guide ATAN0114. Preface

CAT28C K-Bit Parallel EEPROM

Transcription:

APPLICATION NOTE QFAN023 Programming Sequences for the QF1Da512 1) Introduction The QF1Da512 SavFIRe is an extremely powerful, flexible, and inexpensive FIR engine. It has a straightforward SPI interface that allows it to be easily integrated into most systems. To help facilitate this integration, this document describes a typical programming sequence used to program the chip. It also provides C-code examples that can be used as a basis for programming by a user. This application note is intended to be used in conjunction with the QF1Da512 SavFIRe Datasheet. This Datasheet contains information indirectly referenced in this document. Data such as RSTn timing parameters, logic levels, and SPI timing waveform diagrams are located in the Datasheet. The latest QF1Da512 SavFIRe Datasheet can be downloaded from the main Quickfilter Website. 2) Programming Sequence Only a few simple steps are required to program the QF1Da512 and enable it to begin processing data. Figure 1 below shows such a sequence. Please refer to Figure 1 as needed during the following explanations. It is important that the QF1Da512 be in a known state before attempting access to any of its internal registers. Step 1 must ensure the chip has adequate voltage on its power pins and that its input logic levels are within proper ranges. If RSTn is held low throughout Step 1, then in Step 2 RSTn may simply be deasserted. If RSTn follows VCC high during the application of power, it is necessary to pulse RSTn low for a short amount of time to force all of the QF1Da512 s internal state logic to known values. Step 3 places the QF1Da512 into Configuration Mode and disables filtering. The QF1Da512 powers up in this mode by default, with its dsdo pin tristated, however it is recommended to actively place it into Configuration Mode. Steps 4 and 5 may be swapped, if desired. The coefficients and configuration registers may be programmed in any order. This is true as long as the last register written is the CONFIG register in which the FILT_EN bit is not set until all such programming is complete. Once the FILT_EN bit is set in Step 6, the QF1Da512 will be processing data.

Figure 1 - Programming Sequence for the QF1Da512

3) SPI Timing As stated in the QF1Da512 SavFIRe Datasheet, reading and writing the configuration register or coefficient values requires an SPI sequence consisting of 4 or more bytes (32-bits) of information. Figure 2 below shows the detailed SPI timing diagram. The information is delivered in this order: 8-bit Op Code (indicating a Configuration Read, Configuration Write, Coefficient Read, or Coefficient Write) 6-bit Don t Care Field 8-bit Address to indicate the config register address or coefficient number 2-bit Don t Care Field (used to allow time for the QF1Da512 to respond to read Op-codes 8-bit / 32-bit data fields (depending on if config or coefficient values are being accessed SCLK (i/ p ) Configuration Interface : Read Access Bit # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 CS_ N (i/ p ) SDI( i/ p ) SDO(o/ p ) z 8 -bit read op-code 8- bit address( A 0 ) 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 8 -bit read data (D-A 0 ) 8-bit read data (D-AN) SCLK (i/ p ) Configuration Interface : Write Access Bit # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 CS_ N (i/ p ) SDI( i/ p ) SDO(o/ p ) z 8 - bit write op - code 8- bit address( A 0 ) 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 8 - bit write data ( D - A 0 ) 8 - bit write data ( D - AN ) Figure 2 - Configuration Data Timing 4) Code Examples The following is an example of C-code that will perform the writing of config and coefficient data to the chip. It is derived from actual working C-code. It is assumed the reader is familiar with C-language constructs. This code is for example only and comes as-is. It will need to be adapted to the user s specific processor and system in order for it to be able to function in the user s environment. The code is written in a generic style and doesn t rely on built-in microprocessor hardware (such as an integrated UART of some kind) in order to function.

C-code summary of functions and variables: _QF_file0_SavFIReConfigRegisters _QF_file0_SavFIReCoefficients QF1D512_WriteConfigByte() QF1D512_WriteCoefficients() send_eight() send_sixteen() main() Constant 8-bit array that holds the config register values Constant 32-bit array that holds the coefficient values Function to write a byte to the config space. Address and Data are passed as arguments Function to write all coefficients. Total # of coefficients is passed on the command line. All other information is passed as global variables. Function to write 8-bits of information. Data is stored in the outputbuffer_8bit global variable. Function to write 16-bits of information. Data is stored in the outputbuffer_16bit global variable This is the entrance point of the code. C-code declaration of Configuration Registers and Coefficient Values: /* Begin Initial declarations */ /* Number of elements in SavFIReConfigRegisters. */ #define _QF_file0_NUM_SAVFIRE_REGISTERS 34 /* Number of coefficients in _QF_file0_SavFIReCoefficients */ #define _QF_file0_NUM_SAVFIRE_COEFFICIENTS 4 /* Array of SavFIRe configration values */ const unsigned char _QF_file0_SavFIReConfigRegisters[ _QF_file0_NUM_SAVFIRE_REGISTERS ] = /* Dec Addr Name Description */ /* --- ---- ---- ----------- */ 0x00, /* 000 00 TEST_RW */ 0xC0, /* 192 01 CHIP_ID */ 0x01, /* 001 02 VERSION */ 0x00, /* 000 03 CONTROL */ 0x63, /* 099 04 DCONFIG */ 0x02, /* 002 05 FCONFIG */ 0x06, /* 006 06 NUM_TAPS_0 */ 0x00, /* 000 07 NUM_TAPS_1 */ 0x00, /* 000 08 DECIMATE */ 0x00, /* 000 09 HD_OFFSET */ 0x00, /* 000 0A HD_SIZE */ 0x00, /* 000 0B HD_MASK */ 0x00, /* 000 0C HD_VALUE */ 0x01, /* 001 0D DATA_OFFSET */ 0x18, /* 024 0E DATA_SIZE */ 0x00, /* 000 0F GAIN_0 */ 0x10, /* 016 10 GAIN_1 */ 0xFF, /* 255 11 THRESH_0 */ 0xFF, /* 255 12 THRESH_1 */ 0x00, /* 000 13 MULTI_0 */ 0x10, /* 016 14 MULTI_1 */ 0x00, /* 000 15 ADDOR_0 */ 0x00, /* 000 16 ADDOR_1 */ 0x03, /* 003 17 IO_TST */ 0x05, /* 005 18 IO_RST_N */ 0x01, /* 001 19 IO_DCLK */ 0x01, /* 001 1A IO_DSEL */ 0x01, /* 001 1B IO_DIN */ 0x05, /* 005 1C IO_CS_N */ 0x01, /* 001 1D IO_SCLK */ 0x01, /* 001 1E IO_SDI */ 0x04, /* 004 1F IO_SDO */ 0x04, /* 004 20 IO_DOUT */ 0x40 /* 064 21 TEST */ ; /* Array of SavFIRe coefficient values */ const unsigned long _QF_file0_SavFIReCoefficients[ _QF_file0_NUM_SAVFIRE_COEFFICIENTS ] = /* Num Fractional */ /* --- ---------- */ 0x00763393, /* 000 0.003607222345 */ 0x06C3BB81, /* 001 0.052848279942 */ 0x1F40FC9B, /* 002 0.244170737918 */ 0x330A28A2 /* 003 0.398747519590 */ ;

C-code Main Function: //------- Begin Main C Function -------------------------------------------------- //------- Variables -------------------------------------------------------- uint16_t Number_of_Coefficients; uint8_t Config_Reg_Temp; uint16_t cfg_address; const unsigned char * Config_Reg_array_pointer; const unsigned long * Coeff_array_pointer; const unsigned char * Config_Reg_array_base; // Temporarily holds the config ref info prior to writing to the chip. // This will point at the configuration array. // This will point at the coefficient array. // This holds the base address for a config array. //----- Begin main() Code ------------------------------------------------------------ main() ccsn = 1; RSTn = 0; RSTn = 1; ccsn = 0; Config_Reg_array_pointer = &_QF_file0_SavFIReConfigRegisters[4]; // Reset the chip // Take the chip select low // Point at the configuration register data. // Don t need to write the first 3 values at all. // The CONTROL register will be written later. // In this implementation the config registers are // written first and then the coefficient values. Number_of_Coefficients = _QF_file0_NUM_SAVFIRE_COEFFICIENTS; // Determine how many coefficients we have. QF1D512_WriteConfigByte( 0x03, 0x00 ); // Clear FILT_EN (will be off if chip was just powered up); cfg_address = 4; // write the Configuration registers. for ( i = 4; i < 33; i++) // There are 30 registers used. Config_Reg_Temp = pgm_read_byte(config_reg_array_pointer); QF1D512_WriteConfigByte( cfg_address, Config_Reg_Temp ); Config_Reg_array_pointer = Config_Reg_array_pointer + 1; // Point at the next table entry. cfg_address = cfg_address + 1; // Then write all of the Coefficients. QF1D512_WriteCoefficients(Number_of_Coefficients ); QF1D512_WriteConfigByte( 0x03, 0x01 ); // Set FILT_EN //Take the chip select high. ccsn = 1;

C-code Subroutines: //---- Begin Subroutine Code ------------ //------- Variables -------------------------------------------------------- unsigned char outputbuffer_8bit; unsigned char outputbit_8bit; unsigned int outputbuffer_16bit; unsigned int outputbit_16bit; unsigned long outputbuffer_32bit; unsigned long outputbit_32bit; const unsigned int * Coeff_base_addr; // This will point at the start of each coefficient array const unsigned int * Coeff_array_addr; // This will point at the configuration arrays. extern unsigned int active_config; //Indicates which QF1Da512 is being addressed. //----- Writes a single byte of data to the config space as the passed in Address. void QF1D512_WriteConfigByte( unsigned int Address, unsigned char Value ) // Put the Write-Configuration-Byte opcode into the 8-bit output buffer. outputbuffer_8bit = 0x82; // Put Configuration Register address into output buffer. outputbuffer_16bit = Address; // Left shift the address 2 bits, since only 14 are needed. outputbuffer_16bit = outputbuffer_16bit << 2; // Take the chip select low. ccsn = 0; // First shift out the Write-opcode bits on the appropriate pin with SCLK toggling. send_eight(); // Next shift out the Configuration Byte Address bits on the appropriate pin with SCLK toggling. send_sixteen(); // Lastly, shift out the Configuration Byte Data on the appropriate pin with SCLK toggling. outputbuffer_8bit = Value; //Load the data into the buffer. send_eight(); // Take SCLK low // Take ccsn high. ccsn = 1;

//--------- Writes all coefficients to the chip -------- void QF1D512_WriteCoefficients( unsigned int Length ) unsigned int i; unsigned int j; // Put the WRITE Coefficient Byte opcode into the 8-bit output buffer. outputbuffer_8bit = 0x86; // Put the first Coefficient Register address into output buffer. outputbuffer_16bit = 0x0000; // Left shift the address 2 bits, since only 14 are needed. outputbuffer_16bit = outputbuffer_16bit << 2; // Take the chip select low. ccsn = 0; // First shift out the WRITE opcode bits on the appropriate pin with SCLK toggling. send_eight(); // Next shift out the Coefficient Byte Address bits on the appropriate pin with SCLK toggling. send_sixteen(); Coeff_base_addr = &_QF_file0_SavFIReCoefficients[0]; //Point at Coeff 0 space. Coeff_array_addr = Coeff_base_addr; for (j = 0; j < Length; j++) outputbuffer_32bit = _QF_file0_SavFIReCoefficients[j]; Coeff_array_addr = Coeff_array_addr + 0x0001; // Load the coefficient into a temporary variable. // A pointer will increment to the next element // Send the 32-bit coefficient word (expanded from 16 bits). for (i = 0; i < 32; i++) outputbit_32bit = (outputbuffer_32bit & 0x80000000); outputbit_32bit = outputbit_32bit >> 31; // Send off the bit. //Take the next bit to be transmitted. // JS - don't need this line of code //Take SCLK low. if (outputbit_32bit == 0) csdi = 0); //Take MOSI low. else csdi = 1; //Take MOSI high. //Take SCLK low csck = 1; outputbuffer_32bit = outputbuffer_32bit << 1; //Take SCLK high. //Move the next bit into the MSb //Take ccsn high. ccsn = 1; //-------- Writes 8 bits of data (stored in the outputbuffer_8bit global variable) to the chip void send_eight() uint8_t m; // First shift out the WRITE opcode bits on the appropriate pin with SCLK toggling. for (m = 0; m < 8; m++) outputbit_8bit = (outputbuffer_8bit & 0x80); //Take the next bit to be transmitted. outputbit_8bit = outputbit_8bit >> 7; // Send off the bit. //Take SCLK low. if (outputbit_8bit == 0) csdi = 0; //Take MOSI low. else csdi = 1; //Take MOSI high. csck = 1; outputbuffer_8bit = outputbuffer_8bit << 1; //Take SCLK high. //Move the next bit into the MSb

//-------- Writes 16 bits of data (stored in the outputbuffer_16bit global variable) to the chip void send_sixteen() uint8_t k; for (k = 0; k < 16; k++) outputbit_16bit = (outputbuffer_16bit & 0x8000); //Take the next bit to be transmitted. outputbit_16bit = outputbit_16bit >> 15; // Send off the bit. //Take SCLK low. if (outputbit_16bit == 0) csdi = 0; //Take MOSI low. else csdi = 1; //Take MOSI high. csck = 1; outputbuffer_16bit = outputbuffer_16bit << 1; //Take SCLK high. //Move the next bit into the MSb

Contact Information: Quickfilter Technologies, Inc. 1024 S. Greenville Avenue, Suite 100 Allen, TX 75002-3324 General:info@quickfilter.net Applications:apps@quickfilter.net Sales:sales@quickfilter.net Phone:214-547-0460 Fax:214-547-0481 The contents of this document are provided in connection with Quickfilter Technologies, Inc. products. Quickfilter makes no representations or warranties with respect to the accuracy or completeness of the contents of this publication and reserves the right to make changes to specifications and product descriptions at any time without notice. No license, whether express, implied, arising by estoppel or otherwise, to any intellectual property rights is granted by this publication. Except as set forth in Quickfilter's Standard Terms and Conditions of Sale, Quickfilter assumes no liability whatsoever, and disclaims any express or implied warranty, relating to its products including, but not limited to, the implied warranty of merchantability, fitness for a particular purpose, or infringement of any intellectual property right. Quickfilter's products are not designed, intended, authorized or warranted for use as components in systems intended for surgical implant into the body, or in other applications intended to support or sustain life, or in any other application in which the failure of Quickfilter's product could create a situation where personal injury, death, or severe property or environmental damage may occur. Quickfilter reserves the right to discontinue or make changes to its products at any time without notice. 2009 Quickfilter Technologies, Inc. All rights reserved. Quickfilter, the Quickfilter logo and combinations thereof, are trademarks of Quickfilter Technologies, Inc. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies.