Home

AN-812

image

Contents

1. REFERENCES e Interfacing to High Speed ADCs via SPI User Manual is available at www analog com e The ADG3304 data sheet is available at www analog com e The PIC12F629 data sheet and MPLAB PM3 ICSP Design Guide can be obtained from Microchip at www microchip com e Information on the PicFLASH USB Programmer and open source software can be obtained at www mikroelektronika co yu 2005 Analog Devices Inc All rights reserved Trademarks and ANALOG registered trademarks are the property of their respective owners AN05686 0 12 05 0 DEVICES www analog com Rev 0 Page 8 of 8 www BDTIC com ADI
2. is directly connected to the 3 3 V supply and the RESET button is permanently removed from MCLR Pin 4 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 2 V and 5 5 V providing the flexibility of using an existing power supply o5686 004 SPI PORT Figure 4 SPI Boot Circuit Simplified Rev 0 Page 5 of 8 www BDTIC com ADI VOLTAGE LEVEL TRANSLATION Logic thresholds are dictated by the process and design implemented on each product On some products SPI inputs are 5 V or 3 3 V tolerant However other products may only accept smaller voltages for example 1 8 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 ADG3304 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 5 V supply and 5V RESET REPROGRAM OPTIONAL ISP PIC PROGRAM
3. ANALOG DEVICES AN 812 APPLICATION NOTE One Technology Way P O Box 9106 Norwood MA 02062 9106 U S A Tel 781 329 4700 Fax 781 461 3113 www analog com Microcontroller Based Serial Port Interface SPI Boot Circuit by Alfredo Barriga INTRODUCTION This application note describes the operation of a general purpose 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 3 wire SPI application for programming converters or any device that has a SPI option and sends commands to user defined SPI registers gt ts CSB SCLK DON T CARE SDIO DON T CARE 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 dual purpose 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 1 shows the SPI timing details Table 1 provides specifications DON T CARE DON T CARE 05686 001 Figure 1 SPI Timing Details Table 1 Specification Name Meaning tos Setup time between data and rising edge o
4. MING HEADER V the SPI port is 1 8 V tolerant the ADG3304 can be set so that it translates the SCLK SDI and CSB signals from 5 V to 1 8 V The ADG3304 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 8 EN low Figure 5 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 5V SPI_VDD C429 T 0 1NF vecy VCCA YI A1 SCLK_DUT Y2 A2 SDIO_DUT Y3 A3 CSB_DUT Y4 A4 9 EN ADC3304BRUZ CLOSED HI Z GPO OPEN NORMAL OP NCLA GP3 CLOSE WHEN PROGRAMMING PIC U402 05686 005 Figure 5 SPI Boot Circuit with Translator Rev 0 Page 6 of 8 www BDTIC com ADI COMPONENT DETAILS AND BOM Table 2 Recurring Components QTY DEVICE RES_402 SWITCHO1 PIC12F629_SOIC HEADER10 8 1 Any three position switch May also use a jumper block Table 3 One Time Purchases QTY DEVICE 1 PIC Flash USB Programmer 1 Or any PIC compatible serial programmer Table 4 Optional Components QTY DEVICE 8 Lead SOIC Socket LED_GAAS RES 402 ADG3304 PUSHBUTTON mN oe Rev 0 Page 7 of 8 www BDTIC com ADI
5. UIT OPERATION The PIC12F629 is a low cost 8 pin 8 bit microcontroller It down mode in which minimal power is dissipated 13 yW features an internal oscillator which can be enabled to eliminate max The device can be restarted at any time by pressing the the need of using an external clock source The device operates RESET button or simply by cycling the power supply An at an internal frequency of 4 MHz and the clock output optional LED may be connected to Pin 3 GP4 to indicate that frequency from the SCLK pin is based on its operating speed the device is busy during the data transfer process Figure 3 and number of instruction cycles shows the SPI boot circuit schematic diagram This circuit can The microcontroller operates immediately after power up by sending write commands to the target device After the be used for any 3 3 V tolerant SPI interface and can be implemented very inexpensively A voltage level translator may also be incorporated for devices requiring lower input voltages microcontroller has finished sending the data it enters a power R2 SPI PORT 4 7KQ a7ko O SCLK sw2 O SDI L 192 o CSB 4 RESET OPTIONAL ISP PIC PROGRAMMER OPTIONAL 05686 003 Figure 3 SPI Boot Circuit Rev 0 Page 4 of 8 www BDTIC com ADI 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 d
6. ata 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 5 V during programming If the microcontroller is operated at a voltage smaller than 5 V a switch or a two position jumper must be added to select from system supply and programming supply SW1 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 5 V This adds simplicity to the design and at the same time complies with the programming voltage requirement 3 3V O eT PIC12F629_SN 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 8 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 3 shows a simplified schematic using a preprogrammed microcontroller In this circuit VDD
7. d 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 8 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 2 shows an example of the SPI Code Builder and PicFLASH Programmer windows Ly amp OSCCAL and BANOGAP Protect 05686 002 Figure 2 SPI Code Builder and PicFLASH Windows Rev 0 Page 3 of 8 www BDTIC com ADI CIRC
8. f SCLK toH Hold time between data and rising edge of SCLK tak Period of the clock ts Setup time between CSB and SCLK ty Hold time between CSB and SCLK thi Minimum period that SCLK should be in a logic high state tlo Minimum period that SCLK should be in a logic low state Rev 0 Page 1 of 8 www BDTIC com ADI TABLE OF CONTENTS Introduction csccssns cea stsasesssssansensstacennsesssvonsoseuvenseavvevstospnvendstoudeadetosnioes 1 a E E 1 REVISION HIStory ssersnennirnnnsnsisnnnenn n 2 Circuit DeSCriptiONn sccsc sessecesiessesssserdessnvastechesentactssevecvasnotnessnseicstornes 3 Configuration File cc eeeseeseeseeseeseescsscsesesteaeeseeneeneeneeseass 3 Circuit OQ Perati On ccs seiscnosericcevssvecsessesdacessorsessuvastecksvanvestoserdecvaare 4 Programming the Device cceesssssessesseessessesseessessesseesesseessessesseess 5 Off PCB Programming cssssessessesssesessesseessessesssessesseesesseenes 5 Voltage Level Translation ccceseessesseessessesssessesseesesseesessesnee 6 Obtaining Code and Programming Tools 6 Component Details and BOM ceeessesssesesseessessesseessesseestesseesees 7 RELELON CES ve sscscessasesstaapadestsdeostetcordustesasdvstosessustoneserstesetdvttecesduetseaiiustn 8 REVISION HISTORY 12 05 Revision 0 Initial Version Rev 0 Page 2 of 8 www BDTIC com ADI CIRCUIT DESCRIPTION The core of this particular SPI boot circuit is the PIC12F629 microcontroller This Flash base

Download Pdf Manuals

image

Related Search

AN 812 an 812-1 strut valve an812-1 an 82 pill an 816 fitting an 818 nut an 82 is what letter grade an 82 kg diver stands at the edge an 82 year old who moved to florida an 81 pill an 819 sleeve an 818-16d an 81 year old man ended up an 81 year old female fell and struck an 81 year old man ended up in germany

Related Contents

  Philips Steam iron GC4325    MiniBrute User's Manual  Geovision GV-MDR220  Télécharger le numéro    Bedienungsanleitung - Bosch Mobility Solutions  Manuale d`istruzioni  user`s manual  

Copyright © All rights reserved.
Failed to retrieve file