AN-812 APPLICATION NOTE



Similar documents
EasyPIC4 User s Manual

Switch board datasheet EB

PICNet 1. PICNet 1 PIC18 Network & SD/MMC Development Board. Features. Applications. Description

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

WICE-SPI Hardware Operation Manual

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

Introduction. Getting familiar with chipkit Pi

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

CHAPTER 11: Flip Flops

Fondamenti su strumenti di sviluppo per microcontrollori PIC

LED board datasheet EB

ic-mq EVAL MQ1D EVALUATION BOARD DESCRIPTION

EVAL-AD5390/91/92EB. Evaluation Board for 8-/16-Channel, 12-/14-Bit, Serial Input, Voltage-Output DACs

CAN bus board. EB018

Evo Laser Firmware Developer s Manual

K8048 PIC PROGRAMMER BOARD

DSO138 oscilloscope program upgrade method

Part Number Description Packages available

Wireless Temperature

EVAL-AD5680. Single Channel, 18-Bit, Serial Input, Voltage Output DAC Evaluation Board FEATURES GENERAL DESCRIPTION

Tire pressure monitoring

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

Accurate Measurement of the Mains Electricity Frequency

An Introduction to MPLAB Integrated Development Environment

High-Speed, 5 V, 0.1 F CMOS RS-232 Driver/Receivers ADM202/ADM203

MAX6683 Evaluation System/Evaluation Kit

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

DS2149DK/DS21349DK T1/J1 Line Interface Unit Design Kit

DS1621 Digital Thermometer and Thermostat

40-Segment 2.54 pitch LED Bar Display Board User s Guide

FLYPORT Wi-Fi G

AD9741/3/5/6/7 Evaluation Board Quick Start Guide

Using Xbee in Serial Communication

Introduction to PIC Programming

RN-131-PICTAIL & RN-171-PICTAIL Web-Server Demo Application

css Custom Silicon Solutions, Inc.

US-SPI New generation of High performances Ultrasonic device

Wireless Security Camera

Getting Started with PIC24F/PIC24H Programming and Interfacing in C

Information Board User s Guide

Part 1. MAX BIT DAC with an Arduino Board. MIDI to Voltage Converter Part1

DS1621 Digital Thermometer and Thermostat

ET-BASE AVR ATmega64/128

Using Altera MAX Series as Microcontroller I/O Expanders

Section 28. In-Circuit Serial Programming (ICSP )

RN-131-PICTAIL & RN-171-PICTAIL Evaluation Boards

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

Chapter 13. PIC Family Microcontroller

Evaluation Board for the AAT1275 Boost Converter with USB Power Switch

Design and Construction of Variable DC Source for Laboratory Using Solar Energy

TS5010 TeraTune Programmable Bandpass Filter

EVAL-UFDC-1/UFDC-1M-16

Introducing AVR Dragon

USB I/O CONTROL BOX 8 relays, 8 digital I/O lines and 8 HV inputs

MFRD52x. Mifare Contactless Smart Card Reader Reference Design. Document information

Designing VM2 Application Boards

Precision, Unity-Gain Differential Amplifier AMP03

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

ADXL345-EP. 3-Axis, ±2 g/±4 g/±8 g/±16 g Digital Accelerometer. Enhanced Product FEATURES GENERAL DESCRIPTION ENHANCED PRODUCT FEATURES APPLICATIONS

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Analog-to-Digital Converters

MOD-ENC28J60 development board Users Manual

Tutorial for MPLAB Starter Kit for PIC18F

Processor Extension Pak and Header Specification

Controller for AD9850 DDS Modules Andy Talbot G4JNT

Serial Input, Voltage Output 12-/14-Bit Digital-to-Analog Converters AD5530/AD5531

LTC Channel Analog Multiplexer with Serial Interface U DESCRIPTIO

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT BIT DIFFERENTIAL ADC WITH I2C LTC2485 DESCRIPTION

NJU6061. Full Color LED Controller Driver with PWM Control GENERAL DESCRIPTION PACKAGE OUTLINE FEATURES

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

+Denotes lead-free and RoHS-compliant. C5 C10, C17, C18

DS1307ZN. 64 x 8 Serial Real-Time Clock

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

8 by 8 dot matrix LED displays with Cascadable Serial driver B32CDM8 B48CDM8 B64CDM8 General Description

Lab Experiment 1: The LPC 2148 Education Board

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

The Programming Interface

STF & STF201-30

DRM compatible RF Tuner Unit DRT1

Android Controlled Based Interface

ICS514 LOCO PLL CLOCK GENERATOR. Description. Features. Block Diagram DATASHEET

RTS5401. USB 3.0 Super-Speed HUB Controller DATASHEET. Doc Rev th Apr i Rev 0.90

K8068 BUS DIMMER FOR HOME MODULAR LIGHT SYSTEM ILLUSTRATED ASSEMBLY MANUAL H8068IP-1

MARTECH SPI Tools. MARTECH SPI Tools User Manual v1.0. User Manual

DS Wire Digital Thermometer and Thermostat

Chapter 9 Latches, Flip-Flops, and Timers

