Home
ESA 51 USER MANUAL - Electro Systems Associates
Contents
1. SAVE THE CHANNEL VALUE IN REG A 23H THE CONTROL SIGNALS MUX ENABLED LATCHES DISABLED ADC IS IN READ MODE A A A B 90H A SETLTIME AFTER ANALOG SIGNAL IS APPLIED THE 15 GIVEN THE REQUIRED SETTLING TIME A B 23 90H A GIVE THE HIGH TO LOW FOR CONVERSIONSTART amp THE LATCHES 90H A ARE ALSO ENABLED THE CONVERSION TIME P1 0 ENABLE CONVERSION RO 01H ACCEPT THE LOWER 8 A RO BIT DATA THROUGH PORT A 8155 DPTR 49001H AND STORE IT IN DATA ODPTR A MEMORY 9001 LOCATION RO ACCEPT THE RO UPPER 4 BIT DATA FROM PORT 8155 DPTR 9002H AND STORE IT IN DPTR A DATA MEMORY 9002 LOCATION DPTR CHANNEL FO TO SELECT PROGRAM MEMORY OUTPUT DISPLAY THE MESSAGE CHANNEL DPTR 9000H DISPLAY DPTR THE 71H A CHANNEL 10 13 8049 12 13 02 804 90 80 804 C2 D5 8051 12 04 04 8054 90 90 02 8057 EO 8058 F5 71 805A 12 13 D2 805D 90 90 01 8060 EO 8061 F5 71 8063 12 13 D2 8066 12 12 BB 52 8069 B4 2C 02 806C 80 13 806E 2D 02 S1 8071 80 07 8073 64 OD 56 8075 60 8077 02 00 03 807 90 90 00 8070 EO 807E 14 807F 80 05 8081 90 90 00 8084 EO 8085 04 8086 54 07 ST 8088 FO 8089 75 A0 1 808C 02 80 10 808F OD 0A 43 48 41 8094 4E 4 45 4C 20 8099 3D 20 00 809C 20 20 20 20 20 OAD Uo ESA 51 USER S MANUAL CHDC
2. COMMAND FUNCTION FORMAT A Assembler A address B Clear Display Set Breakpoint in Program memory external Data memory B D PID I CIS address 1 address 2 C Compare a block of memory with destination block C PIDII address 1 address 2 PIDII address 3 D Disable breakpoint in program memory or data memory D PID E Enable breakpoint in program memory or data memory E PID F Fill a block of memory with a constant or search a string of Data in program memory external data memory and internal Data memory PIDII address 1 address 2 data data data data S G Transfer the processor control from the monitor to user Program G address H Help List all the commands supported by the Serial Monitor H J Jump to address J address HAD ESA 51 USER S MANUAL 3 3 NULI Modify Display Move memory contents in program memory External data memory and internal data memory with all combinations address 1 address 2 address 3 P Programmer Execute one instruction of user program S address Z Disassembler Z addr1 addr2 3 3 1 M MODIFY COMMAND FUNCTION The M Modify Memory command is used to examine the contents of specified memory locations Further if location are in RAM their contents can be altered if desired and block move contents of memory from program data or internal memory to program data or internal memory for all
3. T 13 04 RPT OB BB D2 OAD Uo ESA 51 USER S MANUAL DSPCHR 03E6H PUTBYTE EQU 13D2H CLRLCD EQU 03BBH MNEMONICS COMMENTS ORG 8000H MOV R2 00H Store count 00 R2 MOV DPTR 0E904H DPTR Read the dipswitch JNB ACC 3 L1 LCALL CLRLCD Clear the LCD display MOV A R2 MOV 71H A LCALL Display the 10 6 8012 8014 8015 8017 801 801 801 8021 8023 8026 8029 802 802 8030 8032 8033 8034 8037 803A 803C 803E 803F 8042 8043 8046 80 EA 12 7 74 12 DB 12 12 12 12 EA 24 02 7B 7C 1B BB 1C BC 22 OF 71 13 03 08 03 F9 80 80 80 80 01 21 00 00 00 D2 00 11 LOOP L2 DELAY BACK1 BACK2 SIMP MOV MOV LCALL MOV MOV LCALL LCALL LCALL LCALL LCALL MOV ADD DA MOV CJNE LJMP MOV MOV DEC CJNE DEC CJNE RET L2 A R2 71H A PUTBYTE R3 03H A 08H DSPCHR R3 LOO DELAY DELAY DELAY DELAY R2 01 A R2 A P R2 21H RPT 0000H R3 0F R4 0F R3 FH FH count on LCD Display the count on console Perform decimal adjust ACC Repeat the process till the count is equal to 20 Delay routine R3 00H BACK1 R4 R4 00H BACK1 10 10 Program to display 24 hours digital clock in serial mode Execute
4. V x y indicates version x and revision y gt Now 51 is ready for operation in serial mode NOTE If the LCD module is installed the message SERIAL will be displayed on the display 2 2 2 NO RESPONSE IN SERIAL If there is no response from 5 51 in serial mode after installing it as described in the previous section check the following items a Check the configuration of ESA51 again DIP Switch settings b Check the power supply connections and voltages Check the baud rate of ESA51 and host connected to it d If a host system is the controlling device make sure that the XT51 driver program is running the RS 232 C RS 485 cable is connected to the port and the port is working e Check the RS 232 C RS 485 connections at both the ends Refer Appendix C for the interfacing details f Check the handshake signals of RS 232 C interface Ref Appendix C NOTE DIP Switch status is read only at power ON Reset If the user changes the settings these changes will be effective by pressing the RESET key or restart the trainer by switching OFF and ON the power supply If the problem still persists please contact the manufacturer service center 2 2 3 INSTALLATION PROCEDURE FOR STAND ALONE MODE OF OPERATION a Select stand alone mode operation Ref 2 1 1 b Connect the power supply of required capacity to 5 51 and switch on the power Now the following message appears on the LCD for
5. EBOC Reserved Reserved EBOD Input Port Register Output Port configuration register OPCR EBOE Start counter command Set Output port Bits commands EBOF Start counter command Reset Output Port Bits commands Separate serial connections are provided on the interfacing for interfacing with RS 232C and RS 485 ports HAD ESA 51 USER S MANUAL 5 5 14 9 female type connector for RS 232 communication 15 9 male type connector for RS 485 communication To establish serial communication using ESA 51 the user has to interface the serial terminal with either of these connector using appropriate serial cable 5 9 PROGRAMMABLE PERIPHERAL INTERFACE DEVICES ESA 51 has two numbers of 8255As Programmable Peripheral Interface Devices Each 8255A consists of a command port and three 8 bit programmable input output ports called Port A Port B and Port C The port addresses for these devices can be found in table 5 2 in section 5 4 The two 8255As at U18 amp U42 completely available to user The port signals are available on connectors J7 amp J10 5 10 PROGRAMMABLE INPUT OUTPUT AND TIMER ESA 51 has one 8155 programmable I O and timer The 8155 has 256 bytes of RAM two 8 bit and one 6 bit programmable input output ports command port and two 8 bit registers to load counter for timer The Port A of the 8155 is configured as input to read the data from ADC output The Port B is configured as output to provide
6. combinations FORMAT M address 1 address 2 PIDII address 3 OPERATION 1 Enter M followed by memory type the address of the memory location to be examined and then enter CR The monitor will now output the contents of that location 2 To modify the contents of this location the user can enter the new value now 3 Enter a CR either immediately or after the entry of a new value to examine modify the next sequential location A Esc instead of the CR terminates the command and returns the monitor to the command entry mode ERROR CONDITION 1 Trying to modify the contents of non existent or PROM location Examples Example 1 Examine the PROM locations 11H gt MP11 lt CR gt gt 0011 FF lt Esc gt gt OAD JDE ESA 51 USER S MANUAL 3 4 Example 2 Examine few RAM location starting at 8820H and modify contents of the location 8822H gt MD8820 lt CR gt 8820 CR 8821 xx 8822 xx 55 lt CR gt 8823 xx lt Esc gt gt 3 3 2 M DISPLAY MEMORY COMMAND FUNCTION This command is used to display the contents of the program memory external or internal data memory FORMAT PIDIII address 1 address 2 CR OPERATION 1 To use this command enter M when prompted for command entry After entering M enter the memory type and then starting address of the memory block whose contents are to be displayed then enter a comma enter the end address of t
7. onwards If lt Esc gt is pressed control returns to the monitor 8 3 4 R COMMAND This command is used to transfer contents of the EPROM into the ESA 51 memory space This command requires the following four parameter EPROM Type same as for command EPROM Start same as for B command EPROM End same as for B command Buffer Start starting address in ESA 51 memory space OAD ESA 51 USER S MANUAL 8 6 The parameter display and modification procedures are menu driven and are completely similar to the ones described for P command The starting and ending address of the EPROM must satisfy the relations described for the B Blank Check command After the optional modification of the parameter the contents of the EPROM specified range are transferred into ESA 51 memory starting at the specified Buffer starting address The EPROM address and data read are displayed in the display fields During the transfer as each byte is written into memory it is read back and verified If the write 1s successful for all locations a 16 bit checksum is displayed and control returns to the sub menu If an error occurs during transfer unsuccessful write into location the following message is displayed Read fails 9 XXXX Where XXXX is the address of location where write failure occurred Then control returns to the monitor 8 3 5 EXAMPLE From monitor program the contents of locations 8000H to 8FFFH into a 2764 starting at
8. 10 16 DLE 30 48 0 11 17 DCI 31 49 1 12 18 DC2 32 50 2 13 19 DC3 33 51 3 14 20 DC4 34 52 4 15 21 35 53 5 16 22 5 36 54 6 17 23 37 55 7 18 24 38 56 8 19 25 39 57 9 1 26 SUB 3A 58 1B 27 5 59 1 28 5 3C 60 lt 1D 29 GS 3D 61 1 30 5 62 gt 1 31 US 3F 63 HAD ESA 51 USER S MANUAL APPENDIX 2 Hexadecimal Decimal Character Hexadecimal Decimal Character 40 64 60 96 41 65 61 97 42 66 62 98 b 43 67 C 63 99 44 68 64 100 45 69 65 101 46 70 66 102 f 47 71 G 67 103 g 48 72 68 104 h 49 73 I 69 105 4A 74 J 6A 106 1 4 75 6B 107 k 4C 76 L 6C 108 1 40 71 109 4 78 110 4 79 6F 111 50 80 70 112 51 81 71 113 4 52 82 72 114 53 83 5 73 115 5 54 84 74 116 55 85 U 75 117 u 56 86 V 76 118 57 87 W TI 119 58 88 X 78 120 59 89 X 79 121 y 5A 90 7 122 7 5 91 7B 123 92 7 124 5D 93 7D 125 SE 94 A 7E 126 SF 95 TF 127 DEL HAD ESA 51 USER S MANUAL SCHEMATICS ESA 51 USER S MANUAL ELECTRO SYSTEMS ASSOCIATES PVT LTD 4215 J K Complex First Main Road Subramanyanagar P O Box No 2139 BANGALORE 560 021 INDIA Fax 91 80 3325615 Phone 3323029 3322924 email esaindia vsnl com www esaindia com
9. 7 5 Routine to put character on console 20 Provide space DSPCHR 20 DSPCHR A R7 71H A PUTBYTE 20 DSPCHR 20 DSPCHR 5 5 R1 00H Keep seconds 00 1 in reg R2 7 02 A 08H DSPCHR DELAY Delay Routine A R1 A 01H A R1 A R1 60H SEC Check for 60 sec or not A R7 A 01H A R7 A R7 60H MIN Check for 60 min over or not R3 07H A 08H 10 8 8058 12 805 DB 805D 74 805F FF 8060 F5 8062 12 8065 7B 8067 74 8069 12 806C DB 806E DO 8070 ED 8071 24 8073 D4 8074 FD 8075 BD 8078 7B 807A 74 807C T2 807F DB 8081 74 8083 F5 8085 12 8088 7D 808A 7F 808C T2 808F 02 8092 7A 8094 7C 8096 7B 8098 1B 8099 BB 809C LE 809D BC 80 0 1 80A1 BA 80 4 22 Subroutine 80A5 7B 80A7 74 80A9 12 80AC DB 80AE EF 80AF F5 80B1 12 80B4 74 ADO 03 F9 01 71 13 07 08 03 9 05 01 24 04 08 03 9 00 71 13 00 00 80 80 05 00 00 00 to 04 08 03 F9 71 13 20 D2 LOOP3 E6 53 LOOP4 E6 D2 cl DELAY 2 6 0 LCALL DINZ MOV MOV MOV LCALL MOV MOV LCALL DINZ POP MOV ADD DA MOV CJNE MOV MOV LCALL DINZ MOV MOV LCALL MOV MOV LCALL LIMP MOV MOV MOV DEC CJNE DEC CJNE DEC CJNE RET display minu
10. 80F8 49 4E 20 53 45 80FD 43 0D OA 00 8101 02 80 06 LJMP START 10 11 Program to perform addition of two numbers This program can be executed in serial mode or in stand alone mode Two numbers are taken from locations 9000H amp 9001H of Data memory They are added and the result is stored in the location 9002H of data memory 13D2 PUTBYTE EQU 13D2H ADDRESS OBJECT MNEMONICS COMMENTS 8000 ORG 8000H 8000 90 90 00 MOV DPTR 9000H Keep the data ESA 51 USER S MANUAL 10 10 8003 EO 8004 F5 FO 8006 90 90 01 8009 EO 800A 25 FO 800C 90 90 02 800F FO 8010 F5 71 8012 12 13 D2 8015 02 00 00 in 9000h amp 9001h locations of data memory MOVX A DPTR MOV OFOH A MOV DPTR 9001H MOVX A DPTR ADD A OFOH Add them store MOV DPTR 9002H the result in 9002 location of data memory MOVX DPTR A MOV LCALL PUTBYTE Display the result LJMP 0 10 12 Program to perform subtraction of two numbers This program can be executed either in stand alone mode or in serial mode Two numbers are taken from locations 9000H amp 9001H of data memory They are subtracted and the result is stored in the location 9002 of data memory 13D2 ADDRESS OBJECT 8000 8000 90 90 01 8003 EO 8004 F5 FO 8006 90 90 00 8009 EO 800A 95 FO 800C 90 90 02 800F FO 8010 F5 71 8012 12 13 D2 8015 02 00 00 PUTBYTE EQU 13D2H MNEMONICS COMMENTS ORG 8000H MOV DPTR 9001H Keep data MOVX A
11. Examples gt 8000 CR Address Opcode Mnemonic 8000 E9 MOV CR 8001 74 42 MOV A 42H CR 8003 Esc gt OAD 920 ESA 51 USER S MANUAL 4 16 4 3 12 7 DISASSEMBLER COMMAND Disassembly is an extremely useful technique often employed during debugging FUNCTION A Disassembler converts machine language codes into assembly language mnemonics making it easy for user to understand verify the program OPERATION To use this facility type Z when prompted for command by the Serial Monitor 27 addr1 addr2 CR Address Object Mnemonic The disassembled code is displayed according to the above format The display can be halted at any point by Ctrl S and restarted by Ctrl NOTE If the disassembly of the last instruction requires the reading of data from locations beyond the specified address2 the system will read them to complete the disassembly For example if the specified address2 is 81FFH and the code at 81FFH is 20H which is a 3 byte instruction the system will read the required data from location 8200H and 8201H to complete the disassembly Example 270 6 CR Address Object Mnemonics 0000 02 00 30 LJMP 0030H 0003 02 2A BE LJMP 2ABEH 0006 FF MOV R7 A gt 4 3 13 HELP COMMAND FUNCTION The HELP command is used to list all the commands supported by the serial monitor FORMAT H CR OPERATION As soon as and CR 15 entered by the user in response to the command prompt
12. is displayed on the next line with a sign attached pointing to the place where the error occurred and a new command prompt is issued The possible error conditions are described while illustrating the individual commands Command execution occurs only after a valid delimiter a CR is entered Hence a command entry can be cancelled anytime before the delimiter is entered by pressing Esc The command prompt character is output on a new line 4 3 MONITOR COMMANDS Each command described in this chapter consists of one to two character followed by appropriate parameters and data The commands are summarized in Table 4 1 and are described in detail in the section which follows In the table as well as in the subsequent description the following notation is used NOTATIONAL CONVENTIONS SYMBOL NAME USAGE Curly braces with Encloses a required argument 1 or more Ellipsis Times Square brackets Encloses an item that appears 0 or 1 time Square brackets Encloses an item that appears 0 or more times Vertical bar Separates alternative items in a list Italics Indicates a descriptive item that should be Replaced with an actual item d54 ESA 51 USER S MANUAL 4 2 TABLE 4 1 SUMMARY OF SERIAL MONITOR COMMANDS COMMAND FUNCTION FORMAT A Assembler address B Clear Display Set Breakpoint in Program memory external Data memory B D PID
13. the system will gather the data in the specified address range of the ESA 51 reformat the data into INTEL 8 bits HEX record store the data in specified file Uploading in progress XXXX While the uploading is going on the system will display the starting address XXXX of each record being uploaded Once the uploading is complete XT51 will let user specify another address range User may specify a new address range or enter Esc to terminate uploading operation The following error message may appear during upload and download operations 1 Invalid function number This is XT51 internal error therefore contact ESA technical support for assistance File not found Path not found No more files om Access denied Invalid file handled Insufficient disk space Unable to continue upload 9 Colon is not present at the start of record 10 Invalid data in source file the following record 11 Check sum error in the following record 9 4 3 DOS COMMANDS At the command prompt gt any valid DOS command can be entered preceded by XT51 environment is saved and the DOS command is executed Then XT51 environment is restored and XT51 command prompt be displayed again HAN ESA 51 USER S MANUAL 9 1 9 4 4 BOTTOM LINE During the session XT51 display many of the XT51 commands at the bottom line in reverse video for convenience of user The bottom line is displayed as
14. 5 18 5 6 1 1 19 1 2 7 6 20 1 amp 1 7 21 P1A0 9 P1B4 22 10 5 23 6 11 1 2 24 1 7 12 P1B3 25 5V 13 0 26 GND AD DO J9 PRINTER CONNECTOR PIN NO SIGNALS PIN NO SIGNALS euoo otunrutc 11 12 13 STROBE DATA 0 DATA 1 DATA 2 DATA 3 DATA 4 DATA 5 DATA 6 DATA 7 NC BUSY NC NC 14 15 16 17 18 19 20 21 22 23 24 25 GND GND GND GND GND GND GND GND ESA 51 USER S MANUAL 5 11 6 MONITOR ROUTINES ACCESSIBLE TO USER ESA51 monitor offers several user callable routines both in the stand alone and serial modes of operation details of which are given below These routines can be used to considerably simplify the program development work NOTE Users should as general rule save the registers of interest before calling the monitor routines and restore them after returning form the monitor routines 6 1 STAND ALONE MODE Calling Mnemonic Function Description Address 0200H LCDINIT To initialize the LCD module registers are affected 035DH LCDWR Displays one character to the LCD display module Character to be displayed should be in accumulator All registers are affected 03A1H LCDOUT Displays a string of character on LCD The string should end with a zero which is not output The parameter
15. Command Assemble Breakpoint Compare Memory Disable Brkpnt Enable Brkpnt Fill Search MEM Go Execution Help Jump Memory N SS Count Register Single Step Z Disassembly Syntax A address B D PID I CIS PID address address2 C PIDII address address2 address3 D PID E PID PIDII address1 address2 data data data data S G address H J address M PIDII address 1 address2 PIDII address3 N count Single Step Count lt OFFH gt R Register S R address Z address 1 address2 OAD ESA 51 USER S MANUAL NULI 4 SERIAL MONITOR 4 1 INTRODUCTION This chapter describes the commands supported by the serial monitor program The serial monitor allows ESA 51 to be operated from a host computer connected via the RS 232 C RS 485 serial interface refer to chapter on Hardware and Appendix C on RS 232 C RS 485 connector details The system must be configured for serial mode of operation as described in section 2 1 1 The commands are described in this chapter When the system enters serial mode of operation the sign on message ESA 8051 Serial Monitor V is displayed x is the current version number and y is the revision number on one line and prompt gt on the next line indicating that the monitor is ready to accept commands from the user 4 2 STRUCTURE OF MONITOR COMMANDS Whenever the monitor is ready to accept a comm
16. DPTR 9000 and 9001H MOV OFOH A location of Data Memory MOV DPTR 9000H MOVX A DPTR SUBB A OFOH Subtract them MOV DPTR 9002H Store the result MOVX DPTR A in 9002H location MOV 71H A Of Data Memory LCALL PUTBYTE LJMP 0 10 13 Demonstration program for on board DAC The program will generate a square wave output at DAC O P J12 ADDRESS OBJECT 8000 8000 75 A0 1 8003 78 00 OAD Uo ESA 51 USER S MANUAL MNEMONICS COMMENTS ORG 8000H MOV P2 0E1H MOV RO 00H 8155 CONTROL PORT 10 11 8005 74 02 02 CONFIGURE 8155 PORTB AS O P PORT 8007 F2 MOVX 8008 08 INC RO 8009 08 INC RO 800A 74 FF AGAIN MOV 800 2 MOVX RO A OUTPUT FFH TO PORTB FOR 5V AT DAC O P 800D 12 80 17 CALL DELAY CALL DELAY ROUTINE 8010 EA CLR A 8011 F2 MOVX RO A OUTPUT OOH TO PORTB FOR OV AT DAC O P 8012 12 80 17 CALL DELAY CALL DELAY ROUTINE 8015 80 F3 SJMP AGAIN REPEAT THE PROCESS 8017 7E FF DELAY MOV R6 FFH THE DELAY ROUTINE 8019 DJNZ R6 BACK 801B 22 RET 10 14 Demonstration program for 12bit ADC for both multi 6 single channel operation When the ADC is operated in single channel mode the at U47 need not be populated and JP15 amp JP24 are open Analog input is applied at screw terminal TP When the ADC is in multi channel mode the MUX is populated and eight channels are available as selected by the channel select lines The jumpers JP11 to JP
17. JUMP TO ADDRESS SET CHANGE PC COMMAND FUNCTION The J Command is used to change the program counter value to the desired address before executing a program by either GO command or SINGLE STEP command FORMAT J address CR OPERATION To use this command enter J when prompted for command entry Now enter the desired starting address of the program you wish to execute Enter CR Now command prompt reappears on the next line 4 3 8 G GO COMMAND FUNCTION The GO command is used to transfer the control of the system from monitor to the user s program FORMAT G address 1 CR OPERATION To use this command enter G when prompted for command entry Execution starts from the PC value d54 ESA 51 USER S MANUAL 4 10 Now if you wish to modify the value of the the address to which control is to transferred enter the new value Enter CR Now the user context is restored and control is transferred to the program starting at the current value of the user program counter A powerful debugging tool breakpointing a program is available to the user To use this facility set one or more breakpoints in program or data memory using B command Now the control is transferred to the program starting at the current PC value upon reaching any one of the specified breakpoint addresses control is returned to the monitor Monitor saves the complete user context displays the current PC value and then issues a command prompt
18. NOP NOP NOP NOP NOP NOP NOP LJMP BACK 10 15 APPENDIX COMPONENT PLACEMENT DIAGRAM APPENDIX ASCII CODES APPENDIX RS 232C RS 485 CABLE REQUIREMENTS APPENDIX D PRODUCT LIST INSTRUCTION SET APPENDIX CONNECTOR DETAILS RS 232 CABLE DETAILS THE ESA 85 2 REQUIRES A NULL MODEM CABLE IN ORDER TO COMMUNICATE WITH OTHER SYSTEMS THESE ARE THE CONNECTIONS REQURIED FOR THE NULL MODEM CABLE EXD PN lt RXD pin 3 PN 3 e TXD pin 2 RIS PI 4 lt CTS 5 CIS PNS S T RTS 4 DSR P0 lt DTR pin 2 DIR Pin 20 lt DSR pin 6 GND PIN NUM UN lt GND pin 7 NOTE 1 Use male of 25 PIN D Connector on ESA85 2 side and appropriate on other side 2 If hardware handshaking is not required interconnect RTS and CTS PIN 4 and 5 and DSR and DTR PIN 6 and 20 Ad AD i DO ESA 85 2 User s Manual APPENDIX 1 Hexadecimal Decimal Character Hexadecimal Decimal Character 00 0 NUL 20 32 SP 01 1 21 33 02 2 STX 22 34 03 3 23 35 04 4 24 36 05 5 25 37 06 6 26 38 amp 07 7 27 59 08 8 5 28 40 09 9 29 41 10 LF 2 42 11 2 43 0 12 2 44 00 13 20 45 14 50 2 46 15 51 2 47
19. NOTES 1 When any one of the breakpoints is reached control is returned to the monitor after saving the registers 2 Specifying more than one breakpoint address is useful when debugging a program section containing branch instructions EXAMPLE Enter the program presented as example 1 for the GO command from the stand alone mode monitor section 3 3 8 gt 68800 CR The program can be executed by setting up breakpoints The procedure is as follows 1 Set a breakpoint in the program memory or data memory using BSP address CR or BSD address CR 2 If the desired breakpoints are in a range then enter BSP addrl addr2 CR or BSD addrl addr2 CR 3 Enable breakpoints using EP command or ED command for program or data memory respectively 4 Execute the program using G command Note single step execution of program memory disables breakpoint memory 5 Cause of break with the program break address are displayed 6 Enter CR to continue The program starts executing from the point at which break has occurred 7 The above procedure is repeated if program encounters another breakpoint 8 Enter Esc to terminate the process 4 3 9 S SINGLE STEP COMMAND The ESA 51 trainer enables you to debug a program by single stepping the instructions The command is used to execute a program one instruction at a time With each instruction executed control is HAN ESA51 USER S MANUAL 4 11 returned to monitor Thus this c
20. Register A A Register B B Stack Pointer SP Flags Register PSW Hon ESA 51 USER S MANUAL 4 8 Data Pointer High DPH Data Pointer Low DPL Register THO THO Register TLO TLO Register TH1 THI Register TL1 Register P1 P1 Register P3 P3 Register Counter High PCH Register Counter Low PCL Register RO RO Register R1 Register R2 R2 Register R3 R3 Register R4 R4 Register R5 R5 Register R6 R6 Register R7 R7 NOTE The flag register PSW is also displayed in bit format when register command is executed The meaning of the pattern is as follows PSW bit Abbreviated as Functions PSW 7 C Carry Flag PSW 6 A Auxiliary Flag PSW 5 F Flag 0 available to the user PSW 4 B Register Bank selector bit 1 PSW 3 B Register Bank Selector bit 0 PSW 2 O Overflow flag PSW 1 G Usable as a general purpose flag PSW 0 P Parity flag 51 USER S MANUAL 4 9 Examples Example 1 gt lt gt SP PSW DPH DPL THO TLO TLI PCH PCL 0 F0 81 00 83 82 8C 8A 8D 8B 90 BO 00 00 07 00 00 00 00 00 00 00 00 00 RO RI R2 R3 RA R5 R6 R7 PSW 00 01 02 03 04 05 06 07 CAFBBOGP 00 00 00 00 00 00 00 00 0000000 0 Example 2 Examine and alter register A and then examine register B RA CR A E0 24 CR B F0 25 lt gt 4 3 7 J
21. S MANUAL 10 1 ADO 10 2 Program to perform multiplication of two numbers present at data memory Location 9000 amp 9001 and storing the result in 9002 amp 9003 Data memory ADDRESS OBJECT MNEMONICS COMMENTS 8000 ORG 8000H 8000 90 90 01 MOV DPTR 9001H Keep data in 9000h amp 9001h data memory location 8003 EO MOVX A DPTR 8004 F5 FO MOV OFOH A 8006 90 90 00 MOV DPTR 9000H 8009 EO MOVX DPTR 800 4 MUL AB Perform multiplication Operation 800B 90 90 02 MOV DPTR 9002H Store the result in 9002h amp 9003h of data memory 800 FO MOVX QDPTR A 800F A3 INC DPTR 8010 E5 FO MOV 8012 FO MOVX QDPTR A 8013 02 00 00 LJMP 0 10 3 Program to perform Division of 2 numbers Execute the program either in stand alone mode or in serial mode 2 numbers available at 9000 amp 9001 of Data memory After division operation store the result in 9002 amp 9003 Data memory ADDRESS OBJECT MNEMONICS COMMENTS 8000 ORG 8000H 8000 90 90 01 MOV DPTR 9001H Keep data in 9000h 9001h data memory location 8003 DPTR 8004 F5 FO MOV B A 8006 15 82 DEC DPL 8008 EO MOVX A DPTR 8009 84 DIV AB Perform division operation OAD Uo ESA 51 USER S MANUAL 10 2 800 90 90 02 DPTR 9002H Store the result in 9002h amp 9003h data memory 800D FO MOVX DPTR A 800 800 FO 8011 FO MOVX DPTR A 8012 02 00 03 LJMP 3 10 4
22. chapter describes the use of the EPROM Programmer system The ESA 51 trainer and EPROM programmer interface module with a 26 core flat ribbon cable together form the programmer system The system permits the user to program verify blank check and read any of the popular EPROMs 2716 through 27512 The system consists of the necessary hardware and software The software can be invoked either from the stand alone mode monitor or from the serial monitor A 28 pin ZIF socket is provided for placing the EPROMs When 24 pin EPROM is replaced it must be aligned with the bottom rows i e top two rows of ZIF are to be left blank The system uses intelligent programming algorithm whenever possible which reduces the programming time significantly OAD 8 1 JDE ESA 51 USER S MANUAL The devices supported by system and type number to be entered by user are listed below Device Type number to be entered by the user 2716 25 V 2716 27 16 25 V 2716 2732A e 21V 732A 27 32 21V 732A 2132 9 25 V 2732 2732 25 V 2732 2764 9125 764A 27C64D 12 5 V 764A 27 64 21V 2764 2764 21V 2764 27128A 125V 128A 27 128 125V 128A 27128 21V 0128 27256 125V 0256 27C256 9 12 5V 0256 27 256 21V 2256 27512 9125 V 0512 The device selection is totally software controlled and no hardware changes or jumper settings are necessary for selecting any of the above l
23. data for the on board DAC The Port C is configured as input port to read the most significant bits of ADC data VECTOR ADDRESS LOOK UP TABLE FOR INTERRUPTS Function Interrupt source Vector address Trainer Address External Interrupt 0 IEO 0003H 276CH Timer Interrupt 0 000BH FFFOH External Interrupt 1 IEI 0013H FFF3H Timer Interrupt 1 TFI 001BH FFF6H Serial Interrupt RI amp TI 0023H FFF9H 5 11 8 CHANNEL 12 BIT A D CONVERTOR ESA 51 features an optional onboard 8 channel 12 bit ADC The interfacing circuit consists of analog multiplexer enables data from up to eight different analog sources to be acquired This circuit can accept either unipolar signals in the range 0 to 10V or bipolar signals of 5V to 5V or in the range of 10V to 10V The voltage span can be selected by placing suitable jumpers This circuit is built around the industry standard Fast ADC AD1674 has built in clock and sample hold circuit which completes a conversion in 10usec This interfacing finds extensive use in the fields of analog measurements transducer interfacing Industrial monitoring etc For making use of the ADC the user has to connect 12V and 12V at connector J3 DESCRITION OF THE CIRCUITS Please refer to the schematic diagram presented in appendix HAD ESA 51 USER S MANUAL 5 6 Single Channel Multi channel Operation Jumper 7 15 decides whether the circuit is intended for single channel or 8 chan
24. files into ESA 51 for execution Thus the extensive development facilities available on the PC can be used to supplement the facilities available on ESA 51 Further XT51 allows uploading of data from memory of ESA 51 to the computer The data so uploaded is saved in a disk file Thus this facility can conveniently be used to save user program 9 2 INSTALLATION NOTE Make sure that you have made a back up copy of XT51 EXE before proceeding with the installation The detailed installation procedure is as follows a Configures ESA 51 for serial mode of operation and set the serial port of ESA 51 for 9600 Baud and No parity Refer sections 2 1 1 and 2 1 3 b Connect the computer system to ESA 51 over the COMI COM2 serial port Refer to Technical Manual of your system for details regarding the signal definition on COM ports The signal definition of the RS 232 C port of ESA 51 can be found in Appendix C Insert the diskette containing the file XT51 EXE into the available drive and run program by typing 51 or XT51 B to select black and white mode if computer system has a CGA monitor d Now the following message appears on the screen XT51 Version 1 0 ELECTRO SYSTEM ASSOCIATES PVT LTD BANGALORE ALT S Set communication Parameters CTRL F1 Help ALT Fl Command Help lt Esc gt Clear Command HAN 51 USER S MANUAL 9 2 If options is selected communication parameters Serial Port COM
25. the system lists in alphabetical order all the commands supported by the serial monitor The display appears as shown below H CR HOB ESA51 USER S MANUAL 4 17 Assemble Breakpoint Compare Memory Disable Brkpnt Enable Brkpnt Fill Search MEM Go Execution Help Jump Memory N SS Count Register Single Step Z Disassembly Syntax A address B D PID I CIS PID address 1 address2 C address1 address2 PIDII address3 D PID E PID PIDII address1 address2 data data data data S G address H J address M address1 address2 address3 count Single Step Count lt gt R Register S R address Z address1 address2 U amp V Commands are reserved for System usage OAD wg ESA 51 USER S MANUAL 4 18 5 HARDWARE 5 1 INTRODUCTION This chapter describes the hardware design details of ESA 51 Appendix F gives the connector details and Appendix A has the component layout diagram The design details are discussed in the following order a CPU Address Bus Data Bus and Control Signals b Memory Addressing Keyboard Display Interface d Programmable Peripherals and Serial Interface e ADC amp DAC Section f Bus Expansion g Connector Details 5 2 CPU ADDRESS DATA AND CONTROL SIGNALS ESA 51 uses 8031 8051 Microcontroller operated with 11 0592 crystal The on b
26. to destination memory location starting from destination address 3 The system determines if there is any overlap between source and destination block then the memory location will be over written from address2 onwards ERROR CONDITIONS 1 Specifying an end address value which is less than the value of the start address 2 Trying to move data into non existent or read only memory location Examples Example 1 Move the contents of the location 800H through 80FH to the memory block beginning at 8840H gt 800 80 8840 lt gt gt OAD PO ESA 51 USER S MANUAL 3 6 2 gt MP800 80F P200 lt CR gt Error gt An attempt to move data into ROM location produces the error message 3 3 4 F FILL MEMORY COMMAND FUNCTION This command is used to fill a block of memory with specified constant FORMAT F PIDII address1 address2 constant CR OPERATION 1 To use this command enter F when prompted for command entry and enter the type of memory to be filled 2 Now enter the starting address of the block of memory to be filled Enter a comma Now enter the ending address of the block Again enter a comma Now enter the constant Press the CR to start the command execution 3 Monitor now fills the block of memory from address1 to address 2 with the specified constant Then the monitor displays the command prompt sign ERROR CONDITIONS 1 Specifying a value for t
27. 1000H R Read Blank Check Program Verify Exit Enter option EPROM 2732 2764 CR Buffer start 0000 8000 CR Buffer End 0000 8FFF CR EPROM Start 0000 1000 CR PROGRAMMING IN PROGRESS Checksum 1724 R Read Blank Check Program Verify Exit Enter option E gt OAD 8 7 Uo ESA 51 USER S MANUAL 9 COMMUNICATION WITH A HOST COMPUTER SYSTEM 9 1 INTRODUCTION As already noted ESA 51 operating in the serial mode can be connected to a host computer system When a computer system is the controlling element it must be executing a driver software to communication with ESA 51 XT51 is such an optional communication package which allows the user to establish a communication link between asynchronous serial ports of the computer COM1 COM2 and ESA 51 XT51 is supplied as a file on a 312 2SHD diskette and can be executed on a PC under PC DOS MS DOS operating system A suitable RS 232 C RS 485 cable has to be used for connecting ESA 51 to a PC HAN 51 USER S MANUAL 94 51 fully supports all the command of ESA 51 Further it allows contents of a disk file to be downloaded from the computer system into memory of ESA 51 User can develop assembly language program on the PC cross assemble them using a suitable cross assembler to generate object code files and then use XT51 to download these object code
28. 11 S Single Step Command test 3 12 S Single Step Command with disassembly 3 12 B Breakpoint Commands 3 12 Clear Br akpoint uiui eere tio ext eaii 3 13 Set Break DO o 3 13 Display Break ie deis 3 13 Enable seed tas 3 14 Breakpoints 3 14 3 3 11 3 3 12 3 3 13 4 41 42 4 3 4 34 4 3 2 4 3 3 4 3 4 4 3 5 4 3 6 4 3 7 4 3 8 4 3 9 4 3 9 1 4 3 9 2 4 3 9 3 4 3 10 4 3 10 1 4 3 10 2 4 3 10 3 4 3 10 4 4 3 10 5 4 3 11 4 3 12 4 3 13 CHAPTER 5 5 1 5 2 2 3 5 4 5 5 5 6 A Assembly Command sisese a E 3 15 Z Disassembler 3 16 H Help Command 3 16 SERIAL 4 1 0 4 18 t c 4 1 Structure of Monitor Commands arar 4 1 Mo itor Commands vet 4 2 M Modify Command a A 4 4 M Display Command 4 5 M Move memory Command ii 4 5 F Fill memory 4 6 Compare memory Command arenas 4 7 Exanune Modity Register Command eerte 4 8 J Jump to Address Set change PC Command 4 10 Commatid sister tee etr e deer 4 10 S Single Step Command oso dataset detti ient dia iu omes 4 11 SR Single Step with Register Display Co
29. 15 are closed The analog signals are applied at the screw terminals provided at J11 When the ADC is in multi channel mode no signal is applied at TP 13D2 PUTBYTE EQU 13D2H 12BB GETCH EQU 12BBH 0404 OUTPUT EQU 404H ADDRESS OBJECT MNEMONICS COMMENTS 8000 ORG 8000H 8000 E4 CLR A 8001 90 90 00 MOV DPTR 9000H 8004 FO MOVX DPTR A CLEAR THE DATA MEMORY LOCATION 9000H TO STORE THE CHANNEL NO 8008 78 00 MOV RO 00H MAKE THE 8155 PORTA 800A 74 02 MOV A 02H amp PORT B AS OUTPUT 800C F2 MOVX RO A PORTS 800D 75 90 03 MOV 90H 03H MUX amp LATCHES ARE DISABLED amp ADC IS IN QO ESA 51 USER S MANUAL 10 12 OAD QO 8010 8011 8012 8013 8015 8017 8019 801C 801 8020 8022 8024 8026 8027 8028 8029 802 8020 802 8031 8032 8033 8034 8035 8037 80 803 803E 8040 8043 8046 8047 EO 23 23 F5 44 5 02 E5 44 F5 54 F5 00 00 00 D2 78 2 90 0 08 08 2 54 90 FO 90 C2 12 90 EO 0 23 90 80 0 23 90 90 90 01 90 0 90 80 D5 04 90 71 B2 01 02 04 00 SRL ESA 51 USER S MANUAL RL RL MOV ORL MOV LIMP MOV ORL MOV ANL MOV NOP NOP NOP SETB MOV MOVX MOV MOVX INC INC MOVX ANL MOV MOVX MOV CLR LCALL MOV MOVX MOV READ MODE DPTR TO SELECT THE CHANNEL
30. 3 Esc gt OAD ESA 51 USER S MANUAL 3 15 3 3 12 Z COMMAND Disassembly is an extremely useful feature often employed during debugging FUNCTION A Disassembler converts machine language codes into assembly language mnemonics making it easy for user to understand verify the program OPERATION To use this facility type Z when prompted for command by the Serial Monitor 27 addr1 addr2 CR Address Object Mnemonic The disassembled code is displayed according to the above format NOTE the disassembly of the last instruction requires the reading of data from locations beyond the specified address2 the system will read them to complete the disassembly For example if the specified address2 is 81 FFH and the code at 81 FFH is 20H which is 3 byte instruction the system will read the required data from location 8200H and 8201H to complete the disassembly Example gt Z 0 6 lt CR gt 0000 02 00 30 LIMP 0030H 0003 02 2A LJMP 2ABEH 0006 FF MOVR7 A gt 3 3 13 HELP COMMAND FUNCTION The HELP command is used to list all the commands supported by the Serial Monitor FORMAT H CR OPERATION As soon as and CR 15 entered by the user in response to the command prompt the system lists in alphabetical order all the commands supported by the serial monitor The display appears as shown below OAD 3 JDE ESA 51 USER S MANUAL 3 16 H CR
31. 3 3 12 P3 4 13 P3 5 14 5 5 15 BAO 16 BAI 17 BA2 18 BA2 19 4 20 21 22 4 23 BAS 24 BAS 25 10 26 27 28 CDI 29 CD2 30 CD3 31 CD4 22 CD5 33 CD6 34 CD7 35 CLKO 36 CLKI 37 CLK2 38 GATEO 39 140 GATE2 41 OUTO 42 OUTI 43 OUT2 44 OFFBOARDSEL 45 BRD 46 BWR 47 5 48 5 49 GND 50 GND J2 MCU PORT amp COMMAND Pin No Signals Pin No Signals 1 0 0 2 3 2 4 5 4 6 5 7 0 6 8 PO 7 9 P0 0 10 P1 1 11 1 2 12 1 3 13 1 4 14 1 5 15 1 6 16 1 7 17 P3 0 18 P3 1 19 INT 20 P3 3 21 P3 4 22 P3 5 23 BWR 24 BRD 25 2 0 26 2 1 ESA 51 USER S MANUAL 5 9 ESA 51 USER S MANUAL 27 P22 28 P2 3 29 P2 4 30 31 2 6 32 2 7 33 34 PSEN 35 TIN 36 TOUT 37 38 39 40 41 42 43 44 45 46 47 5V 48 49 GND 50 GND J7 PORTS CONNECTOR PINNO SIGNALS PIN NO SIGNALS 1 2 4 14 2 1 2 2 5 15 2 3 2 2 16 2 7 4 2 17 2 4 5 P2C0 18 P2A5 6 P2C1 19 P2A2 7 P2B6 20 P2A3 8 P2B7 21 P2A0 9 P2B4 22 2 1 10 2 5 23 2 6 11 2 2 24 2 7 12 2 3 25 5V 13 2 26 GND J10 PORTS CONNECTOR PIN NO SIGNALS PIN NO SIGNALS 1 1 4 14 2 1 5 15 3 P1C2 16 P1A7 4 P1C3 17 P1A4
32. 5 8 Connector 5 9 Stand alone mode Monitor Routines Accessible to user 6 1 Serial Monitor Routines Accessible to User 6 2 User Accessible Routines common to both stand alone and serial TOTTI ceo IRL NOU DNI DIE MUNDI 6 2 PARALLEL PRINTER INTERFACE 7 1to 7 4 Int rogue DD 7 1 T stall ati ON EN 7 1 Operation 7 2 Direct Output to Printer e Dass tice 7 2 Connector Details qaid ted UR Fat OU DIN DUC RD dE 7 4 EPROM PROGRAMMER INTERFACE 8 1 to 8 7 FED NT 8 1 InstallattOn Proc oda 8 2 Operation from both Serial and Stand alone Monitor 8 3 P Soc 8 3 Command m 8 5 B Command iran 8 6 R S nr E a cares 8 6 A MN 8 7 COMMUNICATION WITH A HOST COMPUTER SYSTEM 9 1to 9 9 AA EI do o 9 1 Tatal ete ld IE 9 2 Returning to 9 4 9 4 9 4 1 9 4 2 9 4 3 9 4 4 9 4 5 9 4 6 9 4 7 CHAPTER 10 10 1 10 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 10 10 10 11 10 12 10 13 10 14 APPENDIX A APPENDIX B APPENDIX C APPENDIX D APPENDIX E APPENDIX F Operational e ia 9 4 Dow
33. Ctrl F1 Help Alt F1CmdHlp Alt S Commn Esc ClrCmd Alt X Exit F1 F3 9 4 5 COMMAND RECALL This feature facilitates recall of the command already entered by the user upto a maximum of 16 commands Press F3 to recall the previous command the command are kept in a circular buffer User may use Up arrow and Down arrow keys to traverse through the sequence of command is backward or forward direction in circular fashion User may recall just the previous command being entered can be cleared by using Esc key anytime before pressing CR 9 4 6 COMMUNICATION Communication parameters can be set during the session by pressing ALT S List of parameters and their current values will appear on the screen Select the desired parameter with the help of arrow keys and keep the space bar pressed till the desired value appears The parameters allowed to set COMI COM2 Baud 110 150 300 600 1200 2400 4800 9600 7 8 Parity NONE ODD EV EN and Number of stops bits 1 2 After selecting the desired values press CR to communication Rate Number of Data bits set the parameters or press Esc to ignore the values Communication parameters can also be modified while user is in DOS by editing the file XT51 INS This file contains single data line having five integer separated by blanks representing various communication parameter This five integer represent serial communication port baud rate no of data b
34. I Baud 9600 Data bits 8 Stop bits 2 parity none are set If option Yes is selected the communication parameters can be interactively modified as described in section 9 4 6 Now 51 attempts to establish communication between the computer and ESA 51 If successful the command prompt gt appears on the screen Subsequently during the power on or reset of the trainer the sign on message ESA 8051 SERIAL MONITOR V x y appears on the screen followed by command prompt Od QO Fl Previous Command Character F3 Command Recall CTRL U Uploaded Command CTRL D Download Command Command Dos Shell command ALT X Exit Press any key to continue 51 checks for the presence of communication ports amp COM2 If both ports are not available it will display the message NO serial port present as reported by BIOS and exits to DOS Otherwise XT51 will read the communication parameters from file XTS1 INS and initializes the communication port XT51 searches current directory for file XT51 INS If search fails it will search the path given by the DOS environment variable INIT In the file is not present following message is displayed XT51 INS is not found Serial parameters are set to COMI 9600 8 2 None Do you want to change Yes No gt otherwise it will display the message Unable to transmit data Retry or Ignore ESA 51 USER S MANUAL 9 3 If ESA 51 is n
35. I CIS PID address 1 address 2 C Compare a block of memory with destination block C PIDII address 1 address 2 PIDII Address 3 D Disable breakpoint in program memory or data memory D PID E Enable breakpoint in program memory or data memory E PID F Fill a block of memory with a constant or search a string of Data in program memory external data memory and internal data memory PIDII address 1 address 2 data data data data S G Transfer the processor control from the monitor to user Program G address H Help List all the commands supported by the Serial Monitor H J Jump to address J address M Modify Display Move memory contents in program memory External data memory and internal data memory with all combinations M PIDII address 1 address 2 PIDII address 3 N Execute one or more instructions specified by user N count Programmer S Execute one instruction of user program S R address OAD Qo ESA 51 USER S MANUAL 4 3 7 Disassembler Z addr1 addr2 U amp V Commands are reserved for system usage 4 3 1 M MODIFY COMMAND FUNCTION The M Modify Memory command is used to examine the contents of specified memory locations Further if location are in RAM their contents can be altered if desired and block move contents of memory from program data or internal memory to program data or internal memory for all combinations FORMAT M address 1 addr
36. IREMENTS PRODUCT LIST INSTRUCTION SET CONNECTOR DETAILS 1 INTRODUCTION Intel s MCS 51 family of microcontrollers and its derivatives are increasingly becoming popular for instrumentation and control applications due to its speed and powerful instruction set which are essential for real time applications This has created the need for a good trainer and development tools ESA 51 an advanced version of ESA 31 provides complete solution for this requirement It can be used as a flexible instructional aid in academic institutions and a powerful development kit in R amp D Labs ESA 51 has on board DAC ADC optional and parallel printer interface The system firmware provides stand alone mode monitor serial monitor single line assembler disassembler and drivers for EPROM programmer and parallel printer interfaces ESA 51 is supported with comprehensive and user friendly documentation MAIN FEATURES ESA 51 operates on single 5V power supply either in stand alone mode using PC keyboard and LCD or with host PC through its RS 232 C RS 485 interface in serial mode Stand alone and serial monitor programs support the entry of user programs editing and debugging facilities like breakpoints 128K single stepping and full speed execution of user programs OAD 1 1 Uo ESA 51 USER S MANUAL Line assembler amp disassembler Total on board memory is 128K bytes of which 96K bytes RAM has battery back
37. LIZ QO ESA 51 USER MANUAL Electro Systems Associates Pvt Ltd www esaindia com This is the user s manual for ESA 51 microcontroller trainer The manual describes hardware and software components of ESA 51 and gives the interface information necessary for expanding the system This manual describes in detail the facilities offered by the stand alone mode monitor program and the serial monitor program the on line assembler disassembler packages The on board facilities Centronics Parallel Printer Interface DAC interface and optional ADC interface are also described in this manual Communication with the Host Computer is also described Please note that this volume is a user s guide for ESA 51 and such does not deal elaborately with the features of 8031 microcontroller family and related peripherals and their programming Details regarding these can be obtained from the following INTEL Publication Microcontroller Handbook While every effort has been made to present the information in an accurate and simple fashion we do welcome suggestions for improving the quality and usefulness of this manual Please address your correspondence to ELECTRO SYSTEMS ASSOCIATES PVT LTD 4215 J K Complex First Main Road Subramanyanagar P O Box No 2139 BANGALORE 560 021 INDIA Fax 91 80 3325615 Phone 3323029 3322924 email esaindia vsnl com www esaindia com KER ESA 51 User s Manual CONTENTS CHA
38. PTER 1 CHAPTER 2 2 1 2 1 1 2 1 2 2 1 3 2 1 4 2 2 2 2 1 2 2 2 2 2 3 2 2 4 CHAPTER 3 3 1 32 3 3 3 3 1 3 3 2 3 3 3 3 3 4 3 3 5 3 3 6 3 3 7 3 3 8 3 3 9 3 3 9 1 3 3 10 3 3 10 1 3 3 10 2 3 3 10 3 3 3 10 4 3 3 10 5 INTRODUCTION 1 1 to 1 3 CONFIGURATION AND INSTALLATION 2 1 to 2 5 Configuration of ESAS lacio 2 1 Operational Mode 1 t te tne 2 1 Printer Enable Disable ui ti 2 2 Baud Rate Selection ss tii 2 2 M mory Selection P RR d 2 3 Installation of ESA Sl T 2 3 Installation Procedure for Serial Mode of Operation 2 3 No Response in Serial Mode of Operation eee 2 3 Installation Procedure for Stand alone Mode of Operation 2 4 No Response in Stand alone Mode iii 2 5 STAND ALONE MODE MONITOR 3 1to 3 17 eT 3 1 Structure of Monitor Commands mesias cis 3 1 Monitor Command S etnia udin 3 2 M Modity Command iia 3 4 IVE aspen Command as 3 5 M MOVE Memory Command sida 3 6 F memory Comma d o 3 7 C Compare memory etudes 3 8 Examine Modify Register Command es 3 8 J Jump to Address Set change PC Command 3 10 G Command ansiosi eri ret er ee bti tede 3
39. Program to display ELECTRO SYSTEMS ASSOCIATES BANGALORE Execute this program in serial mode only 1200 OUTSTG EQU 1200H ADDRESS OBJECT MNEMONICS COMMENTS 8000 ORG 8000H 8000 90 80 09 MOV DPTR STG Keeping the data in the program memory 8003 12 12 00 LCALL OUTSTG Routine to display string of characters on the console 8006 02 00 00 LJMP 0 8009 20202020 20 STG DB ELECTRO SYSTEMS ASSOCIATES PVT LTD 800E 20 20 45 AC 45 8013 43 54 52 AF 20 8018 53 59 53 54 45 8010 40 53 20 41 53 8022 53 4 43 49 41 8027 54 45 53 20 50 802 56 54 2 20 4 8031 54 44 2E 8034 20 20 20 DB 0dh 0ah BANGALORE O 8039 202020 20 20 803E 202020 20 20 8043 202020 20 20 8048 20 42 41 4E 47 8040 41 4 4 52 45 8052 2 00 HON ESA 51 USER S MANUAL 10 3 QO 10 5 Program to display ASCII character the console Execute this program in serial mode only 11A8 OUTCHR EQU 8 ADDRESS OBJECT MNEMONICS COMMENTS 8000 ORG 8000H 8000 90 90 00 MOV DPTR 9000H Keep the hex equivalent of the ASCII character in 9000H DATA memory 8003 EO MOVX ODPTR 8004 12 11 A8 LCALL OUTCHR 8007 02 00 03 LJMP 3 Keep the hex equivalent of the ASCII character to be displayed in 9000h in data memory 10 6 Program to convert HEX equivalent to ASCII on the trainer display If the code is less than 40 then 30 is subtracted from the code to get its binary equivalent If the code is greater than 40 then the equivalen
40. R CHINR LCALL MOV CLR LCALL MOV MOV LCALL MOV MOVX MOV LCALL LCALL CJNE SJMP CJNE SIMP XRL JZ MOV MOVX DEC SJMP MOV MOVX INC ANL MOV LJMP CHANNEL DIGITAL PUTBYTE NO DPTR DIGITAL FO SELECT PROGRAM MEMORY OUTPUT DISPLAY THE MESSAGE DIGITAL VALUE DPTR 9002H DISPLAY ODPTR THE UPPER 4 BITS 71H A OF THE PUTBYTE CONVERTED DATA DPTR 9001H DISPALY THE A GDPTR LOWER 8 BITS 71H A OF THE PUTBYTE CONVERTED DATA GETCH GET A CHARACTER FROM KEYBOARD A 2CH S1 CHECK WHETHER CHINR IF YES INCREMENT THE CHANNEL NO A 2DH S6 IF NOT CHECK FOR S 15 CHDCR IF YES DECREMENT THE CHANNEL NO 0DH IF IT IS CR S2 YES WAIT FOR THE NEXT KEY TO BE PRESSED 3 ELSE GO TO INTO ROUTINE DPTR 9000H SUBROUTINE DPTR DECREMENT THE ST CHANNEL NO DPTR 9000H SUBROUTINE DPTR TO A INCREMENT THE CHANNEL NO 07 GDPTR A STORE THE CHANNEL NO IN 9000 LOCATION OF DATA MEMORY P2 0E1H CONVERT REPEAT THE PROCESS DB OAH CHANNEL 0 DB DIGITAL VALUE 0 10 14 OAD QO 80 1 80 6 80 80 0 80 2 80 2 80 3 80 4 80 5 80 6 80 7 80 8 80 9 80 80 44 49 47 49 54 41 20 56 41 55 45 20 3D 20 00 00 00 00 00 00 00 00 00 00 00 02 80 1C ESA 51 USER S MANUAL SETLTIME NOP NOP NOP
41. and from the user it outputs a greater than symbol gt as command prompt character at the beginning of a new line The commands entered by the user consist of a single character command mnemonic followed by a list of command parameters This list may consist of upto four parameters depending on the particular command being used When more than one parameter is required a single or space is used between the parameters as a separator A command is terminated by a CR Commands are executed one at a time and only one command is allowed within one command line d54 ESA 51 USER S MANUAL 4 1 numeric parameters to be entered as hexadecimal number The valid range for one byte parameters is 00 to FF and if more than 2 digits are entered only the last two digits are valid leading zeros may be omitted Thus all one byte values are interpreted modulo 256 decimal The valid range for 2 byte parameter is 0000 to FFFF and longer values are evaluated modulo 64K i e only the last four digits are valid the commands except the examine modify register command require only hexadecimal values as parameters The register name abbreviation entries required by the R command are described later while describing the R command in detail RESPONSE TO ERRORS Whenever an error is detected by the monitor either in the command entry or in the command execution the command is aborted and Error
42. ange This circuit can be operated with inputs of 0 to 10V 5V to 5V or 10 to 10 This is determined by the location of shorting plugs at jumpers JP9 and JP8 details are shown below Input Range JP9 JP8 Unipolar 0 to 10V 2 3 1 2 Bipolar 5 to 5V 2 3 2 3 Bipolar 10 to 10V 1 2 2 3 HAD 51 USER S MANUAL 5 7 5 12 ONBOARD 8 D A CONVERTOR ESA 51 features onboard Digital to analog converter using DAC 0800 IC at 032 The user can program the DAC to suit his needs using the interfacing information described here For making use of the DAC the user has to connect 12V and 12 at connector 73 The Analog output may be obtained from terminal point J12 on the trainer Interesting waveforms may be observed at this point by programming the DAC suitably The digital inputs to the DAC are provided through port B of 8155 U29 after initializing it as an output port The Analog output from the DAC is given to an operational amplifier LM741 at U40 which serves the purpose of current to voltage conversion A 10K POT is provided for offset balancing of the op amp The reference voltage needed for the DAC is obtained from an onboard voltage regulator LM723 The voltage obtained at the output of this regulator is about 8 volts The output from the DAC varies between 5V and 5V depending on the input digital pattern fed to the DAC 5 13 BUS EXPANSION ESA 51 permits easy expansion of the system by p
43. at 9000H gt CP8000 8FFF 9000 lt CR gt gt This response showed that there is no mismatch 2 CPA000 AFFF P8000 lt CR gt 00 8BC0 AEDS 48 54 8ED8 This response showed that there is mismatch at two locations 3 3 6 R EXAMINE MODIFY REGISTER COMMAND FUNCTION This command is used to examine and optionally modify the contents of the registers FORMAT R reg new data lt CR gt OAD E PO ESA 51 USER S MANUAL 3 8 OPERATION l If you wish to examine modify the contents of a particular register Enter R when prompted for command followed by the register name abbreviation are shown in Table 3 2 Now the monitor will output the current contents of the specified register The content of this register can be changed now by entering the new data value followed by a valid terminator a CR or lt gt If the command terminator Esc is pressed the command gets terminated If CR is pressed next sequential register is displayed and allows optional modification The sequence in which registers are displayed is shown in Table 3 2 Note that this sequence is in closed loop TABLE 3 2 Register name Abbreviation Register A A Register B B Stack Pointer SP Flags Register PSW Data Pointer High DPH Data Pointer Low DPL Register THO THO Register TLO TLO Register THI Register TL1 Regist
44. ata memory respectively with lt CR gt FORMAT BD PID lt CR gt OPERATION 1 Enter the command BDP BDD and to display the preset breakpoints 2 Enter lt CR gt to view remaining preset breakpoint s or terminate the command with lt Esc gt OAD 1 PO ESA 51 USER S MANUAL 3 13 3 breakpoints found message is displayed if no breakpoints set Example To display the breakpoint in the program memory which has been set in previous command gt CR 000B Esc The above address is displayed to indicate that breakpoint at address 000BH 15 set in the program memory 3 3 10 4 ENABLE BREAKPOINT FUNCTION To enable the breakpoint which has been set using BSP or BSD command FORMAT E PID CR OPERATION Enter the command EP or ED and CR to enable the preset breakpoint s Example To enable the breakpoint in the program memory which has been set in previous command EP gt 3 3 10 5 DISABLE BREAKPOINT FUNCTION To disable the breakpoint which has been set using BSP BSD command FORMAT D PI D CR OPERATION Enter the command DP or DD and CR to disable the preset breakpoint s Example To disable the breakpoint in the data memory DD lt CR gt gt Disable breakpoint does not clear the breakpoints OAD PO ESA 51 USER S MANUAL 3 14 3 3 11 ASSEMBLY COMMAND ESA 5 provides the powerful PROM resident assembler to enhance development work This a
45. ble in serial mode of operation is an on line one and supports the entire standard mnemonics and addressing modes of Intel 8031 8051 microcontroller FUNCTION The assembler generates the actual machine codes and stores them in the memory locations defined by the program Also the system will display the codes generated as well as the source statement Any errors detected are also displayed on the screen OPERATION command implements the assembly facility So to invoke the assembler type A with optional address when prompted for the command by the serial monitor A address CR Assembly language instructions consist of 3 field as shown below Address Object Mnemonic The fields may be separated by any number of blanks and tabs but must be separated by atleast one delimiter Each instruction must be entered on a single line terminated by CR No continuation lines are possible Opcode Field This required field contain mnemonic operation code for the 8051 instruction to be performed Operand Field The operand field identifies the data to be operated on by specified opcode Some instructions require no operands Other require one two or three operands As general rule when 2 operands are required as in data transfer and arithmetic operations the first operand identifies the destination or target of the operations result and the second operand specifies the source data and the two operands must be separated by a comma
46. cution and examine the status of memory or registers at that point These commands are used to set breakpoint clear breakpoint and display breakpoint in both program memory and data memory enables and disables breakpoints in both the memories independently The breakpoints can be one or more and also user can specify range of address for breakpoints OAD 3 PO ESA 51 USER S MANUAL 3 12 3 3 10 1 CLEAR BREAKPOINT FUNCTION To clear the breakpoint s in the data memory or program memory FORMAT BC PIDjaddr1 addr2 OPERATION To clear the breakpoints enter BCP or BCD for corresponding memory and with one address or set of addresses followed by CR Example To clear all the breakpoints in program memory gt 0 FFFF CR After clearing all the breakpoints system waits for the next command entry with command prompt 3 3 10 2 SET BREAKPOINT FUNCTION The set break point command is used to set breakpoints in program memory and data memory FORMAT BS PID addr 1 addr2 OPERATION 1 Seta breakpoint in the program memory data memory using BSP addresses CR 2 If the user wants to set more no of break points then enter BSP addr1 addr2 CR Example To set a breakpoint in the program memory at address 000BH enter the following command gt BSP 000B lt CR gt 3 3 10 3 DISPLAY BREAKPOINT FUNCTION To display the breakpoint which has been set using BSP or BSD Command enter BDP or BDD for program memory or d
47. d to single step a program with disassembly The register content will not be displayed FORMAT gt addr CR HOB ESA51 USER S MANUAL 4 12 OPERATION 1 To use this command enter 5 when prompted for command Rest of the procedure is same as for the SR command Only executed instruction in disassembled format are displayed and register contents are displayed 258800 CR 8802 4 3 9 3 N SINGLE STEP WITH COUNT This command is used to single step a program with count The maximum value of the count is FF Multiple instruction can be executed at a time FORMAT N count CR OPERATION 1 To use this command set the PC value to the starting address of the address of the program using J command 2 Enter N the count and press CR If the program starting address is 9000H and the count is 20 instruction at a time following commands have to be executed gt J9000 CR gt N 14 CR Now 20 instruction will be executed at a time The register contents are displayed just like in SR command Now the user can continue single stepping by pressing CR or the user can exit from the command by pressing Esc 4 3 10 BREAKPOINT COMMANDS BREAKPOINTS The ESA 51 enables you to control program execution by setting break point A breakpoint is an address that stops program execution each time the address is encountered By setting breakpoints at key addresses in your program You can freeze program exec
48. e issuing any command 8 3 1 P COMMAND This command is used to program an EPROM This command requires the following 4 parameters EPROM type EPROM Type should be one of the types listed above in section 8 1 Buffer Start Starting address of the source of data Buffer End Ending address of the source of data EPROM start Absolute starting address of the from where programming is to begin OAD 8 3 JDE ESA 51 USER S MANUAL NOTE Buffer always means data memory area If program to be programmed on to EPROM is in program memory area the user has to transfer it to the data memory area before attempting programming Similarly the user must note that when Read and Verify operations are performed buffer means data memory area As soon as P is typed the system displays each parameter value and prompts for new value User can enter the new value followed by CR or simply enter CR if the displayed value is not to be changed Note that the parameters must satisfy certain conditions as listed below 1 EPROM type can only be one of the valid types listed in section 8 1 2 Buffer end address must be greater than or equal to the Buffer start address 3 The EPROM must have enough space to accommodate all the bytes specified by the Buffer start address and Buffer end address In other words the following relation must be satisfied Start Buffer end address Buffer start address Highest ab
49. e using 27C256 RAM 32K bytes using 62256 DATA MEMORY RAM 64K bytes using 62256 32K X 2 Upper most 8K bytes are reserved for I O addressing and I O expansion PERIPHERALS 8155 Static HMOS 256 bytes RAM with I O ports and timer RAM reserved for monitor 14 bit timer is available for user and port lines are used for DAC and ADC 8255 PPI Three nos Two nos are for user one supplied another for user expansion The remaining one is used for parallel printer and optional LCD 8253 Programmable interval timer Three16 bit programmable timers available for user SCN 2681 Dual channel UART for serial RS 232 C amp RS 485 communication supporting all standard baud from 110 to 19200 8042 Universal Peripheral Interface optional used to interface PC keyboard in stand alone mode ADC 1674 12bit 10 optional 0800 8bit DAC INTERRUPTS External INTO is used for implementing single stepping breakpoints and user s break switch INTI is available to user Internal Internal timer and serial interrupts are available to user OAD 1 3 Uo ESA 51 USER S MANUAL Bus SIGNALS STD Bus compatible bus signals available through a 50 pin ribbon cable connector Single chip mode MCU port lines available through a 50 pin ribbon cable connector Parallel Serial I O Printer Timer Signals Analog Signals 48 TTL compatible lines 2 X 8255 brought out
50. er 5 5 8042 UNIVERSAL PERIPHERALS INTERFACE ESA 51 Trainer is interfaced with a PC keyboard and LCD for operation in stand alone mode Keyboard interface is controlled by an 8042 Universal Peripheral Interface microcomputer The UPI allows the user to develop customized solution for peripheral device control The addressing information for 8042 UPI onboard ESA 51 is given earlier in this chapter The UPI uses clock inputs from the 11 0592 MHz crystal oscillator The keyboard reading is implemented by polling the command status port of 8042 User can read the keyboard in polling mode by checking the status of output buffer register The keyboard sends scan codes for the respective keys pressed The scan codes for the keys can be referred in the PC AT reference manual The UPI is programmed for encoding either 101 or 84 keys PC keyboard 5 6 LCD INTERFACE In the stand alone mode an LCD is used as an output terminal for working with ESA 51 Trainer The display is initialized as follows 20 Digits 4 Lines Left entry display LCD Module comprises two register Instruction and Data register Three control signals RS R W and E determine the operating status of LCD E 1 For any operation with LCD RS 1 Operation with Data register R W 0 Operation with instruction register R W 1 Read from LCD The control and data lines to the LCD are provided by 8255 at U30 These lines are brought to the flow strip at J8 where the LCD is inse
51. er P1 P1 Register P3 P3 Register Counter High PCH Register Counter Low PCL Register RO RO Register R1 Register R2 R2 Register R3 R3 Register R4 R4 Register R5 R5 HAD ESA 51 USER S MANUAL 3 9 NULI Register Register R7 R7 Examples Example 1 Examine and alter register A and then examine register B RA CR 0 24 CR B F0 25 lt gt gt 3 3 7 J JUMP ADDRESS SET CHANGE PC COMMAND FUNCTION The J Command is used to change the program counter value to the desired address before executing a program by either GO command or SINGLE STEP command FORMAT J address CR OPERATION To use this command enter J when prompted for command entry Now enter the desired starting address of the program you wish to execute Enter CR Now command prompt reappears on the next line Examples Example 1 Jump set PC to address 100h J 100 CR gt 3 3 8 GO COMMAND FUNCTION The GO command is used to transfer the control of the system from monitor to the user s program FORMAT G address 1 CR OAD 2 PO ESA 51 USER S MANUAL 3 10 OPERATION To use this command enter G when prompted for command entry followed by CR Execution starts from the PC value Now if you wish to modify the value of the PC i e the address to which the control is to be transferred enter the new value Enter CR Now the user content is restored and control is transferred
52. ess 2 address 3 OPERATION 1 Enter M followed by memory type the address of the memory location to be examined and then enter CR The monitor will now output the contents of that location Note that in serial mode a is always a prompt for data entry while a gt is the prompt for command entry 2 To modify the contents of this location the user can enter the new value now 3 Enter a CR either immediately after the prompt by the system or after the entry of a new value to examine modify the next sequential location A lt Esc gt instead of the CR terminates the command and returns the monitor to the command entry mode ERROR CONDITION 1 Trying to modify the contents of non existent or PROM location Example 1 Examine the PROM locations 11H gt MP11 lt CR gt gt 0011 FF lt Esc gt gt Example 2 Examine a series of RAM location starting at 8820H and modify the contents of the location 8822H gt MD8820 lt CR gt 455 ESA 51 USER S MANUAL 4 4 8820 8821 xx CR 8822 xx 55 CR 8823 xx Esc gt 4 3 2 M DISPLAY MEMORY COMMAND FUNCTION This command is used to display the contents of the program memory external or internal data memory FORMAT M PIDIII address 1 address 2 CR OPERATION 1 To use this command enter M when prompted for command entry After entering M enter the memory type and then starting address of the memory bloc
53. evice Address Usage 8255 1 at U42 Available to user Port A E800H Port B E801H Port C E802H The signal are available on connector J10 Control Port E803H HAD ESA 51 USER S MANUAL 52 8255 A 2 U18 Port A Port B Port C Control Port 8255 3 at U30 Port A Port B Port C Control Port 8253 5 at U8 Timer 0 Timer 1 Timer 2 Control Port DIP Switch 2681 at U13 addressing details are given in section 5 8 8042 at U31 Data Port Command Port 8155 at U29 Internal RAM OAD E804H E805H E806H E807H E900H E901H E902H E903H EA00H EA01H EA02H EA03H E904H ECOIH 000 Ob ESA 51 USER S MANUAL Available to user The signal are available on connector J7 Used for LCD data lines Used for printer Used for LCD control lines amp printer hand shaking signals Configured by system firmware Available to user Timer 0 is available to user on connector J1 Timer 1 is available to user on connector J1 Timer 2 is available to user on connector J1 Used by system for Serial keyboard operation amp printer Used for implementing Serial communication Used for implementing keyboard display interface Reserved for system Reserved for system 5 3 Command Status E100H Port A E101H ADC Data input Port B E102H DAC data output Port C E103H ADC data input Timer Regs E104H Lower amp E105H High
54. few seconds DAD ESA51 USER S MANUAL 2 4 POST Power On Self Test is being done Following initializations are also done All register will be initialized to CPU s reset condition Breakpoints in both program and data memory will be cleared and disabled Then displays the following sign on message followed by the command prompt gt in the next line ESA 51 gt ESA 51 is ready for operation in the stand alone mode 2 2 4 NO RESPONSE IN STAND ALONE MODE If the correct sign on message does not appear in the stand alone mode check the following items a Ifthe LCD is blank check the power supply connections and voltages b the LCD display shows random pattern check the configuration settings once again NOTE DIP switch is read only at power ON Reset If you change the settings either press RESET key or switch OFF and then switch ON the power supply If the problem persists please contact the manufacturer service center ESA 51 USER S MANUAL 2 5 3 STAND ALONE MODE MONITOR 3 1 INTRODUCTION This chapter describes the commands supported by the stand alone mode monitor program The stand alone mode monitor allows ESA 51 to be operated using a PC keyboard and LCD module The system must be configured for stand alone mode of operation as described in section 2 1 1 The commands are described in this chapter When the system enters stand alone mode of opera
55. for this routine are as follows Reg DPTR Starting address of string of characters The string characters will be displayed from program memory area or data memory area depending on the status of flag register bit FO If flag register FO 0 program memory will be selected If flag register bit FO 1 data memory will be selected HAD ESA 51 USER S MANUAL 6 1 03BBH C LRLCD Clear the display The routine blanks the entire display fields 0161H GETKB Reads keyboard This routines wait until a character is entered from the keyboard and upon return it places the character the A register registers are affected 0303H NEXTLINE Moves the LCD cursor to the next line 6 2 SERIAL MONITOR ROUTINES ACCESSIBLE TO USER Calling Mnemonic Function Description Address 2 Gets character from USART input parameters None Output A Character ASCII received from the USART Reg A and flags are affected 11A8H OUTCHR Outputs one character to the USART Input A character ASCII to be output to USART Reg A and flags are affected 1200H OUTSTG Displays a string of characters The string should be terminated by character Zero which is not output Inputs DPTR Starting address of the string of character The string of character will be displayed from program memory or data memory area depending on status of flag register bit FO If flag register bit FO 0 pro
56. gram memory will be selected If flag register bit FO 1 data memory will be selected 6 3 USER ACCESSIBLE ROUTINES COMMON TO BOTH STAND ALONE MODE AND SERIAL MONITOR Calling Mnemonic Function Description Address 0404H OUTPUT Displays a string of characters both in LCD and PC Console The string should be terminated by character Zero which is not output Inputs DPTR Starting address of the string of character The string of character will be displayed from program memory or data memory area depending on status of flag register bit FO If flag register bit FO 0 program memory will be selected If flag register bit FO 1 data memory will be selected 13D2H PUTBYTE Outputs one character to the USART Input 71H character to be output to USART Reg A and flags are affected 03E6H DSPCHR Displays a character on both LCD and PC console Accumulator should contain the character to be displayed ESA 51 USER S MANUAL 6 2 7 PARALLEL PRINTER INTERFACE 7 1 INTRODUCTION ESA 51 trainer support centronics compatible parallel printer interface The interface makes use of BUSY signal for hand shaking and strobe pulses for synchronization Using this facility the user can obtain hard copy on any centronics compatible printer However to get properly formatted listing it is advisable to use 80 132 column printer The on board 8255 U30 is made use of to
57. he address 2 of the source block which is less than the value of the address of the source block 2 Trying to fill the data in non existent or read only memory Examples Examplel Filling the block of program memory with a constant 55H gt FP8800 880F 55 lt CR gt gt Now you can use the M command to examine the block of memory to see that it is filled with the constant 55H OAD Y PO ESA 51 USER S MANUAL 3 7 3 3 5 C COMPARE MEMORY COMMAND FUNCTION Compare command can be used to compare the contents of one memory block with the content of another memory block FORMAT C PIDII address 1 of block 1 address2 of block 1 address 1 of block 2 CR OPERATION 1 To use this command enter C when prompted for command entry and select the type of memory Then enter starting address of the first block a comma ending address of the first block another comma and destination type of memory and coma and then the starting address of the second block followed by the CR 2 The monitor now compares the content of location beginning at addressl of blockl with the content of location beginning at address 1 of block2 This process continues till the contents of address 2 are compared with those of corresponding locations in the 274 block mismatched address locations along with Data will be displayed Examples 1 Compare the contents of memory locations 8000H to 8FFFH with those of a memory block beginning
58. he memory block followed by a CR 2 Now the monitor will output the starting address the contents of the location from this address to the specified end address The monitor routine displays 16 bytes in 3 lines The number of bytes displayed on the first 3 lines are so adjusted that if the fourth line is present its first location has address with the last nibble as zero After the fourth line to go to the next display section press CR Examples Example 1 To display the contents of program memory from location 0000H to 0015H gt MD0000 0015 0000 02 00 03 02 25 FF 02 FF FO FF FF OAD JDE ESA 51 USER S MANUAL 3 5 0010 02 gt 3 3 3 M MOVE MEMORY COMMAND FUNCTION This command is used to move a block of data from one area of the memory to another area FORMAT M PIDII lt address1 gt lt address2 gt destination address CR OPERATION 1 To use this command enter M when prompted for command entry Follow it with the type of memory starting address of the source block to be moved address1 a comma the ending address of the source block address2 another comma and then type of destination memory location starting address of the area into which the source block is to be moved destination address followed by CR 2 This operation moves the contents of memory locations from address 1 to address 2
59. he socket U9 32K bytes of static RAM is provided by a 62256 at the socket UIO as user program memory 32Kbytes of data memory is provided at U11 The fourth socket at 012 is populated with 62256 to provide 24K bytes of Data Memory 2 2 INSTALLATION OF ESA 51 To install ESAS1 the following accessories are required a Power Supply 5V 3A Additionally 12V 250mA 12V 100mA for ADC amp DAC circuitry b For serial mode of operations Host PC with the driver software for host system Refer chapter 9 for details 2 2 1 INSTALLATION PROCEDURES FOR SERIAL MODE OF OPERATION a Select serial mode of operations Ref Section 2 1 1 b Select printer if required Ref Section 2 1 2 Set the desired baud rate Ref Section 2 1 3 d Connect ESA 51 to the host system through RS 232 C RS485 cable Appendix C describes the RS 232 C interface requirements over the connector J4 J5 Refer Appendix A for locating the connectors Turn on the system and execute the driver software Ref Chapter 9 for details e Connect the appropriate power supply ESA 51 USER S MANUAL 2 3 ESA 51 performs POST Power Self Test operation During the POST operation all register will be intialized to CPU s reset condition Breakpoints in both program and data memory will be cleared and disabled Then displays the following Sign On message followed by the command Prompt gt in the next line ESA 8051 Serial monitor V x y
60. implement this interface 7 2 INSTALLATION To install the printer interface a Switch OFF the power supply b Connect one end of the printer cable to J9 25 pin D type connector of ESA 51 Refer the component layout diagram in Appendix A to locate the connector J9 c Connect the other end of connector to the printer OAD Uo ESA 51 USER S MANUAL 7 1 d Configure system for serial mode of operation by setting SW4 of the on board DIP switch to ON position e Enable the printer interface by setting the SW6 of the on board DIP switch to ON position f Switch on power to the printer and ESA 51 NOTE The necessary printer cable could be obtained from Electro Systems Associates P Ltd as an optional accessory However the connector details are given in section 7 5 and the user can make use of these details to make a suitable cable if desired Please note that cable must be short enough to be driven by the on board 8255 We suggest a maximum length of 3 feet for reliable operation 7 3 OPERATION When the printer interface is installed and enabled as described above any character sent to the console is sent to the printer also For example to obtain a hard copy of the contents of a block of memory locations user can issue the M Display Memory command from the serial monitor The contents of the specified memory block are printed exactly as they appear on the screen Note that the M command itself is also pri
61. isplays the command prompt sign ERROR CONDITIONS 1 Specifying a value for the address 2 of the source block which is less than the value of the address1 of the source block 2 Trying to fill the data in non existent or read only memory EXAMPLES Examplel Filling the block of program memory with a constant 55H gt FP8800 880F 55 lt CR gt gt Now you can use the M command to examine the block of memory to see that it is filled with the constant 55H 4 3 5 C COMPARE MEMORY COMMAND FUNCTION Compare command can be used to compare the contents of one memory block with the contest of another memory block FORMAT PIDII address 1 of block 1 address2 of block 1 address 1 of block 2 CR OPERATION 1 To use this command enter C when prompted for command entry and select the type of memory Then enter starting address of the first block a comma ending address of the first block another comma and destination type of memory and coma and then the starting address of the second block followed by a lt CR gt 2 The monitor now compares the content of location beginning at address of block1 with the content of location beginning at address 1 of block2 This process continues till the contents of address 2 are compared with those of corresponding location in 2 block Any differences detected are displayed Examples 1 Compare the contents of memory locations 8000H to 8FFFH with those of a
62. isted devices 8 2 INSTALLATION PROCEDURE a Turn OFF power to ESA 51 trainer b Attach the hardware module EPROM Programmer Interface ESA 51 over connector J7 using 26 core ribbon cable supplied with the module c Connect black yellow and blue wires coming from 4 pin polarized connector on the programmer module to corresponding power supplies as shown below OAD 8 2 Uo ESA 51 USER S MANUAL colour of wire supply to be connected BLACK GND YELLOW 12V BLUE 30 d Power ON the system 8 3 OPERATION FROM BOTH SERIAL AND STAND ALONE MODE MONITORS Enter P when prompted for command entry Then system enters EPROM Programmer menu and displays R Read B Blank check P Program V Verify E Exit Enter Option The monitor provides the following 4 commands to support the EPROM Programmer System P Program command V Verify command B Blank check command R Read command Enter the appropriate command when prompted for command entry by monitor Aborting a command With E it exits from the EPROM Programmer Menu to the monitor prompt Once a specific command is issued further prompts will depend on command itself However if the user enters Esc whenever the system is looking for an entry from the user the current operation 15 aborted and control returns to the warm start of the monitor So in this case the user has to re enter the EPROM Programmer menu by entering P befor
63. its no of stop bits and parity in sequence Table 9 1 shows details of the integer values and corresponding parameters Commn Baud Data Stop Port int1 Rate int2 Bits int Bits int 4 Parity int 5 3 COM 0 110 0 7 0 1 0 Odd 0 COM 2 1 150 1 8 1 2 1 1 300 2 2 HAD ESA 51 USER S MANUAL 9 8 600 3 1200 4 2400 5 4800 6 9600 7 9 47 HELP On line help is available on all ESA 51 monitor commands specific to XT51 Help facility can be selected by CTRL F1 A menu of commands is displayed from which desired commands can be selected by using arrow keys and help information about that command 15 displayed in the remaining part of the screen Context sensitive help is available using ALT Fl This facility can be used if help information is desired about the command being entered against command prompt HAN ESA 51 USER S MANUAL 9 9 1 0 PROGRAMMING EXAMPLES 10 1 Program to display ESA PVT LTD on the LCD Execute the program in stand alone mode only 0348 LCDOUT EQU 0348H 03BB CLRLCD EQU 03BBH ADDRESS OBJECT MNEMONICS COMMENTS 8000 ORG 8000H 8000 12 03 BB LCALL CLRLCD 8003 C2 D5 CLR FO To select program memory 8005 90 80 OE MOV DPTR HSTG 8008 12 03 48 LCALL LCDOUT Output routine to display string of characters 800B 02 80 OB LJMP 800BH 800E 45 53 41 20 50 STG DB ESA PVT LTD 0 8013 56 54 20 4 54 8018 44 2E 00 HAD ESA 51 USER
64. k whose contents are to be displayed then enter a comma enter the end address of the memory block and follow it with a CR 2 Now the monitor will output the starting address the contents of the location from this address to the specified end address The display appears in formatted lines with 16 bytes line The number of bytes displayed on the first line are so adjusted that if the second line is present its first location has address with the last nibble as zero The ASCII equivalent of the displayed data values are also shown on each line The non displayable character are shown as periods Examples Example 1 To display the contents of 5 bytes from location 8000H gt MD8000 8004 0 12 3 4 5 6 7 8 9 A C D E F ASCII 8000 41 42 43 OD 31 ABC 1 gt 4 3 3 M MOVE MEMORY COMMAND FUNCTION This command is used to move a block data from one area of the memory to another area FORMAT M lt address1 gt lt address2 gt PIDII destination address gt CR d54 ESA 51 USER S MANUAL 4 5 OPERATION 1 To use this command enter M when prompted for command entry Follow it with the type of memory starting address of the source block to be moved address1 a comma the ending address of the source block address2 another comma and then type of destination memory starting address of the area into which the source block is to be moved destination address Now enter CR 2 This operatio
65. load file upload and other commands which are explained below NOTE During parameter entry the system expects the alphabetic character to be in uppercase Thus it is convenient to use the keyboard with the CAPS LOCK on 9 4 1 DOWNLOAD OPERATION This feature allows downloading of the contents of an object code file into the memory of ESA 51 HAN ESA 51 USER S MANUAL 9 4 NOTE object code file must be a HEX with records in INTEL 8 bit HEX format Please refer to the relevant INTEL manuals for the definition of INTEL 8 bit HEX format Most of the cross assemblers for 8031 do produce object code files with records in INTEL 8 bit HEX format To perform download operations type CTRL D in response to the command prompt gt The system will now prompt for the name of the disk file from which the information is to be downloaded The prompt is as follows Download filename HEX Enter the file name with extension terminated by CR If the filename is invalid it display a message FILE NOT FOUND and prompts again for the filename If the path specified is invalid it displays the message PATH NOT FOUND and prompt again for the filename If none of the above errors occur the system will prompt for the memory type as follows Memory type PID The user has to enter P or D depending on whether program has to be downloaded to program or data memory Now the system will prompt for the staring addre
66. memory block beginning at 9000H gt CP8000 8FFF 9000 lt CR gt 357 ESA 51 USER S MANUAL 4 7 gt This response showed that there is mismatch 2 CPA000 AFFF P8000 lt CR gt ABCO 00 FF 8BCO AEDS 48 54 8ED8 This response showed that there is mismatch at two locations 4 3 6 R EXAMINE MODIFY REGISTER COMMAND FUNCTION This command is used to examine and optionally modify the contents of the registers FORMAT R reg new data lt CR gt OPERATION l To examine the contents of all the registers enter R followed by CR when prompted for command entry The monitor will now display the content of all registers If you wish to examine modify the contents of a particular register Enter R when prompted for command followed by the register name abbreviation are shown in Table 4 2 Now the monitor will output an equal sign the current contents of the specified register and data prompt 46 66 character The content of this register can be changed now by entering new data value followed by a valid terminator a CR or lt gt If the terminator is Esc the command is terminated If the terminator is not Esc the next sequential register is displayed and opened for optional modification The sequence in which registers are displayed is shown in Table 4 2 Note that this sequence is circular TABLE 4 2 Register name Abbreviation
67. mmand 4 12 Single Step Command with disassembly 4 12 N Single step with count Command siria 4 13 B Break pom Commands srl tii 4 13 Clear Breakpoint a 4 14 Set Break 16101 4 14 Display Breakpoint aiani 4 14 Enable Breakpoint 4 15 Disable Break pois et 4 15 Assembly Command io e ice ER 4 16 Z Disassembler Command orte oce rro opt 4 16 H Help Command E 4 17 HARDWARE 5 1 to 5 11 ICON rpm 5 1 Address Data and Control Signals ias 5 1 Memory ACES Lusso tato qud lucet d oen Can D 5 2 Addressing e dis 5 2 8042 Universal Peripheral Interface ici 5 4 ECD Imer Bs er eee oe ete eet ete a rait 5 4 3 7 5 8 5 9 5 10 5 11 2 12 5 13 5 14 6 6 1 6 2 6 3 7 7 1 7 2 7 3 7 4 7 5 8 8 1 8 2 8 3 8 3 1 8 3 2 8 3 3 8 3 4 8 3 5 9 9 1 92 9 3 Programmable Interval TIMEr ento tia 5 4 Serial ISORA 5 5 Programmable Peripherals Interface Devices 5 6 Programmable Input Output and Timer 5 6 Channel 12 uw bit A D Converter 5 6 On board S bit D A CODVEPBE id iaa 5 8 Bus retire
68. mode of operations is done as follows ESA 51 USER S MANUAL 2 1 SI No Mode of Operation DIP Switch Status Switch 4 Switch 5 1 Serial mode with RS 232 C ON OFF interface 2 Serial mode with RS 485 ON ON interface 3 Stand alone mode OFF x factory installed option don t care Chapters 3 amp 4 describes the commands available in stand alone mode and serial mode respectively 2 1 2 PRINTER ENABLE DISABLE 5 51 firmware includes the driver program for centronics compatible parallel printer interface This driver can be enabled disabled as shown below DIP Switch Position 6 Printer Port OFF Disabled ON Enabled factory installed option Chapter 7 describes the parallel printer interface in detail 2 1 3 BAUD RATE SELECTION In the serial mode of operation ESA51 configures the on board SCN 2681 Dual Channel as follows Asynchronous mode 8 bit character length 2 stop bit parity Baud rate selection for RS 232 C as well as RS 485 can be set using DIP switches 1 to 3 as shown below ESA 51 USER S MANUAL 2 2 53 52 51 Baud Rate ON ON ON 110 ON ON OFF 300 ON OFF ON 600 ON OFF OFF 1200 OFF ON ON 2400 OFF ON OFF 4800 OFF OFF ON 9600 OFF OFF OFF 19 200 factory installed option 2 1 4 MEMORY SELECTION ESA 51 has four 28 Pin sockets for memory System firmware 32K bytes is supplied in a 27256 EPROM at t
69. mory respectively with CR FORMAT CR OPERATION 1 Enter the command BDP or BDD and to display the preset breakpoints 2 Enter CR to view remaining preset breakpoint s or terminate the command with Esc 3 NO breakpoints found message is displayed if no breakpoints are set 357 ESA 51 USER S MANUAL 4 14 To display the breakpoint in program memory which has been set in previous command gt 000B Esc The above address is displayed to indicate that breakpoint at address 000BH 15 set in the program memory 4 3 10 4 ENABLE BREAKPOINT FUNCTION To enable the breakpoint which has been set using BSP or BSD command FORMAT E PID CR OPERATION Enter the command EP or ED and CR to enable the preset breakpoint s Example To enable the breakpoint in the program memory which has been set in previous command EP CR 4 3 10 5 DISABLE BREAKPOINT FUNCTION To disable the breakpoint which has been set using BSP or BSD command FORMAT D PI D CR OPERATION Enter the command DP or DD and CR to disable the preset breakpoint s Example To disable the breakpoint in the data memory DD CR gt Disable breakpoint does not clear the breakpoints d54 ESA 51 USER S MANUAL 4 15 4 3 11 ASSEMBLY COMMAND ESA 51 provides powerful PROM resident assembler to simplify the user s task of program development This assembler availa
70. n moves the contents of memory location from address 1 to address 2 to consecutive memory location starting from destination address 3 The system determines if there is any overlap between source and destination block and accordingly transfer the data beginning either at the address 1 or at the address 2 ERROR CONDITIONS 1 Specifying an end address value which is less than the value of the start address 2 Trying to move data into non existent or read only memory location Examples Example 1 Move the contents of the location 800H through 80FH to the memory block beginning at 8840H gt 800 80 8840 lt gt gt 2 gt MP800 80F P200 lt CR gt Error An attempt to move data into PROM location produces the error message 4 3 4 F FILL MEMORY COMMAND FUNCTION This command is used to fill a block of memory with specified constant FORMAT F PIDII address1 address2 constant CR OPERATION 1 To use this command enter F when prompted for command entry and enter the type of memory to be filled 2 Now enter the starting address of the block of memory to be filled Enter a comma Now enter the ending address of the block Again enter a comma Now enter the constant Press the CR to start the command execution 357 ESA 51 USER S MANUAL 4 6 3 Monitor now fills the block of memory from address to address 2 with the specified constant Then the monitor d
71. nel operation When single channel operation is intended no multiplexer is used and JP15 is OPEN Input is applied to screw terminal TP When the ADC is in multi channel mode the multiplexer ADG508 is populated and eight channels are available as selected by channel select lines connected to ADG508 Analog signals are applied to any desired channel at screw terminals provided at J11 The jumpers JP11 JP12 JP13 JP14 JP15 amp JP24 are closed When the ADC is in multi channel mode no signal is applied at terminal TP The multiplexed signal can however be monitored at terminal TP The channel selection is as shown in the table below 1 5 P1 4 P1 3 2 Channel selected E A2 1 0 0 1 0 0 0 0 1 0 0 1 1 1 0 1 0 2 1 0 1 1 3 1 1 0 0 4 1 1 0 1 5 1 1 1 0 6 1 1 1 1 7 care The interfacing of ADC 8155 is as follows The converted data is latched into the latches 7415374 at 027 and 028 P1 1 of 8031 control of these latches When 1 1 is high the output of the latches are tri stated When 1 1 is low data is available at port bit P1 0 is used to initiate the conversion process in the ADC A high to low transition initiates a conversion and high STS of ADC indicates that ADC is busy At end of conversion the STS line goes on low This transition is used to strobe the converted data into the latches U27 and U28 Input voltage r
72. nload 9 4 Leo sep cere er 9 6 DOS 8 2 9 7 ecc T 9 8 Command Rec D 9 8 Bn e RE T 9 8 log M o 9 9 EXAMPLE PROGRAMS 4 0 10 1 10 15 Program to Display ESA P LTD in trainer 1 1 10 1 Program to perform Multiplication of 2 numbers 10 2 Program to perform division Of 2 numbers 10 2 Program to Display ELECTRO SYSTEMS ASSOCIATES PVT LTD BANGALORE On the Coni M 10 3 Program to convert ASCII to HEX equivalent and to Display 1 0n the CONS sua its 10 4 Program to convert HEX equivalent to ASCII and to Display it n the COn Susanne 10 4 Checking Sth bit in the given byte ee esee eae eee 10 5 Program to display largest number among the number 10 5 Program to display decimal count 0 fo 20 iras 10 6 Program to display 24 hours digital clock in serial mode 10 7 Program to perform addition OF TWO DOS 10 10 Program to perform subtraction of two nos 10 11 Demonstration program for on board DAC 10 11 Demonstration program for on board optional ADC 10 12 APPENDICES COMPONENT PLACEMENT DIAGRAM ASCII CODES RS 232C RS 485 CABLE REQU
73. nted NOTES 1 All control and non printable ASCII characters are printed as ASCII code 2EH 2 If any errors occurs during printing for e g Printer is not in ON LINE paper out error etc the system will be looping indefinitely in the print character routine To recover user may have to press the RESET key 7 4 DIRECT OUTPUT TO PRINTER As already described when the printer interface is enabled any character sent to the console 15 sent to the printer also This facility is available in the serial mode of operation only However user can directly access a routine print character to print a single character This routine can be called from the user s program when the system is operating in either of the two modes stand alone or serial Further this routine prints a character independent of the setting of SW6 Thus this routine can be used to print the desired information when the system is running in the stand alone mode Even in a serial mode of operation this routine can be used to print information which may not be sent to the console The details of this routine are given below OAD Uo ESA 51 USER S MANUAL 7 2 Name of the Routine PRINT Function Print a character Non printable one is printed as Calling address 1235H Input Register A ASCII code of the character to be printed Destroys Registers A B DPTR RO Flags Returns Reg C 1 if error otherwise 0 Exam
74. number among N numbers Execute the program either in Stand alone mode or in serial mode 13D2 ADDRESS OBJECT 8000 8000 90 89 00 LOOP4 8003 EO 8004 FA OAD Uo ESA 51 USER S MANUAL PUTBYTE EQU MNEMONICS ORG 8000H MOV DPTR 8900H MOVX DPTR MOV R2 A 13D2H COMMENTS The total No of data bytes is stored in 8900 data memory Reg R2 is used jas counter 10 5 8005 8008 8009 800 800 800 8000 800 800 8011 8013 8014 8016 8019 801 8010 801 8021 8024 90 89 01 0 1 9 0 99 50 DA 9 12 02 9 02 12 02 OB F8 71 13 00 80 13 80 LOOP2 LOOP3 D2 03 LOOP1 11 D2 00 MOV MOVX DEC MOV INC MOVX MOV SUBB JNC MOV MOV LCALL LJMP MOV MOV LJMP LCALL LJMP DPTR 8901H Data will be put from 8901h onwards A DPTR R2 Decrement counter R1 A DPTR Increment data memory DPTR R3 A A R1 Comparing 2 Nos LOOP1 R2 LOOP2 A R1 71H A PUTBYTE Display the largest no 3 A R3 R1 A LOOP3 PUTBYTE Display the largest no LOOPA 10 9 Program to display decimal count 0 to 20 Execute the program either in stand alone mode or in serial mode 03E6 13D2 03BB ADDRESS 8000 8000 8002 8005 8006 8009 800C 800D 800F OBJECT 7A 90 EO 30 12 EA 12 00 9 03
75. oard RESET key can provide a RESET signal to the CPU The lower address bus is demultiplexed using a 74LS373 at U3 and the upper address bus is demultiplexed using 74LS373 at U22 The data bus is buffered using a 74LS245 at U7 All these buffered signals are available on the system connector J1 Connector details are given at the end of this chapter HAD ESA 51 USER S MANUAL 5 1 5 3 MEMORY ADDRESSING ESA 51 has four 28 pin JEDEC compatible slots U9 U10 U11 U12 accepting memory devices The socket U9 populated with a 27256 as program memory which contains the system firmware The socket at U10 is populated with a 62256 to provide 32K bytes of static RAM of user program memory The sockets at U11 amp U12 are populated with 62256 s to provide 56K bytes of static RAM of user data memory The memory mapping is as follows TABLE 5 1 MEMORY MAP Devices Address range Type of memory 27256 at U9 0000 7FFF Program memory 62256 at U10 8000 FFFF User program memory 62256 at U11 0000 7FFF User Data memory 62256 at U12 8000 DFFF User Data memory Battery Option The 62256 provided at U10 U11 and U12 can be backed up by an optional battery The terminal for connecting the battery are brought out as BT 5 4 ADDRESSING I O decoding is implement using a E561 E562 E563 E564 and E622 Thus fold back exists over the unused address lines The I O devices their addresses and their usage is summarized below TABLE 5 2 I 0 ADDRESS MAP I O D
76. ommand is an extremely useful debugging tool Provision has been made for single stepping with register display disassembly and count 4 3 9 1 SR SINGLE STEP WITH REGISTER DISPLAY COMMAND FUNCTION This command is used to single step a program with register display FORMAT SR addr CR OPERATION 1 To use this command enter SR when prompted for command 2 To execute one instruction at the current value of the program counter press CR when this key is pressed the instruction at the current PC value is executed and then all the register values are displayed 3 To execute one instruction at the desired value of PC enter SR and desired starting address of the program and then press the CR Press CR whenever you want to execute one instruction at a time Each time CR is pressed one instruction is executed To terminate the command press Esc Example 1 Suppose the program given as Example 1 to illustrate the GO command has been entered in the memory Now this program can be single stepped as follows gt 5 8800 CR A SP PSW DPH DPL THO TLO PCL FO 81 DO 83 82 8C 8A 8D 8B 90 BO 00 00 07 01 00 00 00 00 00 00 FF FB 88 02 RO RI R2 R3 R4 R5 R6 R7 PSW 00 01 02 03 04 05 06 07 CAFBBOGP 00 00 00 00 00 00 00 00 00000001 8802 F9 MOV gt 4 3 9 2 S SINGLE STEP COMMAND WITH DISASSEMBLY FUNCTION This command is use
77. ot powered on power it and press to retry to establish the communication The above mentioned message appears on the host side again Pressing I will exit XT51 to DOS Now check for the following a Ensure that ESA 51 is connected to the correct COM and that the COM port is functioning properly b Ensure that ESA 51 is functioning properly and configured correctly Check the RS 232 C RS 485 cable and its connections Since the communication package utilizes the hardware handshake signal RTS while communicating with ESA 51 the interfacing cable must support this signal also NOTE 5 utilizes an interrupt driven routine for reading character from the COM port Thus it is possible for XT51 to miss some character if the system has any resident program which are interrupt driven For example many system include a CLOCK program in the AUTOEXEC file to display the time on the upper right corner of the screen Hence it is desirable not to run any such resident program while XT51 is running If the problem persists please contact the manufacturer 9 3 RETURNS TO DOS User can terminate XT51 and return control to DOS by typing ALT X when the program is waiting for a keyboard input 9 4 OPERATIONAL DETAILS The complete command set of the ESA 51 is transparent and 15 fully supported by XT51 Refer to chapter 4 for serial monitor mode command Press F1 for the help command In addition XT51 supports the file down
78. ple The following program if entered and executed from the stand alone mode prints ABCDEFGHIJKL Address Opcode Mnemonic Comment 8000 90 80 50 MOV DPTR MSG point to msg 8003 E4 L1 8004 93 A A DPTR get the chr 8005 60 OE JZ L2 end of msg 8007 82 PUSH DPH DO save pointer 8009 83 PUSH DPL 800B 12 1235 LCALL PRINT print chr 800E DO 83 POP DPL restore pointer 8010 DO 82 POP DPH 8012 A3 INC DPTR point to next chr 8013 80 EE SJMP LI repeat the process 8015 02 00 03 L2 LJMP 0003 save status and return to monitor 8050 41 42 43 44 DB 41H 42H 43H 44H 8054 45 46 47 48 45H 46H 47H 48H 8058 49 4A 4B 4C 49H 4AH 4BH 4CH 805C OD 00 OAH 00H Uo ESA 51 USER S MANUAL 7 3 7 5 CONNECTOR DETAILS The signal definitions on the 25 pin female D type connector used for parallel printer interface are given below PIN NO SIGNAL DIRECTION PIN NO ON ON J9 DESCRIPTION CENTRONICS CONNECTOR 7 aor 11 BUSY A high indicates that printer cannot receive data The signal becomes high in following cases a During the data entry b During printing operation In the OFF LINE state d During printer error status E E RUN E E p EE e Ee s NEL QN EE g HAD ESA51 USER S MANUAL 7 4 9 SYSTEM 8 1 INTRODUCTION This
79. program using command Note single step execution of program memory disables breakpoint memory 5 Cause of break with the program break address are displayed 6 Enter CR to continue The program starts executing from the point at which break has occurred 7 The above procedure is repeated if program encounters another breakpoint 8 Enter Esc to terminate the process 3 3 9 5 SINGLE STEP COMMAND The ESA 51 trainer enables you to debug a program by single stepping the instructions The command is used to execute a program one instruction at a time With each instruction executed control is returned to the monitor Thus this command is an extremely useful debugging tool Provision has been made for single stepping with disassembly 3 3 9 1 5 SINGLE STEP COMMAND WITH DISASSEMBLY FUNCTION This command is used to single step a program with disassembly The register content will not be displayed FORMAT gt addr CR OPERATION To use this command enter 5 when prompted for command Only executed instruction in disassembled format are displayed and register contents are not displayed 258800 CR 8802 3 3 10 BREAKPOINT COMMANDS BREAKPOINTS The ESA 51 enables you to control program execution by setting break points A breakpoint is an address that stops program execution each time the address is encountered By setting breakpoints at key addresses in your program You can stop program exe
80. programmed for RS 485 communication The interfacing requirements and connector details for either mode of operation have been discussed earlier in the manual The baud rate selection for serial communication is made by DIP switch settings and different standards baud rates can be established Refer the chapter on configuration and installation for the look up table for this selection The following table gives the addressing information with respect to the various control registers of SCN 2681 DUART The user may program the serial controller interfacing using this information to suit his needs SCN 2681 Register Description amp Addressing Address Read Operation RDN 0 Write Operation WRN 0 00 Mode Register MR1A MR2A Mode register MR1A MR2A 01 Status Register SRA Clock select register A CSRA 02 Command register CR Rx holding register RHRA Tx holding register A THRA 4 Input change register IPCR Auxiliary control register ACR 5 Interrupt status register ISR Interrupt Mask register IMR 06 Counter Timer Upper C T upper register CTUR 07 Counter Timer Lower CTL C T Upper lower register CTUL 8 Mode register MR2B Mode register B MR2B 09 Status register Clock select register B CSRB EBOA Reserved Command register B CBR EBOB Rx holding register B RHRB Tx holding register B THRB
81. roviding all the necessary signals on two connectors J1 and J2 The signals are STD bus compatible and thus user can easily expand the capabilities of ESA 51 5 14 CONNECTOR DETAILS The connector details for interfacing peripherals is described in this section A brief summary of the connectors available on the trainers is described below Refer the component layout diagram in Appendix G to locate these connectors The signal definition of these connectors are available in Appendix G Jl amp J2 50 pin Bus connectors connected to system bus J3 4 terminal power connector 14 5 9 pin D type female connector for RS 232 C compatible serial communication J5 9 pin D type male connector for RS 485 compatible serial communication J6 Keyboard DIN connector J7 26 pin FRC Rt Male connector for 8255 port lines J8 Flow strip for LCD interface J9 25 pin D type female for printer interface J10 i 26 pin FRC Rt Male connector for 8255 port lines J11 Terminal strip for ADC Analog input 712 Terminal point for DAC Analog O P J13 Terminal point for Analog GND for ADC circuitry HAD ESA 51 USER S MANUAL 5 8 AD DO ADDRESS amp DATA Pin No Signals Pin No Signals 1 P1 0 2 P1 1 3 1 2 4 1 3 5 1 4 6 1 5 7 1 6 8 1 7 9 P3 0 10 P3 1 11 P
82. rted 5 7 PROGRAMMABLE INTERVAL TIMER ESA 51 has on board programmable interval timer 8253 5 at socket position 08 Its I O address can be found in Table 5 2 in section 5 4 8253 has command status port and three data ports called TimerO Timerl and Timer2 to provide three programmable timers AII the timers are available for user The signal related to timer 0 1 and 2 are available on system connector 71 Connector details are provided in the last section of this chapter HAD ESA 51 USER S MANUAL 54 5 8 SERIAL INTERFACE Serial communication in ESA 51 trainer is implemented using SCN 2681 Dual Universal Asynchronous Receiver Transmitter DUART The trainer is capable of communicating with serial terminal using either RS 232 C standards or RS 485 standards SCN 2681 DUART provides two independent full duplex synchronous receiver transmitter in a single package It interfaces directly with microprocessors and may be used in a polled or interrupt driven system operating mode and data format of each channel can be programmed independently each receiver transmitter select its operating speed as one of eighteen fixed baud rates a l6 X clock derived from a programmable counter timer or an external 1 X or 16 X clock ESA 51 provides a 3 6864 MHz crystal as a clock input to the DUART for its operation channel A of the DUART is programmed for serial communication using RS 232 C standards while channel B is
83. solute address of the EPROM For example suppose EPROM type is 2764 Then its highest absolute address is IFFFH Suppose the other parameters are as follows Buffer Start 8000 Buffer End OFFF EPROM Start 100 Then 100 8000 20FF gt 1FFF So this combination of parameters is invalid After user enters parameter values the above mentioned constraints are checked and if any of the constraint is violated it displays the message invalid parameter s entered and returns to the sub menu However if the EPROM type entered is invalid it immediately flashes a message invalid EPROM type and reprompts user to enter valid EPROM type After optional modification of the parameter values by the user the system checks the EPROM for blank values in the required zone It displays the message Blank check in progress If the EPROM is not blank the following prompt appears EPROM is not blank 2 XXXX YY Continue programming Y N OAD 8 4 Uo ESA 51 USER S MANUAL If user types the command is aborted and control returns to command prompt of the monitor If the user enters Y the system proceeds further Any other character results in error message and repetition of the same prompt Now the following message appears Programming in progress The system proceeds with programming and verification on a byte by byte basis Intelligent Programming Algorithm is used if the EPROM support i
84. ss of the program as follow Start Address Enter the starting address followed by CR A maximum of four hex digits are allowed for the starting address Now the system will prompt for the ending address as follows End Address Enter the ending address followed by CR A maximum of four hex digits are allowed for the ending address Now the system will prompt for the load offset value as follows Load offset Address If the user wishes to download the file to an address range different from the actual address range of the file then a suitable offset value can be entered 10 enable the file to be downloaded to the desired address range For example if the user wishes to download it to an address range starting at COOOH the user has to enter an offset value of COOOH 8000 4000 In case the user wishes to download to the same address range an offset value of 0000 has to be entered or simply press CR After obtaining the filename starting address and the ending address the system HAN ESA 51 USER S MANUAL 9 5 will read file gather data in specified address range reformat the data for compatibility with the protocol required by ESA 51 and send the data to ESA 51 Downloading in progress XXX After downloading is over the system returns to the command prompt of ESA 51 It also displays the starting address of each record being download 9 4 2 UPLOAD OPERATION This feature allow uploading of the data from
85. ssembler is an on line one and supports the entire standard mnemonics and addressing modes of Intel 8031 8051 microcontrollers FUNCTION The assembler generates the actual machine codes and stores them in the memory locations defined by the program Also the system will display the codes generated as well as the source statement Any errors detected are also displayed on the screen OPERATION command invokes the assembler A with optional address when prompted for the command A address CR Assembly language instructions consist of 3 field as shown below Address Object Mnemonic The fields may be separated by any number of blanks and tabs but must be separated by atleast one delimiter Each instruction must be entered on a single line terminated by CR No continuation lines are possible Opcode Field This required field contain mnemonic operation code for the 8051 instruction to be performed Operand Field The operand field identifies the data to be operated on by specified Opcode Some instructions require no operands Other require one two or three operands As general rule when 2 operands are required as in data transfer and arithmetic operations the first operand identifies the destination or target of the operations result and the second operand specifies the source data and the two operands must be separated by a comma Examples gt A8000 CR 8000 E9 MOV A RI CR 8001 74 42 MOV A 42H CR 800
86. t This results in considerable reduction in programming time required for some Devices If the complete programming is successful the system will display a 16 bit checksum and control will return to the sub menu If the programming is unsuccessful the following information is displayed Programming failed 9 XXXX YY When XXXX is the EPROM address where programming failed and YY is the Data at that location on EPROM NOTE During programming and verification the location in EPROM and the corresponding data that is being programmed are displayed in the display field continuously After programming the specified range the system display 16 bit checksum and returns to sub menu Checksum NNNN 8 3 2 V COMMAND This command is used to verify the contents of an EPROM against a source The parameter and their interpretation is completely similar to that of the P command If the verification is successful the 16 bit checksum is displayed and the control returns to EPROM programmer sub menu It the verification fails a message and parameter at the point of failure are displayed as shown below Verification fails AAAA BB CC DDDD Where AAAA 15 the EPROM address where verification has failed BB 15 the data at that location Similarly it also displays the corresponding buffer address DDDD and the data CC at that location If there are multiple locations where verification has failed it will list out them in the same format as above The con
87. t no lies between A amp F The program can be executed both in stand alone and serial mode 13D2 PUTBYTE EQU 13D2H ADDRESS OBJECT MNEMONICS COMMENTS 8000 ORG 8000H 8000 90 90 00 LOOP1 MOV DPTR 9000H Keep the HEX eq in 9000h data memory 8003 EO MOVX DPTR 8004 F9 MOV R1 A 8005 C3 CLR C 8006 94 0A SUBB 0AH 8008 40 OB JC LOOP2 Check for carry 800A 9 A R1 800B 24 37 ADD 37 8000 5 71 7 800F 12 13 D2 LCALL PUTBYTE 8012 02 80 00 LJMP 3 8015 E9 LOOP2 MOV A R1 8016 CLR C OAD Uo ESA 51 USER S MANUAL 10 4 8017 24 30 8019 02 80 OD 10 7 In the given byte checking the 5th bit is ADD LJMP 30 LOOP3 Add ACC content with 30 11 or 0 the 5th bit is 1 00 should be stored in 8901 data memory or if it is 0 FF should be stored in 8901h data memory ADDRESS OBJECT 8000 8000 90 89 00 8003 EO 8004 A3 8005 u 8006 33 8007 33 8008 40 06 800A 74 FF 800C FO 800D 02 00 00 8010 74 00 LOOP 8012 FO 8013 02 00 00 5 ORG 8000H MOV MOVX INC RLC RLC RLC JC MOV MOVX LJMP MOV MOVX LJMP 8900 DPTR A A A LOOP A 0FFH DPTR A 3 A 00H DPTR A 3 COMMENTS Store the given byte in 8900h data memory Rotate left three times Check for carry Move FFh into ACC Move 00h into ACC 10 8 Program to display largest
88. tes MIN RPT4 E6 D2 ESA 51 USER S MANUAL MOV MOV LCALL MOV LCALL MOV DSPCHR R3 LOOP2 A 01H R7 A 71H A PUTBYTE R3 07H A 08H DSPCHR R3 LOOP3 5 A R5 A 01H A R5 A R5 24H HRS Check for 24 hrs over or not R3 04H A 08H DSPCHR R3 LOOP4 A 00H 71H A PUTBYTE R5 00H R7 00H CURSOR LOOP R2 05H R4 0FFH R3 0FFH R3 R3 00H BACK1 R4 R4 00H BACK2 R2 R2 00H BACK3 Delay routine R3 04H A 08H DSPCHR R3 RPT4 A R7 7 20 10 9 8086 12 03 E6 LCALL DSPCHR 80B9 74 20 MOV 20 80BB 12 03 E6 LCALL DSPCHR 80BE 02 80 2E LJMP BEGIN Subroutine to move the cursor three times back 80 1 7B 03 CURSOR MOV R3 03H 80C3 74 08 RPT5 MOV A 08H 80C5 12 03 E6 LCALL DSPCHR 80 8 9 DJNZ R3 RPT5 80CA 22 RET Subroutine to display hours 80CB ED HRS MOV A R5 80CC F5 71 MOV 71H A 80CE 12 13 D2 LCALL PUTBYTE 8001 74 20 MOV 20 8003 12 03 E6 LCALL DSPCHR 80D6 74 20 MOV 20 8008 12 03 E6 LCALL DSPCHR 80DB 74 00 MOV A 00H 80DD F5 71 MOV 71H A 80DF 12 13 D2 LCALL PUTBYTE 80 2 7F 00 R7 00H 8064 7 00 MOV R6 00H 80 6 74 20 20 80 8 12 03 6 LCALL DSPCHR 80EB 74 20 MOV 20 80ED 12 03 E6 LCALL DSPCHR 80 0 02 80 2 LJMP BEGIN Subroutine to display HRS MIN SEC on the console STG DB HRS MIN SEC OAH 0 80F3 48 52 53 20 4D
89. the memory of ESA 51 to the computer system and save the data in the specified disk file in INTEL 8 bit HEX format To perform upload operations type Ctrl U in response to the command prompt gt The system will now prompt for the name of the disk file into which information is to be uploaded The prompt is as follows UPLOAD FILENAME HEX Enter the file name with extension terminated by CR If the file already exists then the system will display File already exists Overwrite Yes No Select the first option by pressing Y to overwrite the contents of the existing file Pressing N will let the user specify another file name Select the third option A to append to the contents of the existing file If no error occurs the system will prompt for the starting address of the program as follow Memory Type The user has to enter P or D depending on whether program has to be uploaded from program or data memory Now the system will prompt for the starting address of the program as follows Start Address Enter the starting address terminated by CR A maximum of four hex digits are allowed for the starting address HAN ESA51 USER S MANUAL 9 6 Now system will prompt for ending address as follows End Address Enter the ending address terminated by CR A maximum of four hex digits are allowed for the ending address file After obtaining the filename starting address and the ending address
90. the monitor either in the command entry or in the command execution the command is aborted Error is displayed on the next line along with a sign attached pointing to the place where the error occurred followed by command prompt The possible error conditions are described while illustrating the individual commands Command execution occurs only after a valid delimiter a CR is entered Hence a command entry can be cancelled anytime before the delimiter is entered by pressing Esc The command gets terminated followed by a command prompt 3 3 MONITOR COMMANDS Each command described in this chapter consists of one to two characters followed by appropriate parameters and data The commands are summarized in Table 3 1 and are described in detail in the section which follows In the table as well as in the subsequent description the following notations are used NOTATIONAL CONVENTIONS SYMBOL NAME USAGE 8 Curly braces with Encloses a required argument 1 or more Ellipsis Times HAD ESA 51 USER S MANUAL 3 2 NULI Square brackets Encloses an item that appears or 1 time Square brackets Encloses an item that appears 0 or more times Vertical bar Separates alternative items in a list Italics Indicates a descriptive item that should be Replaced with an actual item TABLE 3 1 SUMMARY OF STAND ALONE MODE MONITOR COMMANDS
91. the program from 8000H To change the min hours change the data in location 8009H amp 0404 13D2 03E6 ADDRESS OBJECT 8000 8000 90 80 OAD PO ESA 51 USER S MANUAL OUTPUT EQU PUTBYTE EQU DSPCHR EQU MNEMONICS ORG 8000 MOV 8007H respectively 0404H 13D2H 03E6H COMMENTS DPTR STG Keep data from 10 7 8003 8006 8008 800 800 800D 800F 8012 8014 8017 8019 801C 801D 801F 8022 8024 8027 8029 802C 802E 8030 8032 8033 8035 8038 803A 803C 8041 8044 8045 8047 8048 8049 804 8040 804 8050 8051 8054 8056 12 70 7 CO 12 74 12 74 12 EF 12 74 12 74 12 DO CO 79 9 12 7 74 12 DB 12 9 24 9 B9 EF 24 7 74 04 23 59 71 05 13 20 03 20 03 71 13 20 03 20 03 05 05 50 71 13 02 08 03 9 80 01 60 01 60 07 08 04 START LOOP D2 D2 SEC D2 LOOP1 E6 92 E6 51 LOOP2 OAD PO ESA 51 USER S MANUAL LCALL MOV MOV MOV MOV PUSH LCALL MOV LCALL MOV LCALL MOV MOV LCALL MOV LCALL MOV LCALL POP PUSH MOV MOV MOV LCALL MOV MOV LCALL DINZ LCALL MOV ADD DA MOV CJNE MOV ADD DA MOV CJNE MOV MOV program memory OUTPUT Display routine R5 23H Store hrs in R5 R7 58H Store minutes R7 reg A R5
92. through two 26 pin ribbon cable connectors RS 232 C through on board 9 Pin D type female connector RS 485 through on board 9 Pin D type male connector PC compatible parallel printer interface available on a 25 pin D type female connector Two 8253 and one 8155 timer signals are available at the 50 pin ribbon cable connectors 8 analog inputs for ADC are fed through terminal blocks DAC output 15 available through a test point POWER SUPPLY REQUIREMENT 5V 1600mA max 12V 250mA max for ADC and DAC Ugh ESA 51 USER S MANUAL 2 CONFIGURATION AND INSTALLATION 2 4 CONFIGURATION OF ESA 51 ESA 51 Microcontroller Trainer is versatile and can be configured in three different modes which are determined by DIP switch settings refer to the component layout diagram in appendix A to locate the DIP switch This chapter describes all the configurable options and the installation procedures 2 1 1 OPERATIONAL MODE SELECTION ESA 51 can be operated either in the stand alone mode using PC keyboard and LCD the serial mode through RS 232 C RS 485 interface In the serial mode the trainer is connected to a CRT terminal or to a host computer system PC through an RS 232 C RS 485 interface In either mode of operation the system provides a variety of commands for program development debugging several features like on line assembler disassembler etc The selection of the desired
93. tion the sign on message 5 51 is displayed followed by prompt gt on the next line indicating that the monitor is ready to accept commands from the user 32 STRUCTURE OF MONITOR COMMANDS Whenever the monitor is ready to accept a command from the user it outputs a greater than symbol gt as command prompt character at the beginning of a new line The commands entered by the user consist of a single character command mnemonic followed by a list of command parameters This list can have four parameters depending on the command being used OAD 3 PO ESA 51 USER S MANUAL 2 1 When more than one parameter is required a single C space is used between parameters as seperator A command is terminated by a CR Commands are executed one at a time and one command in one command line PARAMETER ENTRY numeric parameters are to be entered as hexadecimal number The valid range for one byte parameters is 00 to FF and if more than 2 digits are entered only the last two digits are valid leading zeros may be omitted Thus all one byte values are interpreted modulo 256 decimal The valid range for 2 byte parameter is 0000 to FFFF and longer values are evaluated modulo 64k i e only the last four digits are valid The register name abbreviation entries required by the commands are described later while describing the R command in detail RESPONSE TO ERRORS Whenever an error is detected by
94. to the program starting at the current value of the user program counter A powerful debugging tool breakpointing a program is available to the user To use this facility set one or more breakpoints in program or data memory using B command Now the control is transferred to the program starting at the current PC value Upon reaching any one of the specified breakpoint addresses control is returned to the monitor Monitor saves the present register contents and PC value displays the current PC value and then issues a command prompt Notes 1 When any one of the breakpoints is reached control is returned to the monitor after saving the registers 2 Specifying more than one breakpoint address is useful when debugging a program section containing branch instructions Examples Examplel Suppose the following program has been entered in the program memory ADDRESS OBJECT COMMENTS 8800 74 MOV 42 8801 42 8802 F9 MOV R1 A 8803 80 SIMP 8800H 8804 FB gt G8800 lt CR gt The program can be executed by setting up breakpoints The procedure is as follows 1 Set a breakpoint in the program memory or data memory using BSP address lt CR gt or BSD address lt CR gt 2 If the desired breakpoints in a range then enter BSP addr2 CR or BSD addr1 addr2 lt CR gt 3 Enable breakpoints using EP command or ED command for program or data memory respectively OAD E PO ESA 51 USER S MANUAL 3 11 4 Execute the
95. trol returns to the EPROM programmer sub menu The user can abort to main menu by pressing Esc OAD 8 5 Uo ESA 51 USER S MANUAL Thus the operation of this command is quite similar to operation of P command except that here the EPROM is just verified not programmed 8 3 3 B COMMAND This command is used to check if a specified range in the EPROM is blank contains OFFH This command requires the following three parameters Type same as for P command EPROM Start The absolute starting address of the EPROM EPROM End The absolute ending address of the EPROM The parameter must satisfy the following relations i EPROM start Absolute last address of the EPROM EPROM End lt Absolute last address of the EPROM and EPROM End gt EPROM Start The parameter display and modification procedures are menu driven and are similar to those of the P command The EPROM is checked for blank values in the specified range The EPROM address and data read are displayed in the display field If it is blank then the following message is displayed EPROM is blank Then the control returns to the sub menu If a location in the specified range is not blank the following message is displayed EPROM is not blank O YY Where XXXX is the absolute EPROM address of the first non blank location and YY is its contents Then it display the address and data of subsequent non blank locations form next line
96. up provision On board parallel printer port On board 8 bit DAC using 0800 Optional on board 12 bit ADC using AD1674 48 I O lines and four programmable interval timers 13 port lines of 8031 brought out to the connector including INT1 RXD amp TXD pins 6 lines are shared for optional ADC Buffered bus signals are available through ribbon cable connector for easy system expansion Driver software for file upload download to from host PC ACCESSORIES OPTIONAL E Power Supply 5 12V 250mA 12V 100mA and 30 100mA E PC keyboard and 20 X 4 LCD module for stand alone mode of operation te e EPROM programmer interface eo Interface Modules for training purpose Keyboard Elevator Display ADC with DAC Dual DAC 8 bit 16 Channel ADC 12 bit 8 Channel ADC Logic Controller Traffic Lights Tone Generator Stepper Motor Opto Isolated Input Opto Isolated Output Relay Output etc 12 bit ADC AD1674 with 8 channel MUX eo eo 3 6V Ni Cd battery for power backup to RAM eo Parallel printer cable eo RS 485 interfacing cable 26 core ribbon cable connector set 50 core ribbon cable for bus expansion OAD 1 2 Uo ESA 51 USER S MANUAL CENTRAL PROCESSOR 8031 MCU 11 0592 MHz MEMORY Four 28 pin JEDEC sockets provide following PROGRAM MEMORY ROM 32K bytes of system firmwar
97. ution and examine the status of memory or registers at that point These commands are used to set breakpoint clear breakpoint and display breakpoint program memory a well as data memory and to enable and disable breakpoints in both the memories independently The breakpoints can be one or more and also user can specify range of address for breakpoints 357 ESA 51 USER S MANUAL 4 13 4 3 10 1 CLEAR BREAKPOINT FUNCTION To clear the breakpoint s in the data memory or program memory FORMAT 2 2 To clear breakpoints enter for corresponding memory and with one address or range of address and CR Example To clear the breakpoint of full program memory enter gt 0 FFFF CR After clearing procedure is finished a command prompt is displayed 4 3 10 2 SET BREAKPOINT FUNCTION The set break command is used to set breakpoints in program memory and data memory FORMAT BS PID addr 1 addr2 OPERATION 1 Seta breakpoint in the program memory data memory using BSP addresses CR 2 Ifthe desired breakpoint is a range then enter BSP addrl addr2 CR Example To set a breakpoint in the program memory at address 000BH enter the following command gt BSP 000B CR 4 3 10 3 DISPLAY BREAKPOINT FUNCTION To display the breakpoint which has been set using BSP or BSD Command enter BDP or BDD for program memory or data me
Download Pdf Manuals
Related Search
Related Contents
INSTALLATION MANUAL 2013年冬号 - リンクコンサルティング 参考資料2 第24回議事録(PDF形式:92KB) Untitled - 滋賀県工業技術総合センター COMMUNICATION PROTOCOLS PAGE POSITION: 1 JOB: @zeta.tweddle.com Manual da lavadora de pisos automática - LST51 Copyright © All rights reserved.
Failed to retrieve file