| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
February 1999, ver. Introduction 8051 family microprocessors
Top Searches for this datasheetEmbedded Programming Using 8051 Byte-Code February 1999, ver. Introduction 8051 family microprocessors relatively inexpensive, easy use, proven platform managing simple processing tasks. This application note outlines Altera® support embedded programming configuration using 8051 family microprocessors JamByte-Code File (.jbc). Instructions port 8051 Byte-Code Player also provided. Application Note (Using Language Embedded Processor) more information supported processors using Byte-Code. 8051 architecture consists separate addressing. Figure illustrates 8051 interface applies memory. 8051 Architecture Figure 8051 Memory Interface Kbytes FFFFh Program Memory !PSEN 0000h 8051 Kbytes FFFFh Port Data Memory JTAG Chain 0000h Altera Corporation A-AN-111-01 111: Embedded Programming Using 8051 Byte-Code 8051 processor retrieve programming configuration information from configuration FLASH devices. 8051 processor access Kbytes Kbytes RAM, extended paging additional memory. However, paging memory requires additional discrete logic between 8051 associated memory, which slows access programming times. 8051 retrieves executes instructions from program memory. Part executing instructions involves controlling pins that provide access ROM, RAM, ports, addresses. example, when 8051 retrieves instruction access external data, RAM, processor automatically toggles such that information retrieved stored appropriate internal registers. These actions performed automatically processor. Many variants basic 8051 architecture exist, including different clock speeds MHz), 16-bit functions, Kbytes on-chip ROM. When programming devices that contain more than macrocells, Altera recommends using fastest 8051 best programming times. Byte-Code Software Byte-Code Player File needed program configure Altera devices using 8051 processor. This source code customized target 8051. more information customize source code, "Porting Byte-Code Player". Files generated using MAX+PLUS® software, compiling existing ASCII-based File (.jam) into Byte-Code equivalent using stand-alone Byte-Code Compiler. download compiler http://www.jamisp.com. Byte-Code Player source code obtained contacting Altera Applications (800) 800-EPLD, sending e-mail sos@altera.com. Figure shows store software 8051 embedded system. Altera Corporation 111: Embedded Programming Using 8051 Byte-Code Figure 8051 Architecture Kbytes FFFFh !PSEN Byte-Code File (.jbc) Size Byte-Code Player Binary 0000h Kbytes 8051 FFFFh Size Scratch Area 0000h JTAG Chain Although Figure shows File stored ROM, file could also stored executed RAM. either case, Byte-Code Player must executed 8051 processor, must have access File. Porting Byte-Code Player 8051 Byte-Code Player written programming language 8051 architecture. source code provided jbi51.c file, which provided with player designed make porting easy possible. Table shows source code's default configuration. Table 8051 Byte-Code Player Configuration Options Configuration Default Other Processor Dallas DS87C520 8051 Variant Keil Compiler 8051 Compiler File Storage ROM, RAM, Serial Port Note: Programming accomplished downloading File from remote storage local serial port. source code compiled 8051 variant long supporting compiler compile code. target system's parameters differ from default, Player source code customized accommodate them, including storage options execution Byte-Code Player binary File. Porting source code requires three basic steps. Altera Corporation 111: Embedded Programming Using 8051 Byte-Code Step Edit Compiler-Specific Keywords compiler other than Keil compiler used, keywords Figure must changed beginning jbi51.c file: Figure Compiler-Specific Keywords #define #define #define #define #define #define CONSTANT_AREA code XDATA_AREA xdata PDATA_AREA pdata IDATA_AREA idata RDATA_AREA data external external internal internal internal accessed 16-bit pointer accessed 8-bit pointer accessed 8-bit pointer registers with direct access single data type Keil keywords code, xdata, pdata, idata, data, bit. code keyword refers program memory where Byte-Code Player binary stored. other keywords refer specific internal external spaces. These memory spaces specific 8051 architecture. Change these keywords compiler using. Step Customize Memory store File either RAM. However, must customize Player according File location. File's default location ROM. specify File's location, must global variable, using following method. Convert binary File into hexadecimal data, jbi_program[] equal data jbi51.c file. #ifndef JBC_FILE_IN_RAM unsigned char CONSTANT_AREA jbi_program[] insert program data here #endif JBC_FILE_IN_RAM Altera Corporation 111: Embedded Programming Using 8051 Byte-Code program called jbc2data, which provided site http://www.jamisp.com, used convert binary File into hexadecimal array. compiler automatically links information with binary. needed, linker specify exact storage location within ROM. Loading File into requires steps: following line beginning jbi51.c file. #define JBC_FILE_IN_RAM Load File into before jbi_execute() called copying File from source jbi_program[] array. jbi_program[] array points File stored RAM. Player accesses File through jbi_program[]. default, code main() reads File from 8051 serial port into jbi_program[] global array. provided code used communicate between 8051 serial port. need customize code depending your actual target system. Step Customize Routines 8051 Byte-Code Player source code written that functions confined routines. These routines require customization based upon system-level hardware. Table shows each routine corresponding function. Altera Corporation 111: Embedded Programming Using 8051 Byte-Code Table Routines Corresponding Functions Routine Function jbi_jtag_io() Interface IEEE Std. 1149.1 JTAG signals TDI, TMS, TCK, TDO. jbi_message() Prints information error text standard output, when available. jbi_export() jbi_delay() Passes information such user electronic signature (UES) back calling program. Implements programming pulses delay needed during execution. jbi_jtag_io() This routine interface IEEE Std. 1149.1 (JTAG) signals TDI, TMS, TCK, TDO. default, IEEE Std. 1149.1 signals mapped hardware ports Table Table JTAG Mapping Hardware Ports Signal Hardware Port P1.0 P1.1 P1.7 P3.5 These signals remapped, depending hardware port pins used. actual names accessed with keywords defined library that supports targeted 8051 processor. default, source code calls Dallas DS87C520. pins each port DS87C520 designated P<port number>_<pin number>. example, mapped port which designated P1_0. ports pins should remapped based upon convention library used with targeted 8051. must preserve write read sequence from ports within this routine. Disruption write read process results Player errors. jbi_message() jbi_message() routine prints information error messages standard output. most applications will this function, either remove routine comment call puts(). Altera Corporation 111: Embedded Programming Using 8051 Byte-Code jbi_export() jbi_export() routine returns information from Player calling program. most common this routine transfer instruction code back program that calls Player. default, Player prints value using printf. printf available, instruction passed back calling program, calling program must decide whether program device based actual contents value. jbi_delay() Pulses varying widths used program internal EEPROM cells Altera devices. Player uses jbi_delay() routine implement these pulse widths. This routine must customized based speed processor time takes processor execute single loop. default, routine coded that absolute delay time microseconds) divided eight, which used number times that processor loops achieve specified delay. default setting 8051 running MHz. target 8051 does loop eight times microsecond, count variable must adjusted. jbi_delay() routine must perform accurately between range millisecond second. function should delay more than over time specified, cannot return less time. With three steps completed, 8051 Byte-Code Player ready compiled target processor. Executing Player jbi_execute() main entry point 8051 Byte-Code Player. successfully call Player, jbi_execute() must receive correct information. This routine called from main() default. remaining code within main() sets variables that passed jbi_execute() handles errors that returned jbi_execute(). call jbi_execute() shown below: &error_address, &exit_code); initialization list tells Player which functions perform (e.g., program verify) passed jbi_execute(). Once Player completed task, returns with exit code. there errors, jbi_execute() returns location those errors within File address. Altera Corporation 111: Embedded Programming Using 8051 Byte-Code initialization list must passed correct manner. invalid initialization list initialization list passed, Player simply checks File. syntax check passes, Player issues successful exit code without performing program function. init_list variable array pointers array characters. other words, init_list two-dimensional array that assigned series string commands provide instructions Player. example, following code init_list instruct Player perform program verify operation: char CONSTANT_AREA init_list[][]="DO_PROGRAM=1", "DO_VERIFY=1"; This code declares init_list variable while setting equal appropriate parameters. CONSTANT_AREA identifier that instructs compiler store init_list program memory. default code sets init_list differently, used with terminal program give instructions Player command prompt. most cases, will Player with this type interaction. code types returned jbi_execute(). first code type returned variable exit_code second code type returned variable error_code. These codes indicate functional result operation. These codes flag problems with memory limitations syntax errors, which indicate software issues specific ByteCode Player Byte-Code File. Tables list possible codes returned exit_code error_code variables. Table exit _code Variable Return Codes exit _code Success Illegal flags specified initialization list Unrecognized device Device version supported Programming failure Blank-check failure Verify failure SRAM configuration failure Description Altera Corporation 111: Embedded Programming Using 8051 Byte-Code Table error_code Variable Error Codes Variable JBIC_OUT_OF_MEMORY error _code Description Action Call malloc() Check available physical jbi_malloc() failed before running compare allocate dynamic memory. with estimate explained "Memory Resources" section. Stack requires greater than Increase JBI_STACK_SIZE. items. File corrupt. Unexpected File. Unexpected Byte-Code parameter. Integer value exceeded legal range bits). Internal error from File. Contents File corrupt. Unexpected ByteCode Player execution. Error File-JBC algorithm specifies incorrect bounds array size other parameters. Byte-Code Player does support VECTOR command. Unused. Check File against good file. Replace file necessary. Check corrupt file. intact, contact vendor created File. Contact vendor file. Contact vendor file. Contact vendor file. Regenerate File replace. Contact vendor with source code error. Contact vendor File. JBIC_STACK_OVERFLOW JBIC_TO_ERROR JBIC_UNEXPECTED_END JBIC_ILLEGAL_OPCODE JBIC_INTEGER_OVERFLOW JBIC_DIVIDE_BY_ZERO JBIC_CRC_ERROR JBIC_INTERNAL_ERROR JBIC_BOUNDS_ERROR JBIC_VECTOR_MAP_FAILED Contact vendor Player that supports VECTOR command. None. JBIC_USER_ABORT Each error, except JBIC_OUT_OF_MEMORY, reflects corrupt incorrect File, improper installation Player. Altera Corporation 111: Embedded Programming Using 8051 Byte-Code Memory Resources 8051 Byte-Code Player takes Kbytes program memory. store File program memory load into data memory just prior execution Byte-Code Player. File size dependent which many devices targeted programming configuring, well whether file uses compression. File uses compression, will take some extra time decompress file, resulting longer programming configuration time. Altera offers option generate Files that compression. override MAX+PLUS default disable compression, following information [system] section your maxplus2.ini file: SVF_JBC_USE_COMPRESSION=OFF This setting results shorter programming times uses more memory because File will significantly larger. Each design must evaluated based upon available memory resources determine whether compressed uncompressed Files should used. Some high-density devices which require large programming file cannot supported Kbyte program memory limitation 8051. Application Note (Using Language Embedded Processor) more information compressed uncompressed file sizes. Programming Times PLDs increase density, performance, complexity, software tools algorithms that support them. result, file sizes algorithms EEPROM, FLASH, SRAM-based architectures have increased complexity. same time, complexity performance 8051 changed. Programming configuration times sub-standard when compared other families processors. should consider this factor when designing system that relies timely in-field upgrades programmable logic. Densities complexity target logic makes 8051 programming times unsuitable certain applications. Performance vary widely function density target logic device speed efficiency 8051. Programming times vary from minutes, 64-macrocell device, more than minutes 256-macrocell device. Altera recommends using 8051 in-field upgrades only when reasons employing 8051 outweigh costs associated with long programming times. these cases, 8051 variant with highest performance should chosen. Altera also recommends using 8051 programming product-term device densities below macrocells. Altera Corporation 111: Embedded Programming Using 8051 Byte-Code Conclusion Easy in-field upgrades made using 8051 family microprocessors Byte-Code Player. Porting ByteCode player accomplished three steps. Source code provided make porting simple support ability upgrade variety device densities. This source code specific 8051 family microprocessors compatible with 8051 device variant. generate program files easily using MAX+PLUS software, which provides control over programming times memory utilization. 8051 microprocessor ideal tool programming low-density devices. Altera Corporation 111: Embedded Programming Using 8051 Byte-Code Innovation Drive Jose, 95134 (408) 544-7000 http://www.altera.com Applications Hotline: (800) 800-EPLD Customer Marketing: (408) 544-7104 Literature Services: (888) 3-ALTERA lit_req@altera.com Altera, Jam, MAX, MAX+PLUS MAX+PLUS trademarks and/or service marks Altera Corporation United States other countries. Altera acknowledges trademarks other organizations their respective products services mentioned this document. Altera products protected under numerous U.S. foreign patents pending applications, maskwork rights, copyrights. Altera warrants performance semiconductor products current specifications accordance with Altera's standard warranty, reserves right make changes products services time without notice. Altera assumes responsibility liability arising application information, product, service described herein except expressly agreed writing Altera Corporation. Altera customers advised obtain latest version device specifications before relying published information before placing orders products services. Copyright 1999 Altera Corporation. rights reserved. Printed Recycled Paper. Altera Corporation Other recent searchesSM320A - SM320A SM320A Datasheet SM3100A - SM3100A SM3100A Datasheet to100V - to100V to100V Datasheet M3D183 - M3D183 M3D183 Datasheet IL3585 - IL3585 IL3585 Datasheet BSM15GD60DL - BSM15GD60DL BSM15GD60DL Datasheet
Privacy Policy | Disclaimer |