Implementing SPI Communication Between MSP430 G2452 and LTC ADC

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

ECIO40P ECIO28P ECRM40. Page 1. USB programmable microcontrollers. 0.6 DIP footprint. Supplied with a free version of Flowcode. E-blocks compatible

FEATURES DESCRIPTION. PT6321 Fluorescent Display Tube Controller Driver

ABACOM - netpio.

Schematic & Parts List: PIC16F688 Satellite Tracker & Rotor Controller

How To Power A Power Supply On A Microprocessor (Mii) Or Microprocessor Power Supply (Miio) (Power Supply) (Microprocessor) (Miniio) Or Power Supply Power Control (Power) (Mio) Power Control

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

US-Key New generation of High performances Ultrasonic device

HT1632C 32 8 &24 16 LED Driver

PICAXE RF CONNECT KIT (AXE213)

Transcription:

AN- APPLICATION NOTE One Technology Way P.O. Box 90 Norwood, MA 00-90, U.S.A. Tel: 7.9.700 Fax: 7.. www.analog.com Microcontroller-Based Serial Port Interface (SPI ) Boot Circuit by Alfredo Barriga INTRODUCTION This application note describes the operation of a generalpurpose, microcontroller-based Serial Port Interface (SPI) boot circuit. This is a low cost solution for users who need to modify some of their device s parameters at power up. This circuit addresses a -wire SPI application for programming converters, or any device that has a SPI option, and sends commands to user-defined SPI registers. SPI DEFINITIONS The SPI port consists of three pins. These are the serial clock pin (SCLK), the serial data IO pin (SDIO) and the chip select bar pin (CSB). SCLK is the serial shift clock in and is used to synchronize serial interface reads and writes. SDIO is a dualpurpose pin, which is used as an input and output depending on the instruction being sent and the relative position in the timing frame. CSB is an active low control that gates the read and write cycles. Figure shows the SPI timing details. Table provides specifications. t DS t HI t CLK t H CSB t S t DH t LO SCLK DON T CARE DON T CARE SDIO DON T CARE R/W W W0 A A A0 A9 A A7 D D D D D D0 DON T CARE 0-00 Table. Specification Name tds tdh tclk ts th thi tlo Figure. SPI Timing Details Meaning Setup time between data and rising edge of SCLK Hold time between data and rising edge of SCLK Period of the clock Setup time between CSB and SCLK Hold time between CSB and SCLK Minimum period that SCLK should be in a logic high state Minimum period that SCLK should be in a logic low state Rev. 0 Page of

AN- TABLE OF CONTENTS Introduction... SPI Definitions... Revision History... Circuit Description... Configuration File... Circuit Operation... Programming the Device... Off-PCB Programming... Voltage Level Translation... Obtaining Code and Programming Tools... Component Details and BOM... 7 References... REVISION HISTORY /0 Revision 0: Initial Version Rev. 0 Page of

AN- CIRCUIT DESCRIPTION The core of this particular SPI boot circuit is the PICF9 microcontroller. This Flash -based device is capable of writing to the SPI port using the SCLK, SDIO, and CSB control signals. It can be programmed many times to fit different application needs, and because of its small size, can be easily incorporated on any design. CONFIGURATION FILE The configuration file to be programmed into the chip is automatically generated by a standalone LabVIEW application which allows the user to specify the number of registers to be accessed and the -bit data-word to be written on each location. LabView generates the assembly code which is then compiled and linked to produce the hex file to be programmed into the microcontroller. There are two applications used for this purpose, which are called by the main LabVIEW standalone configuration program (SPI Code Builder.exe). MPASM by Microchip is used to compile and link the assembly program, and PicFLASH by MikroElektronika serves as a programmer to load the generated hex file into the microcontroller. These two Windows -based applications have been included in the SPI Code Builder application setup file. The user may also employ any other compiler and programming application to assemble the source code provided by the standalone program. Figure shows an example of the SPI Code Builder and PicFLASH Programmer windows. 0-00 Figure. SPI Code Builder and PicFLASH Windows Rev. 0 Page of

AN- CIRCUIT OPERATION The PICF9 is a low cost -pin, -bit microcontroller. It features an internal oscillator which can be enabled to eliminate the need of using an external clock source. The device operates at an internal frequency of MHz, and the clock output frequency from the SCLK pin is based on its operating speed and number of instruction cycles. The microcontroller operates immediately after power up by sending write commands to the target device. After the microcontroller has finished sending the data, it enters a power- down mode in which minimal power is dissipated ( μw max). The device can be restarted at any time by pressing the RESET button or simply by cycling the power supply. An optional LED may be connected to Pin (GP) to indicate that the device is busy during the data transfer process. Figure shows the SPI boot circuit schematic diagram. This circuit can be used for any. V tolerant SPI interface and can be implemented very inexpensively. A voltage level translator may also be incorporated for devices requiring lower input voltages..v SW B OFF R SW RESET A C 0.µF OPTIONAL U VDD VSS GP GP0 GP GP MCLA GP PICF9_SN R 00Ω CR 7 GND R R R SPI PORT SCLK SDI CSB.0V U 7.V P GND P L 0nF C 0µF.V C 0.µF 9 0 ISP (PIC PROGRAMMER) OPTIONAL 0-00 Figure. SPI Boot Circuit Rev. 0 Page of

