| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Technical Notes using Analog Devices' components development tools
Top Searches for this datasheetEE-158 Technical Notes using Analog Devices' components development tools ADSP-2181 EZ-Kit Lite IDMA Printer Port Interface Contributed last change 11-Apr-2002 Introduction: ADSP-218x family used either host full memory interface configuration, ADSP2181 ADSP-2183 offer both interfaces same time. This host port interface allows through IDMA port easy read write access internal memory DSP. With little additional software even system registers accessed external overlays booted. select. printer port only eight data lines four output strobes, little glue logic (exnor /RD) required realize interface /CS. i8255 nasty trait pulling signals when direction data ports changed. avoid troubles IDMA side, four strobe lines (IAL, /IS, /IRD /IWR) have therefore additional inverter placed. After these inverters, i8255 used drive IDMA strobe lines, while used 16bit data port. complete schematic interface presented this document. make interface compatible with other 3.3V ADSP-218x components, level transceivers like 74LVT245 have between switched accordingly. Application Idea: IDMA interface easy handle asynchronous 16bit wide interface requires only four strobe lines operate synchronize clock. IDMA long read write capabilities, almost every host access this interface. Often software developed platform using VisualDSP. Code verification usually done with simulator. Even match performance DSP, regression testing driving test vector easy hardware platform desired. With little external circuitry, which easily fitted ADDS-2181-EZ-Lite, application code booted into test vectors driven from bidirectional parallel port (Printer Port). Software Design: ease application provide generic example routines, driver systems allowing direct access system resources provided. access IDMA port, first i8255 must correctly from reset state. Afterwards, write port allows drive required strobe signals. Further writes port will latch data transmitted ADSP218x. write sequence will look like: drive address clear write strobes /IS, /IWR drive data write strobe Hardware Design: IDMA interface ADSP-218x family requires just data strobe lines operate interface. realize interface, four strobe lines data lines must connected printer port port expander. i8255 offers three freely programmable data ports, which switched between input output. fourth internal register controls setting device. access port expander, data lines printer port connected data port. 8255 additional address line select internal ports requires besides read write chip Table typical write sequence drive multiple data words into ADSP-218x through IDMA interface, just necessary repeat steps read sequence looks like write sequence, with little difference: before data read step port direction must switched between step input must changed again past step Copyright 2002, Analog Devices, Inc. rights reserved. Analog Devices assumes responsibility customer product design application products infringements patents rights others which result from Analog Devices assistance. trademarks logos property their respective holders. Information furnished Analog Devices Applications Development Tools Engineers believed accurate reliable, however responsibility assumed Analog Devices regarding technical accuracy content provided Analog Engineer-to-Engineer Notes. First Time Preparations: default, ADDS-2181-EZ-Kit-Lite configured BDMA booting. allow IDMA host booting, BMODE (pin ADSP2181 package) must lifted from ground connected VCC. Following figure shows change. just IDMA data access without boot capabilities desired, there need change. connector cable between EZ-IDMA adaptor card. Please make sure that point, that your printer port bidirectional prevent damage when reading back data from IDMA port. supplied routines added program allowing easy regression testing. functions: list provided functions given below. compete sources attached this document. Reset_Board: bring i8255 defined state Boot_2181: executable Put_Data: 218x Get_Data: Get_Status: download start Set_Address: IDMA address drive dataword from retrive dataword from 218x query state File_open_read: open ASCII file read File_open_write: open ASCII file write Figure1: BMODE change Booting from EPROM still supported, BDMA bootloader, which downloaded through IDMA interface, supplied. Additionally this, connector must soldered into EZ-Kit Lite, shown figure Get_int_ff: Get_hex_ff: Get_char_ff: Find_port: collect 16bit integer word from file collect 16bit word from file collect single character from file detect printer port Boot_ext_OVLAYMGR: prepare boot into external overlays Boot_ext_OVLAY: download code data external overlay References: http://www.analog.com/dsp ADDS-2181-EZ-Lite documentation ADSP-2181 data sheet Intel i8255 data sheet VisualDSP Documentation Figure location IDMA interface connector. Having performed these changes, interface operational, just connect straight 25pin EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Figure Schematics EZ-IDMA Interface EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Figure ADDS-2181-EZ-Lite EZ-IDMA prototype card EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp EZ81_IDMA.CPP Copyright 2000 Scan Service, Rights Reserved 2001 adopted ANALOG DEVICES, free redistribution allowed HISTORY 10-SEP-2000 document created 02-FEB-2001 updated generic Test Shell 17-MAY-2001 support booting external overlays COMMENT: #include "stdafx.h" #include "stdio.h" #include "stdlib.h" #include "dos.h" #include "conio.h" #include "string.h" #include "EZ81_IDMA.h" Function Prototypes void Reset_Board(); Boot_2181(FILE* fname); Boot_ext_OVLAYMGR(); Boot_ext_OVLAY(int type, num, FILE* fname); void Set_Address(int mem_type, unsigned addr); void Put_Data(int mem_type, unsigned long data); long Get_Data(int mem_type); FILE* file_open_read(char* fname); FILE* file_open_write(char* fname); get_int_ff(FILE* fptr); get_hex_ff(FILE* fptr); find_port(); void delay(int count); long ext_boot_loader[145] 0x000000, 0x18030F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x340015, 0x380017, 0x4FFFF0, 0x930020, 0x83001A, 0x227A0F, 0x1806B0, 0x400114, 0x1806B0, 0x400214, 0x1807B0, 0x400314, 0x1807B0, 0x400414, 0x26E20F, 0x1808B0, 0x400000, 0x930010, 0x400000, 0x930020, 0x400000, 0x930010, 0x400000, 0x930020, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x340008, 0x473000, 0x180400, 0x26E20F, 0x26E20F, 0x26E20F, 0x26E20F, 0x18040F, 0x390000, 0x18040F, 0x360000, 0x18040F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x340009, 0x93FE60, 0x4FFFF0, 0x34001E, 0x34002E, 0x34001F, 0x34002F, 0x400000, 0x3B0001, 0x400000, 0x350001, 0x380000, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x380008, 0x40FFF0, 0x930020, 0x180700, 0x180700, 0x180800, 0x180800, 0x930010, 0x3D0005, 0x930010, 0x3D0005, 0x418000, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x380009, 0x93FFE0, 0x400104, 0x400204, 0x400304, 0x400404, 0x34000E, 0x390000, 0x14077E, 0x360000, 0x14087E, 0x3C00F7, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x400000, 0x404000, 0x26E20F, 0x26E20F, 0x26E20F, 0x26E20F, 0x34000F, 0x3A0001, 0x500003, 0x340001, 0x600001, 0x580003, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x0A001F, 0x930010, 0x93FFF0, 0x34001E, 0x34002E, 0x34001F, 0x34002F, 0x400504, 0x18074F, 0x580007, 0x18084F, 0x680005, 0x18000F EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Functions inline void wr_to_8255(unsigned char reg, unsigned char val) _outp(CTRL, D8255_WR write control _outp(DATA, write data port _outp(CTRL, D8255_DL idle 8255 inline unsigned char rd_from_8255(unsigned char reg) unsigned char read; _outp(CTRL, D8255_DL PPORT_BI _outp(CTRL, D8255_RD PPORT_BI read _inp(DATA); _outp(CTRL, D8255_DL PPORT_BI return (read); Reset Board void Reset_Board() wr_to_8255(D8255_CC, D82_BCO); 8255 output mode wr_to_8255(D8255_PA, D8x_DLE); init IDMA strobes 218x Set_Address(DM,0); Put_Data(DM,0); IDMA address void Set_Address(int mem_type, unsigned addr) (addr!=0xffff) addr mem_type; address wr_to_8255(D8255_PB, (unsigned char) (addr 0x00ff) wr_to_8255(D8255_PC, (unsigned char) ((addr 0xff00) latch wr_to_8255(D8255_PA, D8x_IAL); wr_to_8255(D8255_PA, D8x_DLE); Data IDMA port void Put_Data(int mem_type, unsigned long data) (mem_type memory data wr_to_8255(D8255_PB, (unsigned char) ((data 0x00ff00) wr_to_8255(D8255_PC, (unsigned char) ((data 0xff0000) write control write control collect data write control EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp latch wr_to_8255(D8255_PA, D8x_DLE); wr_to_8255(D8255_PA, D8x_IWR); wr_to_8255(D8255_PA, D8x_DLE); data wr_to_8255(D8255_PB, (unsigned char) (data 0x0000ff) latch wr_to_8255(D8255_PA, D8x_DLE); wr_to_8255(D8255_PA, D8x_IWR); wr_to_8255(D8255_PA, D8x_DLE); else Memory data wr_to_8255(D8255_PB, (unsigned char) (data 0x00ff) wr_to_8255(D8255_PC, (unsigned char) ((data 0xff00) latch wr_to_8255(D8255_PA, D8x_DLE); wr_to_8255(D8255_PA, D8x_IWR); wr_to_8255(D8255_PA, D8x_DLE); Data from IDMA port long Get_Data(int mem_type) long data unsigned char (mem_type switch 8255 input wr_to_8255(D8255_CC, D82_BCI); first access wr_to_8255(D8255_PA, D8x_DLE); wr_to_8255(D8255_PA, D8x_IRD); latch port rd_from_8255(D8255_PB); rd_from_8255(D8255_PC); wr_to_8255(D8255_PA, D8x_DLE); second access wr_to_8255(D8255_PA, D8x_IRD); latch port rd_from_8255(D8255_PB); wr_to_8255(D8255_PA, D8x_DLE); switch PPORT back output wr_to_8255(D8255_CC, D82_BCO); wr_to_8255(D8255_PA, D8x_DLE); data (rh<<16) (rm<<8) else switch 8255 input wr_to_8255(D8255_CC, D82_BCI); wr_to_8255(D8255_PA, D8x_DLE); wr_to_8255(D8255_PA, D8x_IRD); latch port rd_from_8255(D8255_PB); rd_from_8255(D8255_PC); wr_to_8255(D8255_PA, D8x_DLE); open latch high Memory memory open latch high close latch open latch EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp switch PPORT back output wr_to_8255(D8255_CC, D82_BCO); wr_to_8255(D8255_PA, D8x_DLE); data (rh<<8) return data; Boot ADSP-218x Boot_2181(FILE* fname) static char *pam "@PA"; static char *dam "@DA"; static char *bend "#"; char char char char char unsigned unsigned long Reset_Board(); fgets(in_str, fname); (strstr(in_str, pam) NULL) strcpy(addr_str, fgets(in_str, fname)); addr strtoul(addr_str,&p,16); strcpy(inst_str, fgets(in_str, fname)); (strstr(in_str, bend) NULL) inst strtoul(inst_str, 16); if(addr==0) inst_0=inst; save instruction addr++; else Set_Address(PM, addr); Put_Data(PM, inst); addr=0xffff; while(strstr(in_str, bend) NULL); until block while (!feof(fname)); fetch textline Instruction in_str[12]; addr_str[6]; inst_str[8]; data_str[6]; addr, data; inst,inst_0; 8255 state rewind(fname); fgets(in_str, fname); next parse data textline EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp (strstr(in_str, dam) NULL) strcpy(addr_str, fgets(in_str, fname)); addr strtoul(addr_str, 16); strcpy(data_str, fgets(in_str, fname)); (strstr(in_str, bend) NULL) data strtoul(data_str, 16); Set_Address(DM, addr); Put_Data(DM, data); addr=0xffff; while(strstr(in_str, bend) NULL); until block while (!feof(fname)); Set_Address(PM, Put_Data(PM, inst_0); return(1); Download Boot Manager Boot_ext_OVLAYMGR() long inst0; Set_Address(PM, 0x0001); (i=0; 145; i++) inst0 ext_boot_loader[i]; else Put_Data(PM, ext_boot_loader[i]); Set_Address(PM, 0x0000); Put_Data(PM, inst0); return Boot external ADSP-218x Boot_ext_OVLAY(int type, num, FILE* fname) static char *pam "@PA"; static char *dam "@DA"; static char *bend "#"; char char char char char unsigned unsigned unsigned long in_str[12]; addr_str[6]; inst_str[8]; data_str[6]; addr, command, result; data[8192]; inst[8192]; kick write instructon data follows write instructon kick write instructon EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Implemented commands 0x00 wait 0x10 PMOVLAY lower 0x11 PMOVLAY upper 0x20 PMOVLAY lower 0x21 PMOVLAY upper 0x30 DMOVLAY lower 0x31 DMOVLAY upper 0x40 DMOVLAY lower 0x41 DMOVLAY upper 0x50 final init, boot 2181_Boot_Manager internal test final init (num command 0x50; Set_Address(DM, 0x3001); Put_Data(DM, command); return (1); rewind file rewind(fname); (type parse memory fgets(in_str, fname); fetch textline (strstr(in_str, pam) NULL) Instruction strcpy(addr_str, fgets(in_str, fname)); addr strtoul(addr_str,&p,16); (addr 0x2000) printf("\n\n FILE ERROR Executable contains code overlay section addr 0x%04x", addr); printf("\n Section skipped, file \n"); else addr addr 0x2000; subtract ovlay strcpy(inst_str, fgets(in_str, fname)); (strstr(in_str, bend) NULL) inst[addr++] strtoul(inst_str, 16); while(strstr(in_str, bend) NULL); until block while (!feof(fname)); else fgets(in_str, fname); textline (strstr(in_str, dam) NULL) data follows strcpy(addr_str, fgets(in_str, fname)); addr strtoul(addr_str, 16); (addr 0x2000) printf("\n\n FILE ERROR Executable contains data overlay section addr 0x%04x", addr); printf("\n Section skipped, file \n"); else parse memory EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp strcpy(data_str, fgets(in_str, fname)); (strstr(in_str, bend) NULL) data[addr++] strtoul(data_str, 16); while(strstr(in_str, bend) NULL); until block while (!feof(fname)); download sections (type command (num Set_Address(PM, 0x1000); (i=0; 0x1000; i++) Put_Data(PM, inst[i]); Set_Address(DM, 0x3001); Put_Data(DM, command); Set_Address(DM, 0x3002); result Get_Data(DM); while (result command command Set_Address(PM, 0x1000); (i=0x1000; 0x2000; i++) Put_Data(PM, inst[i]); Set_Address(DM, 0x3001); Put_Data(DM, command); Set_Address(DM, 0x3002); result Get_Data(DM); while (result else type command ((num Set_Address(DM, 0x2000); (i=0; 0x1000; i++) Put_Data(DM, data[i]); Set_Address(DM, 0x3001); Put_Data(DM, command); Set_Address(DM, 0x3002); result Get_Data(DM); while (result command command Set_Address(DM, 0x2000); (i=0x1000; 0x2000; i++) Put_Data(DM, data[i]); Set_Address(DM, 0x3001); Put_Data(DM, command); Set_Address(DM, 0x3002); block download address data command address write command block download address dump code command address write command wait SUCCESS high block download address dump code command address write commadn wait SUCCESS wait SUCCESS high block download address dump data command address write command EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp result Get_Data(DM); while (result return (1); write SUCCESS File open write access FILE* file_open_write(char* fname) FILE *fptr; ((fptr fopen(fname,"wt")) NULL) printf("\nCan open file %s\n", fname); else printf("\nsuccess opening write", fname); return fptr; File open read access FILE* file_open_read(char* fname) FILE *fptr; ((fptr fopen(fname,"rt")) NULL) printf("\nCan open file %s\n", fname); else printf("\nsuccess opening read", fname); return fptr; value from current file position get_int_ff(FILE* fptr) result, readval; result fscanf(fptr, "%d", &readval); (result EOF) readval return readval; value from current file position get_hex_ff(FILE* fptr) result, readval; result fscanf(fptr, "%lx", &readval); (result EOF) readval return (int) readval; EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Find Printer Port find_port() unsigned *ptraddr; unsigned address; ptraddr=(unsigned *)0x00000408; /*Bios Location a++) address *ptraddr; (address printf("No port found LPT%d \n",a+1); else printf("Address assigned LPT%d %Xh\n",a+1,address); *ptraddr++; return (address); Delay void delay(int count) res; (i=0; i<count; i++) _inpw(0x0); Listing sources EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp EZ81_IDMA.H Copyright 2000 Scan Service, Rights Reserved 2001 adopted ANALOG DEVICES, free redistribution allowed HISTORY 10-SEP-2000 document created 02-FEB-2001 updated generic Test Shell 17-MAY-2001 support booting external overlays COMMENT: #ifndef _EZ_IDMA81_ #define _EZ_IDMA81_ #include #include #include #include "stdio.h" "stdlib.h" "math.h" "string.h" Global Defines #define BASE #define DATA #define STAT #define CTRL 0x378 BASE BASE BASE Printer Port Interface #define D8255_PA 0x08 00001000, Port #define D8255_PB 0x0C 00001100, Port #define D8255_PC 0x00 00000000, Port #define D8255_CC 0x04 00000100, Control #define D8255_WR #define D8255_RD #define D8255_DL #define PPORT_BI #define PPORT_BO #define PPORT_UL 0x01 0x02 0x00 0x20 0xDF 0x40 00000001, line 8255 00000010, line 8255 00000000, idle 8255 00100000, before read from par_port 01000000, before read from par_port 8255 Defines #define D82_BCO 0x80 10000000, Mode0: A-out, B-out, C-out #define D82_BCI 0x8B 10001011, Mode0: A-out, B-in C-in #define #define #define #define D8x_IAL D8x_IWR D8x_IRD D8x_DLE 0x04 0x0E 0x0D 0x08 ~xxxx1011, line 218x ~xxxx0001, /IWR line 218x ~xxxx0010, /IRD line 218x ~xxxx0111, idle 218x EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp IDMA Defines #define 0x0000 #define 0x4000 Function Prototypes void Reset_Board(); Boot_2181(FILE* fname); Boot_ext_OVLAYMGR(void); Boot_ext_OVLAY(int type, num, FILE* fname); void Set_Address(int mem_type, unsigned addr); void Put_Data(int mem_type, unsigned long data); long Get_Data(int mem_type); FILE* file_open_read(char* fname); FILE* file_open_write(char* fname); get_int_ff(FILE* fptr); get_hex_ff(FILE* fptr); find_port(); #endif _EZ_IDMA81_ Listing include file EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp #include #include #include #include "EZ81_IDMA.h" "EZ_Support.h" "stdio.h" "conio.h" main(int argc, char* argv[]) FILE* exefile; printf("\n\nPlease press RESET lite"); getch(); Reset EZ_IDMA adaptor card Reset_Board(); Boot Executable Manager External Overlays Boot_ext_OVLAYMGR(); External Overlay exefile (exefile NULL) printf("program aborted\n"); fcloseall(); getch(); return false; Boot_ext_OVLAY(PM, exefile); fclose(exefile); External Overlay exefile (exefile NULL) printf("program aborted\n"); fcloseall(); getch(); return false; Boot_ext_OVLAY(PM, exefile); fclose(exefile); final init Boot_ext_OVLAY(PM, exefile); your regression test here Listing Example Boot function calls printed boldface EE-158 Technical Notes using Analog Devices' components development tools Page Phone: (800) ANALOG-D, FAX: (781)461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp Other recent searchesXN0421F - XN0421F XN0421F Datasheet XN421F - XN421F XN421F Datasheet ULN2803 - ULN2803 ULN2803 Datasheet ULN2803APG - ULN2803APG ULN2803APG Datasheet ULN2803AFWG - ULN2803AFWG ULN2803AFWG Datasheet ULN2804APG - ULN2804APG ULN2804APG Datasheet ULN2804AFWG - ULN2804AFWG ULN2804AFWG Datasheet RN2701JE - RN2701JE RN2701JE Datasheet RN2706JE - RN2706JE RN2706JE Datasheet RN2702JE - RN2702JE RN2702JE Datasheet RN2703JE - RN2703JE RN2703JE Datasheet RN2704JE - RN2704JE RN2704JE Datasheet RN2705JE - RN2705JE RN2705JE Datasheet Number - Number Number Datasheet LBT08504 - LBT08504 LBT08504 Datasheet AD9430 - AD9430 AD9430 Datasheet 2STA2120 - 2STA2120 2STA2120 Datasheet
Privacy Policy | Disclaimer |