AN-759 ᆌᆩԴऻ One Technology Way t P.O. B ox 9106 t Norwood, MA 02062-9106 t Tel: 781/329-4700 t Fax: 781/326-8703 t www.analog.com કቛADuC8xxतADuC702xဣଚڦDACຕ ፕኁǖAude Richard ० AD53x4 ADIࠅິླྀڦMicroConverter®ဣଚׂणׯକڇୟۉუ ܠࢅୟۉუڦDACă AD53x4)1*ᅃဣଚټۉუ࣐؋ഗ຺ڦཚڢ8-/10/12-࿋܈DACLj֑ᆩ10ᆅগྲڦ႙SOICހጎLjۉڇᇸࠃ ྷݔۉ2.5 V5.5 VLj3 Vۉᇸࠃ้ۉၩࡼ500 μAୁۉăഄೌా ٷݣഗీᅜ0.7 V/μsڦუӦ୲ํ၄ࡆڦࡆڟӦޗă֑ ᆩᅃ߲ෙ၍๕زႜথ੨Lj้ዓ୲ፌߛٳ30 MHzLjᇑ ՔጚSPIথ੨ग़ඹă߸ၘܠဦాඹLj൩֖ለAD5304ຕ ֩ă ሞగၵᆌᆩዐLjీႴᄲڦྔܮఇెཚڢăᅺُLj MicroConverterՂႷྔথᅃ߲ݴ૬ܠڦཚڢDACăॽMicroConverterᇑADIڦၭހጎLjग़ඹSPIܠڦཚڢDAC၎ᅜ ඹᅟํڦ၄ۉუཚڦڢકቛă ԨᆌᆩԴऻ௮ຎକසࢆཚࡗᅃ߲०ڦڇෙ၍๕SPIথ੨ํ၄ ADuC814ईADuC7020ᇑ຺ཚۉڢუ8-/10-/12-࿋܈ DACׂAD5304 / AD5314 / AD5324 (AD53x4)ڦথă VDD REFIN LDAC SCLK SYNC INPUT REGISTER DAC REGISTER STRING DAC A BUFFER VOUTA INPUT REGISTER DAC REGISTER STRING DAC B BUFFER VOUTB INPUT REGISTER DAC REGISTER STRING DAC C BUFFER VOUTC INPUT REGISTER DAC REGISTER STRING DAC D BUFFER VOUTD INTERFACE LOGIC DIN POWER-ON RESET AD5304/AD5314/AD5324 POWER-DOWN LOGIC GND 1. AD53x4ࠀీ Rev. 0 | Page 1 of 4 AN-759 ᆘॲথ੨ SPIথ੨ 2၂๖ڦAD53x4ᇑMicroConverterኮक़زڦႜথ੨ă ᆯᇀAD53x4ྺٗഗॲLjMicroConverterԥದዃྺዷഗॲLj नྺAD53x4༵ࠃSCLKăMOSI)ዷ݀ٗ*ᆅগথDAC زڦႜຕ၍(DIN)ăAD53x4ڦSYNCLjनೌ႑ ࡽLjᇑADuC814ڦᅃ߲࿋Պײᆅগ၎LjԲසP3.4ă ईኁᇑADuC7020ڦᅃ߲ཚᆩణڦI/O၎LjԲසP1.7ă t!!ADuC7020༵ࠃᅃ߲2.5 VೌฉएጚۉუLjঢ়߾ၯጚLjਨ ܔྺ܈2.5 V ±10 mVăසࡕॽాևएጚۉუᆩᇀ AD53x4LjሶᆌሞVREFᆅগتႜ࣐؋LjժႷᆩᅃ ߲470 nFۉඹॽᆅগথAGNDă ADuC814 CREF AD53x4ᅎ࿋स٪ഗྺ16࿋LjړSYNCྺ้گLjഗॲ ᄲথઠጲMicroConverterڦଇጴবຕă ADuC814ฉுᆶٗഗॲስईೌLjՂႷ๑ᆩᅃ߲ GPIOăܔᇀADuC7020LjSPIথ੨༵ࠃᅃ߲ٗഗॲስईೌ Ljڍ݀ྜᅃ߲ጴবLjࣷۼՎྺߛۉೝLjᅺܸႴᄲ ᆩᅃ߲GPIOઠ੦ྔևDACڦSYNC႑ࡽă݀ໃຕ้ံ ݀ໃߛ࿋ă ADuC814 OR ADuC7020 REFIN AGND 3 ๑ᆩADuC814एጚ ADuC814ॲথ੨ ଚ1ٗໜپஓዐൽڦᇑAD53x4থ੨၎࠲ڦᅃپ ஓă AD53X4 SPIথ੨ሞinit814ࡧຕాႜ؛๔ࣅLj߳ܔዖఇ๕֖ຕႜ ยዃLjᅜፁAD53x4ڦSPI้Ⴞᄲ൱ă P3.4 OR P1.7 SYNC SCLOCK SCLK MOSI AD53X4 ad53x4outྺথ੨ࡧຕLjံLjܔઠጲߴ֖ۨຕڦ16࿋ຕ ߛڦ࿋ጴবႜتLjᅜሜAD53x4ᅎ࿋स٪ഗߛڦ ࿋ ጴ ব (ᆶ ࠲ ຕ ߭ ๕ ా ඹ Lj ൩ ֖ ለ AD5304/AD5314/ AD5324ຕ֩)ă DIN 2!AD53x4ᇑADuC814/ADuC7020থ੨ ૧ᆩMICROCONVERTERڦएጚۉუ සᆶႴᄲLjAD53x4૧ᆩMicroConverterాևڦएጚۉ უă t"%V$༵ࠃᅃ߲ೌฉ2.5 Vټဤएጚă2.5 Vాև! एጚۉუঢ়߾ၯጚLjਨܔྺ܈2.5 V ±2.5%ăසࡕॽ ా և ए ጚ ۉუ ᆩ ᇀ AD53x4Lj ሶ ᆌ ሞ CREFᆅ গ AGNDتႜ࣐؋Ljස3๖ă֑ᆩ5 Vۉᇸࠃ้ۉLj ాևएጚۉუۆڦ႙ሯำႠీྺ150 nV/Hz@1 kHzLj ୁሯำރރኵྺ100 mVă ࢫཚࡗspiTxࡧຕ݀ໃጴবăໜࢫ݀ໃگ࿋ጴবLjܸٗ ྜׯ16࿋ຕدăጀᅪad53x4csLj৽AD53x4ڦSYNC ႑ࡽLjሞSPIڦଇ߲ჄጴবدࡗײዐԍփՎă spiTxࡧ ຕ Lj ԥ ad53x4outۙ ᆩ Lj ཚ ࡗ ॽ ጴ ব ຕ ႀ SPIDATस٪ഗઠ݀ໃtxDAT֖ຕࡤጴবຕăࡧຕ ࢫځڪISPIՔኾ࿋ԥዃ࿋Ljᅜ๖دຐăጀᅪLjሞد ݏ ้ Lj ᆘ ॲ փ ࣷ ጲ ۯዘ ዃ ISPI࿋ Lj ᅺ ُ Ղ Ⴗ ሞ ႀ SPIDATኮമཚࡗॲႜยዃăଷႴጀᅪڦLjspiTxࡧ ຕՂႷሞඓණدຐኮࢫۙڟ࣮ݓᆩࡧຕLjᅜඓԍۙᆩ ࡧຕሞຕدຐࢫܸݥຕدࡗײዐܔSYNC႑ࡽ ൽݒă Rev. 0 | Page 2 of 4 AN-759 sbit ad53x4cs = P3^4; // Chip select for ad53x4 (PORT3.4) void init814(void) { /* Initialize other peripherals here */ // Initialize internal peripherals /* Initialize SPI to talk to AD53x4 */ CFG814 = 0x01; SPICON = 0x38; // Serial interface enable for P3.5..P3.7 pins // Enable SPI I/F as master, SCLOCK idle H, // advance MSB output, sclock=fcore/2=1.05Mhz } void spiTx(unsigned char txDat) { ISPI = 0; SPIDAT = txDat; while(!ISPI); } // Transmit a byte data over the SPI void ad53x4out(unsigned char adrs, bit pdN, bit ldacN, unsigned short dat) { unsigned char txDat; // // // // // Clear ISPI bit // Wait until tx complete A1,A0 bit of the contents PD bit of the contents LDAC bit of the contents 12-bit output data ad53x4cs = 0; txDat = ((unsigned char) (dat>>8)) & 0x0f; txDat |= ldacN ? 0x10 : 0x00; txDat |= pdN ? 0x20 : 0x00; txDat |= (adrs<<6); spiTx(txDat); // Tx the upper byte txDat = (unsigned char) dat; spiTx(txDat); // Tx the lower byte ad53x4cs = 1; } ଚ1 ቌጲໜپஓ53x4forADuC814.Cڦ၎࠲پஓ Rev. 0 | Page 3 of 4 AN-759 ଚ 2 ٗ ໜ پஓ ADuC7020toAD53x4.cዐ ൽ ڦᇑ AD53x4ࢅADuC7020থ੨၎࠲ڦᅃپஓă SPIথ੨ሞinit702xࡧຕాႜ؛๔ࣅLj߳ܔዖఇ๕֖ຕ ႜยዃLjᅜፁAD53x4ڦSPI้Ⴞᄲ൱ă AD53x4outྺথ੨ࡧຕLjံLjܔઠጲߴ֖ۨຕڦ16࿋ຕ ߛڦ࿋ጴবႜتLjᅜሜAD53x4ᅎ࿋स٪ഗ!!ڦ ߛ࿋ጴব)ᆶ࠲ຕ߭๕ాඹLj൩֖ለAD5304/AD5314/ AD5324ຕ֩Džă void init702x(void){ GP1DAT = 0x80800000; GP1SET = 0x00800000; GP1CON = 0x02020000; SPICON = 0x4B; SPIDIV = 0x14; } ࢫཚࡗspiTxࡧຕ݀ໃጴবăໜࢫ݀ໃگ࿋ጴবLjܸٗ ྜׯ16࿋ຕدă ጀᅪP1.7Lj৽AD53x4ڦSYNC႑ࡽLjሞSPIڦଇ߲Ⴤጴ বدࡗײዐԍփՎă spiTxࡧຕLjԥad53x4outۙᆩLjཚࡗॽጴবຕႀSPITX स٪ഗઠ݀ໃtxDat֖ຕࡤጴবຕăࡧຕࢫځڪLj ڟSPISTAस٪ഗڦSPIRXՔኾ࿋)࿋4*ԥዃ࿋Ljᅜ๖د ຐăጀᅪLjՂႷᆩॲཚࡗ܁ൽSPIRXस٪ഗઠൣأ SPIRXՔኾ࿋ă // and pull /SYNC High // Set the DIV to run at 1.05Mhz void spiTx(unsigned char txDat){ SPITX = txDat; while(!(SPISTA & 0x08)); txDat = SPIRX; } // Send txDat to the AD5304 // Wait of end of transfer void ad53x4out(unsigned short address, unsigned short pdN, unsigned short ldacN, unsigned short dat){ txDat1 = 0; txDat0 = 0; // Reset txDat1 to 0 // Reset txDat0 to 0 txDat1 |= (address << 6); txDat1 |= pdN ? 0x20 : 0x00; // // // // Store the address in the upper 2 bits of txDat1 (8 bit) If pdN is set, copy a logic 1 into the next space, if not copy a logic 0 If ldacN is set, copy a 1 into the next space, if not copy a 0 // // // // Pull Send Send Pull txDat1 |= ldacN ? 0x10 : 0x00; txDat1 |= (dat >> 4); txDat0 |= (dat << 4); txDat0 &= 0xf0; //send the data GP1CLR = 0x800000; spiTx(txDat1); spiTx(txDat0); GP1SET = 0x800000; /SYNC High txDat1 to the SPI txDat0 to the SPI /SYNC Low } ଚ2 ቌጲໜپஓADuC7020to53x4.cڦ၎࠲پஓ ©2007 Analog Devices, Inc. All rights reserved. Trademarks and registered trademarks are the property of their respective owners. Rev. 0 | Page 4 of 4 AN05247–0–2/05(0) ADuC7020ॲথ੨