AN- PROGRAMMING THE DEVICE The microcontroller used in this implementation can be serially programmed while in the end application circuit. This is done with two lines for clock and data, and three lines for power, ground, and programming voltage/reset. There are a number of low cost serial and USB programmers available in the market, such as the PicFLASH USB programmer by MikroElektronika. This programmer can be purchased online at a low cost. Programming specifications require that the unit be powered at V during programming. If the microcontroller is operated at a voltage smaller than V, a switch or a two-position jumper must be added to select from system supply and programming supply (SW). A three-position switch allows the circuit to be in three different modes programming mode, normal SPI mode, and power off. The off position can be incorporated if the user does not want to write to the SPI port when the system is powered up. To eliminate the need of switching between programming supply and system supply, the microcontroller can be permanently powered at V. This adds simplicity to the design and at the same time complies with the programming voltage requirement. OFF-PCB PROGRAMMING The user may choose to program the microcontroller before soldering it to the board. This can be done by using the appropriate socket for the package selected (-lead PDIP, SOIC, or DFN-S). The control lines used by the programmer can be directly connected into the socket for off-pcb programming. Figure shows a simplified schematic using a preprogrammed microcontroller. In this circuit, VDD is directly connected to the. V supply and the RESET button is permanently removed from MCLR (Pin ). The user can choose to enable or disable the microcontroller by adding a jumper between the supply and the VDD pin. Another advantage of programming the microcontroller off- PCB is that there is no worry about setting the microcontroller to a voltage that matches the required programming supply voltage. The device can be powered at any voltage between V and. V, providing the flexibility of using an existing power supply. R 0.µF R.V U VDD VSS GP GP MCLA GP0 GP GP PICF9_SN 7 GND SCLK SDI CSB SPI PORT 0-00 Figure. SPI Boot Circuit (Simplified) Rev. 0 Page of

AN- VOLTAGE LEVEL TRANSLATION Logic thresholds are dictated by the process and design implemented on each product. On some products, SPI inputs are V or. V tolerant. However, other products may only accept smaller voltages (for example,. V). In this case, it might be necessary to incorporate a voltage level translator to adapt the levels from the microcontroller to levels acceptable to the inputs of the DUT. It is recommended that the customer uses the ADG0 which is a four-channel bidirectional level translator. The translator can be customized to perform bidirectional logic level translation without an additional signal to set the direction in which the translation takes place. For instance, if the microcontroller is operating at V supply and the SPI port is. V tolerant, the ADG0 can be set so that it translates the SCLK, SDI, and CSB signals from V to. V. The ADG0 is an easy-to-use solution that requires very few external components. Moreover, the user can disable the outputs from the translator at any time by pulling Pin (EN) low. Figure shows the implementation of the SPI boot circuit with the voltage level translator. OBTAINING CODE AND PROGRAMMING TOOLS Source code and installer with programming tools can be found at no cost at www.analog.com. For information about the PicFLASH USB programmer, go to www.mikroelektronika.co.yu. V SPI_VDD S0 RESET/REPROGRAM V R C7 0.µF OPTIONAL U0 VDD VSS GP GP GP0 GP MCLA/GP GP PICF9_SN R9 Ω CR0 LED_SS 7 R R R E0 J0 PICVCC GP GP0 NCLA/GP 7 9 0 C 0.µF U0 VCCY VCCA Y A Y A Y A V 0 Y A R 9 9 NC 0kΩ EN GND PICVCC GP JP0 ADC0BRUZ GP0 CLOSED HI-Z OPEN NORMAL OP NCLA/GP C9 0.µF SCLK_DUT SDIO_DUT CSB_DUT CLOSE WHEN PROGRAMMING PIC (U0) ISP (PIC PROGRAMMING HEADER) 0-00 Figure. SPI Boot Circuit with Translator Rev. 0 Page of

AN- COMPONENT DETAILS AND BOM Table. Recurring Components QTY DEVICE RES_0 SWITCH0 PICF9_SOIC HEADER0 Any three-position switch. May also use a jumper block. Table. One Time Purchases QTY DEVICE PIC Flash USB Programmer Or any PIC compatible serial programmer. Table. Optional Components QTY DEVICE -Lead SOIC Socket LED_GAAS RES_0 ADG0 PUSHBUTTON Rev. 0 Page 7 of

T TTT AN- REFERENCES Interfacing to High Speed ADCs via SPI User Manual is available at www.analog.com. The ADG0 data sheet is available at www.analog.com. The PICF9 data sheet and MPLAB PM ICSP Design Guide can be obtained from Microchip at www.microchip.com. Information on the PicFLASH USB Programmer and open source software can be obtained at www.mikroelektronika.co.yu 00 Analog Devices, Inc. All rights reserved. Trademarks and registered trademarks are the property of their respective owners. AN0-0-/0(0) Rev. 0 Page of