spartan 开发板全套
全套Xilinx Spartan3 开发板资料,包含逻辑测试代码(DDR2、Flash等)Desian OverviewThis design will enable you to experiment with the internal FLASH memory of the XC3S700AN device on your Spartan-3A Starter Kit. The 8M-bit(1 M-byteFLASH memory can be used to hold configuration images for the Spartan FPga device as well provide general non-volatile storage for other applications thatare then implemented by the device. This design utilises the RS232 port to provide a connection to your PC. Using a simple terminal program such aslyperTerminal you can then use commands to manually program individual bytes or download complete configuration images for the Spartan-3AN deviceusing UFP files. The design also provides commands enabling you to erase pages of the memory read the memory to verify contents and display the uniquedevice DNA and 128-byte security register valuesRS232 Serial CableThe design is implemented using a single Pico Blazeconnects to PC runningprocessor and UART macros occupying less thanHyperTerminal (or similar)5% of the XC3S700An device It is hoped that theand needs to be a male todesign may be of interest and a useful starting pointfemale straight throughfor anyone interested in reading, writing and erasingcable(critically pin2-pin2the internal FLaSH memory as part of their owrpin3-pin3 and pin5-pin5applications是是115200Baud●8-bit1 stop bit2a DI:+5v supplyNo parityFlow control: NoneDon't forget to switch on峁再限昏了ConfigurationSpartanao ADIGILENTDONE’LEDXC3S7O0ANEⅫNUSB cableSPARTAN-3IMPORTANTCable plus devices on board provide essentially1母DR2the same functionality as a 'platform cable USBSelect ConfigurationMode for internawhich is used in conjunction with iMPACTsoftware to configure the spartan 3an with theFLASH memoryPico Blaze design. Note that iMPACT canprogram both the volatile FgPa or the non-Set tovolatile internal FLASH memory as you requireISF011B64E5509LCD used in programmingdemonstration designXC3S700AN FLASH Programmer 3ⅫLNXSerial Terminal SetupThe design communicates with your PC using the Rs232 serial link. Any simple terminal program can be used, but Hyper Terminal is adequate for the taskand available on most PCsA new HyperTerminal session can be started and configured as shown in the following steps. These also indicate the communication settings and protocolrequired by an alternative terminal utility1)Begin a new session with a suitable nameHyper Terminal can typically be located on your PC atPrograms->Accessories-> Communications-> HyperTerminal?|2) Select the appropriate COM port(typically COM1 or COM2)fromdea colectionthe list of options. Don' t worry if you are not sure exactly which one isel a name and choose an ico for the connectigcorrect for your PC because you can change it later?i FLEnter details 'or the phone pumber that yornle ryun [44]3)Set serial port settilBits per second: 115200Parity.Data bits:8KancelParity: NoneStop bits: 1Elow controt NoreFlow control: NoNEtore default sXC3S700AN FLASH Programmer 4Ⅻ№XHyperTerminal setupAlthough steps 1, 2 and 3 will actually create a Hyper terminal session, there are few other protocol settings which need to be set or verified for the Pico blazedesign5-Open the properties dialog4-DisconnectFLA5H-_Programmer Propertiese FLASH_programmer-Hyper TerminalFile Edit view Call Transfer HelpSH_progRammerTo select a different COM port andchange settings(if not correct國⑧Enter the area code wthout hhe long- dis ance plefi8-Connect6- Open Settings1'eFLASH_programmer-HyperTerminal具 H HnrammPt PrnnPHrIPFile Edit wiew Call Transfer HelpFurI: url. diluw did uil kevs dll dyBadc3 acc kcy sendsAsLL≌etupTElnet te minad ine ends avith Ine feeds7-Open ASCll SetupT Echo typed charactErs locallyPla sou when coecling or ds connectingne delay OEnsure boxes are filled in as shownCha: delay.0 millisecondsThe design will echo characters that you type so you do notneed the Echo typed characters locally optionCll Receiving卩 Append Ine teeds to incorr ng inThe design transmits carriage return characters(ODHEX)toe inc oming data to7bt点5indicate end of line so you do need the 'Append line feeds tov wrap ine that exceed terminal widthincoming line ends option to be enabledCancelClick OK two times to confirm and close dialogue boxesXC3S700AN FLASH Programmer 5Ⅻ№XConfigure Spartan-3ANWith your board and Pc all ready to go it is time to configure the Spartan-3AN with the FLASH memory programmer design1) Set up the board as shown on page 3 and open Hyper Termnial set up as described on pages 4&5Note that you must havethe Xilinx isE tools2)Unzip all the files provided into a working directoryinstalled on your PC3)Double click on the file"installXc3s700an_flash_programmer. batThis batch file should open a dos window and runMPACT in batch mode to configure the volatile e115200-HyperTerminal口xFPGA array of the Spartan XC3S700AN deviceFile Edit View Cal TransFer Helpwith the configuration BIT file provided口|2噔Your terminal session should indicate the design isworking with a version number and simple menu asshown here. If not, then check that the Spartan didPicoBlaze XC3S70DAN Programmer v=13actually configure(DONE LED on) and check yourbaud rate settings are correctly matching etcPd PalevIce LB-Blov OTP Page Size BitElpThe command repeats thesimple list of commands availableWARNING- DO NoT use theBcommand until you have read thisdocument and fully understand itCommands can be entered at theOTP One Time programmableprompt using upper or lower caseYou can not undo this command!XC3S700AN FLASH Programmer 6Ⅻ№XStatus S and ID CommandsThe 'S command will display the Status information from the internal FLASH memory. This is a single byteresponse from the FLASH with each bit having the meaning defined below. Pico Blaze is specifically decoding bits 0Status =44Readyand 7 and displaying their meaning in plain text. Note that a page size of 264 bytes is the defaultPage size -264 bytesBit 7=RDY/BUSY(1=ready /0= busyBit 6= COMPBit 5=1Bit 4=0Bit3=“0Bit2=“1Bit 1= PROTECTBit0= PAGE SIZE (0=264 bytes /1=256 bytesThe 'l command initially reads the FLASH memory and displays ManufacturerID=1F2500Code(1F hex) and the density Device Code which is 25 00 hex. This is thenfollowed by the reading and display of the 128-byte security registerSecurityFE FF FF F FE上E上 FHF F FE FF FF E FE上EEFE FF FFFF FE FF FFFFFF FE FFFF FFFF FFFFThe first 64 bytes of the security register are user one time programmable(OTP)FE FFFF FEFE FFFF F+ FEFE FFFFFFFFFFFFAs shown here the default value is 'FF and it is left as an exercise to programFE FFFF FEFE FFFFFF FFFFFF FFFFFFFF FEthese locations if desired but remember it is OTP memory060C0808232D1F2500000129FFFE01FF45 5436303730303011 FF FF FFFF FE FF FEThe second 64 bytes of the security register are read only and contain a uniquefactory programmed value which can be used as a product serial number, provideFF FF FF FEFE FFFF FEFE FFFFFFFF FE FFFFFFFF F+ FE FE FF FF FEFEFE FEFE FEFEFE FEregistration and product tracking codes or as a seed in design authenticationDevice DNA- 011B1270564E5509Finally the unique factory programmed device DNA value contained in the FPGAis also displayed. This can also be used as a product serial number, provideregistration and product tracking codes or as a seed in design authenticationHint- Combine the unique FLASH security value with the unique device DNA toimprove authentication security algorithms.XC3S700AN FLASH Programmer 7Ⅻ№XPages Address FormatsBefore using any of the commands that read, write and erase the FLASH memory it is important to recognise how the FLaSh memory is organised andappreciate the format required for the 24-bit address. Please take the time to study these two page because it is critical to using the commands correctly aswell as understanding how to wark with FLASH memory in your own designPages and BytesAlthough internally to the Xc3S700An device package the communication with the FLASH memory is a serial SPI bus, all transfers are implemented as bytes(8-bits). Therefore, it is possible to consider the memory as byte oriented except at the signally level. The FLASH is internally organised and presented ashaving 4096 pages' which each consist of a number of adjacent bytes. The interesting part is that the default page size is 264 bytes which is not a power of 2and doesn't feel particularly natural. Indeed the total size of the memory is 4096 x 264=1,081, 344 bytes or 8,650, 752 bits rather than 8, 388, 608 bits which isthe normal size for an 8-Mbit memory(8x1024x 1024). So it is also possible to program the memory such that the page size is a more natural 256 bytes but indoing so you really do lose 32, 768 bytes foreverTo define the page size the FLASH memory contains a one time programmable(OTP) register that can be programmed to switch from the default size of 264bytes to 256 bytes per page. Programming of this register is also supported by this reference design(see 'B Command)but remember that there is no goingback if you use it! This reference design has the ability to perform all operations for both sizes of page but your own designs could probably be simplifiedTo make sense of this, let's first look at the format of the 24-bit address when using what is called the"Power of 2"page size. In this mode, each page isreduced to 256 bytes and therefore any byte within a page can be identified with an 8-bit address. There are then 4096 pages which can be identified using aa further 12 address bits. The significant observation is that the end of one page(byte address FF)is adjacent to the start of the next page(byte address 00)and this leads to the natural linear address format we all tend to be familiar with. This is shown below and simply indicates which of the 24-bits are unusedwhich are used to identify a page and which are used to identify a byte within a page23“ Power of2” Page Size Option-256 bytes201987000|00This is not the default mode but makes theconcept of pages easier to understand initiallyPadding12-bit Page number8-bit address0-4095Within page(0-255)24-bit AddressPage 00000xo|o0000000000000000000000Paqe0 Byte o256 bytes000Fhex0000 010101000000000Page 0 Byte 255Page 1000100 hex 000000000000000100000000Page 1By256 bytes0001 FF hex 00|oo0000000000Page 1 Byte 255XC3S700AN FLASH Programmer 8Ⅻ№XPages Address FormatsReturning to the default page size of 264 bytes, the issue is that it now requires a 9-bit address to identify a byte within a page. The range being o to 263(000to 107 hex). Although the end of one page is adjacent to the start of the next page in terms of the physical memory array, there appears to be a gap of 248bytes in the address map. Please take the time to study the diagram below to appreciate this situation and its impact on the 24-bit address format23212098Default 264 bytes/pageoooThis is not the default mode but makes theconcept of pages easier to understand initiallyPadding12-bit Page number8-bit address0-4095Within page(0-263)24-bit AddressPage 0000x[o|o0000000000000000000000Page0Byte0Address range264 bytes000108to0001FF000107hex00100000001010101100000111Page0Byte253hex is invalidPage000200hx0|o000000000000Page 1 Byte o264 bytes000307hex00000000000001011000010111 Page 1 Byte253This reference design has been presented in a way that asks you to specify the page number and byte address (location within a page). PicoBlaze thenformats the 24-bit address based on the page size. The 24-bit address is then displayed as a 6-digit hexadecimal value where appropriate. It is hoped thatthis feature of the reference design is a useful aid to understanding the address format as well as providing useful routines for your won designsA single configuration image for the XC3S700AN is 341, 580 bytes. If this were to be stored in FLASH starting at page zero and byte address zero it will end atthe following address133410=536hex10=4B hexPower of 2- Locations 0 to 34157910-0536643 hex [o00 1011001001011Page 1334 75Default 264 bytes/page341579/264=129386Pages 0 to 1292(1293 pages)completely full and thenPage 1293 is used for (341579-1293x 264)=227 bytes1293227OE3 hex1050D hex10OA1AE3 hex ooo ol01101111100011page1993Byte227XC3S700AN FLASH Programmer 9Ⅻ№XErase Pages Command'EThe 'E command will erase one or more consecutive pages of FLASH memory. Pico Blaze will prompt you to enter the page number of the first and lastpages to be erased and then ask you to confirm your intentions to erase the specified memoryFirst Pace- 000Specity page numbers in hexadecimal(000 to FFF). Pico Blaze will reject a LastLast Page- 50dPage value that is less than the First Pagvalue. Use the same value for First PageConfirm (Y/n) Yand Last Page to erase a single pageErase in ProgressAn upper caseY is required to confirmerase operation otherwise the commandwill ' AbortTo indicate progress, a dot will beI displayed each time a page is pagerased Erase can take up to 32ms pepage..·········.····垂This example shows the erase of pages000 to 50D inclusive. This is consistentwith erasing the primary configurationimage for the XC3S700AN device when翻垂看着using the default page size○KA 'page' is the smallest amount of memory that can be erased but having 4096 pages this provides a great deal of flexibility in what is after all a FLASHmemory. However, since each page may take up to 32ms to erase it may take up to 133 seconds to erase the whole device(but typically 53 seconds)The FLASH memory is further organised into 'blocks'and'sectors'. a block is formed of 8 pages and a sector is formed of 32 blocks(256 pages). There arethe whole device in 16 seconds(typical)up to 39 seconds (worst case)using these course granularity commands memory It should be possible to eraseseparate device commands to erase blocks and sectors which reduce erase times when clearing large sections ofXC3S700AN FLASH Programmer 10Ⅻ№X
暂无评论