Home

ESA 31 USER MANUAL - Electro Systems Associates

image

Contents

1. 000 AFFE P8000 CR ABCO 00 FF 8BCO AED8 48 54 8ED8 This response showed that there is mismatch at two locations 4 3 6 R EXAMINE MODIFY REGISTERS COMMAND FUNCTION This command is used to examine and optionally modify the contents of the registers FORMAT R reg new data CR OO AD ESA 31 51 User s Manual OPERATION 1 To examine contents of all registers enter R followed by carriage return when prompted for command entry The monitor will now display the contents of all the registers If you wish to examine modify the contents of a particular register then enter R when prompted for command followed by the register name abbreviation The register name abbreviations are shown in Table 4 2 Now the monitor will output an equal sign the current contents of the specified register and data prompt character The contents of this register can be changed now by entering the new data value followed by a valid terminator a Carriage Return or escape If the terminator is the escape the command is terminated If the terminator is not the escape the next sequential register is displayed and opened for optional modification The sequence in which registers are displayed is also shown in Table 4 2 Note that this sequence is circular TABLE 4 2 Register name Abbreviation Register A Register B Stack Pointer Flags Register Data Pointer High Dat
2. 90 90 02 00 04 01 00 02 03 00 LABLE MNEMONIC START LI AD ESA 31 51 User s Manual SYMBOLS ORG 8000H MOV DPTR 9001H A DPTR MOV OFOH A MOV DPTR 9000H A DPTR SUBB MOV 9002 DPTR A MOV OAOH 0E1H MOV RO 02 JB 1 LJMP 0 LJMP 04FDH END COMMENTS KEEP DATA IN 9000 AND 9001 LOCATIONS OF DATA MEMORY SUBSTRACT THEM STORE THE RESULT IN 9002 LOCATION OF DATA MEMORY READ DIP SWITCH JUMP TO SER MONITOR ELSE TO K B PROMPT 11 15 APPENDIX COMPONENT PLACEMENT DIAGRAM APPENDIX ASCII CODES APPENDIX 1 Hexadecimal Decimal Character Hexadecimal Decimal Character 00 0 NUL 20 32 SP 01 1 SOH 21 33 02 2 STX 22 34 03 3 ETX 23 35 04 4 EOT 24 36 05 5 ENQ 25 37 06 6 ACK 26 38 amp 07 7 BEL 27 39 08 8 5 28 40 09 9 HT 29 41 10 2 42 OB 11 VT 2B 43 t 0C 12 FF 2C 44 0 13 20 45 14 50 2 46 OF 15 SI 2F 47 10 16 DLE 30 48 0 11 17 DCI 3l 49 1 12 18 DC2 32 50 2 13 19 DC3 33 51 3 14 20 4 34 52 4 15 21 35 53 5 16 22 36 54 6 17 23 37 55 7 18 24 CAN 38 56 8 19 25 EM 39 57 9 1 26 SUB 3A 58 1B 27 ESC 3B 59 1C 28 FS 3C 60 lt 1D 29 GS 3D 61 1E 30 RS 3E 62 gt 31 US 3F 63 2 OO AD ESA 31 51 User s Manual APPENDIX 2
3. 60 MNT 9 1 Installation Procedure uz uyu ean E 9 2 Operation from Serial Monitor 9 2 P Command ua 62 E 9 3 L u 9 5 P Command zz uuu Sha 9 5 R Command c 9 6 Operation from Keyboard Monitor 9 7 PROG Command siseses 9 8 VREY Command 9 8 BENK Command Ju a Q 9 9 9 4 4 PRRD CODO cesso mnn poids Ud d da mE IM o tad 9 0 9 5 9 10 CHAPTER 10 COMMUNICATION WITH HOST COMPUTER SYSTEM 10 1 to 10 8 10 1 Pr 10 1 10 2 Installation 10 1 10 3 to a akal asada 10 4 10 4 Operational details c E eE aina 10 4 10 4 1 Download Operate u aa do ua eeu pa aS etate 10 4 10 4 2 Upload 10 5 10 4 3 DOS Command u aka qana aspius 10 7 10 4 4 Botftomi LiNE ed oh seed ee ded S 10 7 10 4 5 Command Recall sau M 10 7 10 4 6 10 7 10 4 7 Help 10 8 CHAPTER 11 ASSEMBLER 11 1 to 11 15 11 1 Program to Display ESA P LTD in trainer Display 11 1 11
4. i ESA 31 51 User s Manual 5 HARDWARE 51 INTRODUCTION This chapter describes the hardware design details of ESA31 Appendix C 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 c Keyboard Display Interface d Programmable Interval Timer and Serial Interface e Programmable Peripheral Interface Devices f Bus Expansion g Connector Details 5 2 CPU ADDRESS DATA AND CONTROL SIGNALS ESA31 Uses 8031 8051 Microcontroller operated with a 11 0592MHz crystal The on board RESET key can provide a RESET signal to the CPU The lower address bus is demultiplexed using 74 LS 373 at U4 and the upper address bus is buffered using 74 LS 373 at U18 The data bus is buffered using a 74 LS 245 at U7 5 3 MEMORY ADDRESSING ESA31 has four 28 pin JEDEC compatible slots U8 U9 U10 and U11 for accepting memory devices The AD i ESA 31 51 User s Manual socket at 08 is populated with a 27256 as program memory which contains system firmware The socket at U9 is populated with a 62256 to provide 32K bytes of static RAM of user program memory The socket at U10 amp U11 is populated with a 62256 to provide 56K bytes of static RAM of user data memory The memory map is as follows TABLE 5 1 Memory Map Device Address range Type of memory 272
5. DPTR 8004 2 Reg R2 is used as counter 8005 90 89 01 MOV DPTR 8901 Data will be put from 8008 0 MOVX A QDPTR 8901 onwards 8009 1 DEC R2 Decrement counter 800A F9 MOV RIA 800B A3 INC DPTR Increment data memory 800C EO MOVX A DPTR 800D FB MOV R3 A 800E 99 SUBB Comparing 2 numbers 800F 50 14 JNC 8025 8011 DA F8 DJNZ R2 800B 8013 75 MOV Check for DIP switch 8016 78 02 MOV R0 4402 8018 E2 MOVX A RO 8019 20 E3 OE JB 0E3 802A 801C E9 MOV 801D F5 71 MOV 71H A Display the largest number on console 801F 12 18 SE 8022 02 00 03 LJMP 03 8025 EB MOV A R3 8026 F9 MOV RIA 8027 02 80 11 LJMP 8011 802A E9 MOV 802B 78 60 MOV 60 Display the largest number on 802D F6 MOV trainer display 802E 12 01 9B LCALL UPDDT ESA 31 51 User s Manual 11 6 8031 02 80 00 LJMP 8000 11 9 Program to display decimal count 0 to 20 Execute the program either in KEYBOARD mode or in SERIAL mode SOUTPT EQU 160EH PUTBYTE EQU 185 UPDDT EQU 019BH ORG 8000H ADDRESS OBJECT MNENOMIC COMMENTS 8000 75 OAOH Z0EIH Check for DIP switch 8003 78 02 MOV _ RO 02H 8005 E2 MOVX 8006 20 22 JB 0E3 KBD 8009 7A 00 MOV R2 00H Store count 00 in R2 800B EA RPT MOV A R2 800C F5 71 MOV 71 800E 12 18 SE LCALL PUTBYTE Routine to display on console 8011 7B 03 MOV _ R3 03H 8013 74 08 LOOP
6. PIN NO SIGNALS 1 1 1 3 1 5 1 7 P3 1 P3 4 NC BAI BA3 5 9 CDI CD3 CD5 CD7 CLKI GATE 0 GATE 2 OUT 1 OFFBOARDSEL BWR 45V GND J7 RS 232 C CONNECTOR PIN NO SIGNALS 1 2 3 4 5 6 7 8 9 Note If your terminal does not support hand shaking signals loop RTS amp CTS and DSR amp Also remember ESA31 TXD should be connected to terminal RXD and so on AD ESA 31 51 User s Manual 6 MONITOR ROUTINES ACCESSIBLE TO USER ESA31 Monitor offers several user callable routines both in the keyboard and serial modes of operation details of which are given below These routines can be used to considerably simplify the program development work NOTE User should as a general rule save the registers of interest before calling the monitor routines and restore them after returning from the monitor routines 6 1 KEYBOARD MONITOR ROUTINES ACCESSIBLE TO USER Calling Address Mnemonic Function Description 020BH UPDAD Updates address field of the display The contents of the locations parlow Internal memory locations 60H amp 61H are displayed in the address field The contents of all the CPU registers flags are affected If Reg 0 No dot if B 1 2 3 4 No of dots in the address field 019BH UPDDT Updates data field of the display The contents of the location parlow Internal memory location 60H are displayed in the data field The co
7. 1 4 use this command press the SERCH key when prompted for command entry When this key is pressed display field is cleared and decimal point appears at special field prompting the user to input the type of memory Enter the type of memory Two decimal points appear at the right edge of the address field Now enter the starting address of the block of memory to be searched Press the NEXT key Now the display field is cleared again and a decimal point appears at the right edge of the address field Now enter the ending address of the block Press the NEXT key Monitor clears the display field and a decimal point appears at the right edge of the data field Now enter the constant to be searched upto 4 data Press the EXEC key to start the command execution Monitor now searches block of memory from Start Address to End Address for the specified string Then the monitor displays the address of the first location at which the string is found Press NEXT key to continue the search or EXEC key to terminate the command ERROR CONDITION 1 Specifying a value for end address of the source block which is less than value of start address of the source block Example Searching the block of program memory from 8800H to 880FH for a constant 55 Key Pressed Display comments Special Address Data Field Field Field RESET ESA 51 System Reset SEARCH Search command P P bs Type of memory 8 P 0008 Start address 8
8. 3 0123 F 123 Filename 123F using earphone jack to the EAR of AD ESA 31 51 User s Manual the audio tape interface hardware Press play of the recorder EXEC Display will be dashes in address and data field until the required file is found XXXX If any other file is found its name will be displayed on the address field 123F rd Specified file found Memory type file name will be displayed on special and address fields and rd will be displayed on the data field to indicate that the file is being read Completion of data transfer successfully 7 4 OPERATION FROM THE SERIAL MONITOR The software allows the user to store data on the tape and read the recorded data from the tape as named files 7 4 1 STORING DATA ONTO TAPE W command implements this facility The format for this command is as follows W PID address1 address2 filename Enter the following sequence when the system prompts for a command Type W enter the type of memory program memory or external data memory by entering P or D Now enter the filename followed by lt CR gt A valid filename consists of a sequence of hexadecimal digits User may enter any number of digits but the system retains only last four digits If invalid filename is entered the operation is aborted with an error message and control returns to monitor Ensure that the recorder is connected to the interface via MIC jack Set up the recorder in record
9. Hexadecimal Decimal Character Hexadecimal Decimal Character 40 64 60 96 I 41 65 A 61 97 a 42 66 B 62 98 b 43 67 C 63 99 44 68 D 64 100 d 45 69 E 65 101 e 46 70 F 66 102 f 47 71 G 67 103 g 48 72 H 68 104 h 49 73 I 69 105 i 4 74 J 6A 106 j 4B 75 K 6B 107 k 4C 76 L 6C 108 1 4 77 M 6D 109 m 4E 78 N 6E 110 n 4 79 6F 111 50 80 70 112 51 81 71 113 q 52 82 R 72 114 r 53 83 S 73 115 S 54 84 T 74 116 t 55 85 U 75 117 u 56 86 V 76 118 57 87 W 77 119 w 58 88 x 78 120 X 59 89 Y 79 121 5 90 7 122 7 5 91 7 123 5 92 7 124 50 93 1 7 125 5E 94 A TE 126 5E 95 TF 127 DEL cr AD ESA 31 51 User s Manual APPENDIX RS 232 CABLE REQUIREMENT i ESA 31 51 User s Manual APPENDIX RS 232 C CABLE REQUIREMENTS THE ESA 31 REQUIRES A NULL MODEM CABLE IN ORDER TO COMMUNICATE WITH OTHER SYSTEMS THESE ARE THE CONNNECTIONS REQUIRED FOR THE NULL MODEM CABLE Trianer Side System Side TXD PNS c MR DH Mer pM RUN RXD pin 3 RAD PMA oT lt TXD pin 2 RIS PINIS a esata OPEN CTS pin 5 CIS PINS o RTS pin 4 DSR PIN OS PT DTR pin 20 pig Nul c DSR pin 6 GND PNS gt C GNS pin 7 Note 1 Use male of 9 PIN D Connector on ESA 31 side appropriate on other side 2 If hardware handshaking is not required
10. MOV 71H A LCALL PUTBYTE MOV A 20H LCALL SOUTPT MOV R2 00H MOV A R2 MOV 71H A LCALL PUTBYTE LCALL DELAY LCALL DELAY MOV R3 03H MOV A 08H LCALL SOUTPT DJNZ A R2 ADD A 01H DA A MOV R2 A CJNE R2 60H SEC MOV A 00H MOV TIH A LCALL MOV A R6 Stores Minutes in R6 Reg Routine to put character on console Provide space Keep seconds 00 In R2 reg Delay routine Check for 60 sec over or not 11 11 8047 24 01 8049 04 804A FE 804B BE 60 52 804E 07 8050 74 08 8052 12 16 OE 8055 DB F9 8057 74 00 8059 F5 71 805B 12 18 SE 805E 7B 07 8060 74 08 8062 12 16 OE 8065 DB F9 8067 EF 8068 24 01 806A D4 806B FF 806C BF 24 52 806F 7B 04 8071 74 08 8073 12 16 OE 8076 DB F9 8078 74 00 807A F5 71 807C 12 18 SE 807F 7F 00 8081 00 8083 12 80 B7 i ESA 31 51 User s Manual RPTI RPT2 RPT3 ADD A 01H DA A MOV R6 A CJNE R6 4 60H MIN Check for 60 minutes over or not MOV R3 07H MOV A 08H LCALL SOUPT DJNZ R3 RPTI MOV A 00H MOV 71H A LCALL PUTBYTE MOV R3 07H MOV A 08H LCALL SOUTPT DJNZ R3 RPT2 MOV A R7 ADD A 01H DA A MOV R7 A CJNE R7 24H HRS check for 24 hours over or not MOV R3 04H MOV A 08H LCALL SOUTPT DJNZ R3 RPT3 MOV A 00H MOV 71H A LCALL PUTBYTE MOV R7 00H MOV R6 00H LCALL CURSOR 11 12 8086 02 80 LJMP LOOP 8089 Delay subroutine
11. 00H 80EB 02 80 06 LJMP START END 11 12 Program to perform Addition of two numbers This progran can be executed either in SERIAL mode or in KEYBOARD mode Two numbers are taken from locations 9000 amp 9001 of Data Memory They are added and the result is stored in the location 9002 of Data Memory ADDR OBJECT LABLE MNEMONIC COMMENTS SYMBOLS 8000 ORG 8000H 8000 90 90 00 START MOV DPTR 9000H KEEP DATA IN 9000 8003 EO MOVX A DPTR AND 9001 LOCATIONS 8004 F5 FO MOV OFOH A OF DATA MEMORY 8006 90 90 01 MOV DPTR 29001H 8009 A DPTR 800A 25 F0 ADD A OFOH ADD THEM 800C 90 90 02 MOV DPTR 9002H STORE THE RESULT IN 800F FO MOVX DPTR A 9002 LOCATION OF 8010 75 AO MOV OAOH 40EIH DATA MEMORY 8013 78 02 MOV RO 02 KER ESA 31 51 User s Manual 11 14 8015 8016 8019 801C 801F 11 13 ADDR OBJECT 8000 8000 8003 8004 8006 8009 800A 800C 800F 8010 8013 8015 8016 8019 801C 801F 2 20 02 02 00 04 03 00 JB 1 LJMP 0 LJMP 04FDH END READ DIP SWITCH JUMP TO SER MONITOR ELSE TO K B PROMPT Program to perform subtraction of two numbers This progran can be executed either in SERIAL mode or in KEYBOARD mode Two numbers are taken from locations 9000 amp 9001 of Data Memory They are subtracted and the result is stored in the location 9002 of Data Memory 90 F5 90 95 90 75 78 2 20 02 02 90
12. 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 2 3 3 3 4 3 4 1 3 4 2 3 4 3 3 4 4 3 4 4 1 3 4 4 2 3 4 4 3 3 4 4 4 3 4 4 5 3 4 5 3 4 6 3 4 7 3 4 8 3 4 9 INTRODUCTION 1 1 to 1 3 CONFIGURATION AND INSTALLATION 2 1 to 2 4 Configuration of BSA 31 uu botes ado Qd ioco n Ecos usaba e 2 Operational Mode Selection Ee tet Sor toc 2 1 eco crista 2 2 Baud Rate 5 1 2 2 Memory Se ou g naa ua Sas uuu egeo ETa 2 2 Installation of ESA Ie d RR GR 2 3 Installation Procedure for Serial Mode of Operation 2 3 No in Serial mode tipo tiec ER et OR e 2 3 Installation Procedure for Keyboard Mode of Operation 2 4 No Response in Keyboard Mode 2 4 KEYBOARD MONITOR 3 1 to 3 23 isses Tours MNT 3 1 RAM NCC 3 2 Keyboard and 3 2 Monitor Commands 2 25259 0 3 2 Examine Modify Memory Command 3 5 Examine Modify Register Command 3 7 G a ac pase cs 3 9 Breakpoint Commands u n t Rec
13. 51 System Reset DABLE BRK Enter the type of P P memory Program NEXT memory and data D d memory EXEC Terminate the command 3 4 4 5 ENABLE BREAK FUNCTION This command is used to enable the breakpoint after setting the breakpoint FORMAT EABLE BRK PRG MEM EXT DATA NEXT PRG MEM EXT DATA EXEC OPERATION 1 To use this command press EABLE BRK key when prompted for command entry 2 dot appears in the special field prompting the user to enter the type of memory 3 Press PRG MEM or EXT DATA key to select program memory or data memory 4 Press EXEC key Example Following procedure enables program memory breakpoints Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset EABLE BRK Enable program memory EXEC Terminate the command 3 4 5 SINGLE STEP COMMAND FUNCTION This command is used to execute a program one instruction at a time With each instruction executed control is returned to the monitor There is also an option to single step a program with count Count determines the number of instructions to be executed at a time Thus this command is an extremely useful debugging tool KER ESA 31 51 User s Manual FORMAT SINGLE STEP start addr NEXT count EXEC NEXT EXEC OPERATION 1 To use this command press the SINGLE STEP key when prompted for command Now contents of the user program counter are displayed in the address field a
14. 8 2 8 3 8 4 8 5 CHAPTER 9 9 1 9 2 93 9 3 1 9 3 2 9 3 3 9 3 4 9 4 9 4 1 9 4 2 9 4 3 MONITOR ROUTINES ACCESSIBLE TO USER 6 1 to 6 2 Keyboard Monitor Routines Accessible to User 1 Serial Monitor Routines Accessible to User 2 AUDIO INTERFACE 7 1 to 7 8 Introduction M 7 1 Install A a E la ean area oda 7 1 Operational HINS er 7 1 Operation from the Keyboard Monitor 7 2 Storing Data onto Tape aa sap Eten x amb cepa ia rere 7 2 Reading Data from Tape acie n a ori Ded sica duit etn 7 4 Operation from Serial Monitor 7 5 Storing Data onto pe uya aides teres 7 5 Reading Data from T3p68 a uu ua apas ashaku 7 6 Data Recording Qo s oe SR E 7 7 Bit POT 7 7 Byte FOM t P 7 7 File RM as sa 7 7 UTR Capacity u I a aussi qaa Wp dia Hei 7 8 PARALLEL PRINTER INTERFACE 8 1 to 8 4 Introduction TETAS 8 1 UO a 8 1 crus 8 2 Direct Output t a 8 2 Connector Detalles u 8 3 EPROM PROGRAMMER INTERFACE 9 1 to 9 10
15. 8089 7D DELAY MOV R5 0COH This routine will provide Isec delay 808B 7 FF BACK2 MOV R4 0FFH 808D 90 00 00 MOV DPTR 0H 8090 A3 GOBACK INC DPTR Delay routine 8091 5 82 MOV A 82H 8093 45 82 ORL A 82H 8095 70 F9 JNZ GOBACK 8097 1C DEC R4 8098 BC 00 FC R4 00H BACK1 809B 1D DEC R5 809C BD 00 EC CJNE R5 00H BACK2 809F 22 RET 80A0 Subroutine to display minutes 80A0 07 MIN MOV R3 07H 80A2 74 08 RPT4 MOV A 08H 80A4 12 16 OE LCALL SOUTPT 80A7 DB F9 DJINZ 4 80A9 EE MOV A R6 80AA F5 71 MOV 71H A 80AC 12 18 5E ICALL PUTBYTE 80AF 74 20 MOV A 20H 80B1 12 16 OE LCALL SOUTPT 80B4 02 80 20 LJIMP BEGIN 80B7 Subroutine to move the cursor three times back 80B7 7B 03 CURSOR MOV R3 03H 80B9 74 08 RPTS MOV A 08H 80BB 12 16 OE LCALL SOUTPT 80BE DB F9 DJNZ 5 80C0 22 RET i ESA 31 51 User s Manual 11 13 80C1 Subroutine to display hours 80C1 FF HRS MOV R7 A 80C2 F5 71 MOV 71H A 80C4 12 18 SE LCALL PUTBYTE 80C7 74 20 MOV A 20H 80C9 12 16 OE LCALL SOUTPT 80CC 74 00 MOV A 00H 80CE F5 71 MOV 71H A 80D0 12 18 5 LCALL PUTBYTE 80D3 7E 00 MOV R6 00H 80D5 74 20 MOV A 20H 80D7 12 16 OE LCALL SOUTPT 80DA 02 80 20 LJMP BEGIN 80DD Subroutine to display HRS MIN SEC on the console 80DD 48 52 53 20 4D DAT DB 48H 52H 53H 20H 4DH 80E2 49 4E 20 53 45 DB 49H 4EH 20H 53H 45H 80E7 43 0D 0A 00 DB 43H OAH
16. B SP PSW DPH DPL THO TLO TL1 PCH PCL EO FO 81 DO 83 82 8C 8A 8D 8B 90 BO 00 00 07 0 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 00000001 8802 F9 MOV RLA gt 4 3 9 2 S SINGLE STEP COMMAND WITH DISASSEMBLY FUNCTION This command is used to single step a program with disassembly The register contents will not be displayed FORMAT S addr CR OPERATION 1 To use this command enter S when prompted for command Rest of the procedure is same as for the SR command Only executed instructions in disassembled format are displayed and register contents are not displayed gt S 8800 CR 8802 MOV RLA 4 3 9 3 N SINGLE STEP WITH COUNT FUNCTION This command is used to single step a program with count The maximum value of the count is FF Multiple instructions can be executed at a time FORMAT N count CR OPERATION 1 use this command set the PC value to the starting address of the program using J command ESA 31 51 User s Manual 2 Enter the count and press key If the program starting address is 9000H and the count is 20 instructions at a time following commands have to be executed gt 9000 CR gt 14 CR Now 20 instructions will be executed at a time The register contents are displayed just like in SR command Now the user can
17. Enter the starting address terminated by lt CR gt 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 terminated by lt CR gt A maximum of four hex digits are allowed for the ending address After obtaining the filename starting address and the ending address the system will gather the data in the specified address range of the ESA31 reformat the data into INTEL 8 Bit HEX records and store the data in the specified file Uploading in progress XXXX While the uploading is going on the system will display the starting address XX XX of each record being uploaded Once the uploading is complete XT31 will let the user specify another address range User may specify a new address range or enter lt ESC gt to terminate uploading operation The following error messages may appear during upload and download operations 1 Invalid function number This is XT31 internal error therefore contact ESA technical support for assistance File not found Path not found No more files Access denied Invalid file handle Insufficient disk space Unable to continue upload tn FW Colon is not present at start of record Invalid data in source file following record E Checksum error in following Record i ESA 31 51 User s Manua
18. Keep the HEX eq in 8900 Data Memory Check for carry Data field addess Routine to display in data field Add Accumulator content with 30 11 4 11 7 In the given byte checking 5th bit is 1 or 0 If the 5th is 00 should be stored in 8901 Data Memory or if it is 0 ffh should be stored in 8901H data memory Execute the program in KEYBOARD mode or in SERIAL mode ORG 8000H ADDRESS OBJECT MNENOMIC COMMENTS 8000 90 89 00 MOV DPTR 8900 Store the given byte in 8900 Data Memory 8003 8004 INC DPTR 8005 33 RLC A Rotate left three times 8006 33 RLC A 8007 33 RLC A 8008 40 06 JC 8010 Check for carry 800A 74 MOV A 0FF Move FF in to accumulator 800C FO MOVX DPTR A 800D 02 80 13 LJMP 8013 8010 74 00 MOV A 00 Move 00 in to Accumulator 8012 FO MOVX DPTR A 8013 75 AO El MOV 0A0 0E1 Check for DIP switch 8016 78 02 MOV _ RO 02 8018 E2 MOVX A RO 8019 20 E3 03 JB OE3 801F 801C 02 00 03 LJMP 3 Jump to SFR monitor 801F 02 04 FD LJMP 04FD Else to K B Prompt 11 8 Program to display largest number among N numbers Execute the program either in KEYBOARD mode or in SERIAL mode ORG 8000H PUTBYTE EQU 185EH UPDDT EQU 019BH ADDRESS OBJECT MNENOMIC COMMENTS 8000 90 89 00 MOV DPTR 28900 The total no N of data bytes is stored in 8900 data memory i ESA 31 51 User s Manual 11 5 ADDRESS OBJECT MNENOMIC COMMENTS 8003 E0 MOVX
19. at this PC are displayed 8 0008 New Starting address 8 0088 0 0880 0 8800 EXEC E Control is transfered to the program at 8800H The Execution is in progress Example 2 Example to show the use of BREAK Key Since the program in Ex 1 is in infinite loop user has to press RESET key to come out of the program but now the register contents would be lost Instead if you press BREAK key the program breaks immediately with the latest status of all the registers saved 3 4 4 BREAKPOINT COMMANDS INTRODUCTION The ESA31 enables you to control program execution by setting breakpoints A breakpoints 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 execution and examine the status of memory or registers at those points FUNCTION These commands are used to set breakpoint clear breakpoint and display breakpoint in both program memory and data memory enable and disable breakpoint in both memory independently The breakpoint can be one or more and also user can specify range of address for breakpoint 3 4 4 1 CLEAR BREAK FUNCTION This command is used to clear breakpoint in program memory or data memory FORMAT CLRBRK PRG MEM EXT DATA addr next EXEC PREV lt range end addr gt EXEC KER ESA 31 51 User s Manual OPERATION 1 To use this command press CLR BRK key when prompted for command
20. either continue single stepping by pressing CR key or space bar or the user can exit from the command by pressing ESC key 4 3 10 B BREAKPOINT COMMANDS BREAKPOINTS The ESA31 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 freeze program execution 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 enable and disable breakpoint in both memory independently The breakpoint can be one or more and also user can specify range of address for breakpoint 4 3 10 1 CLEAR BREAKPOINT FUNCTION To clear the breakpoint s in the data memory or program memory FORMAT BC PID addr2 OPERATION To clear the breakpoint enter BCP or BCD for corresponding memory and with one address or range of address and Carriage Return Example clear the breakpoint of full program memory enter gt 0 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 i ESA 31 51 User s Manual BS PID addr1 addr2 OPERATION 1 Seta breakpoint in the progr
21. entered and it will display the default value in the address field with a dot To retain this value user can press NEXT or EXEC as required Otherwise user can enter the new value and then press NEXT or EXEC as required entries are made into the address field only The different messages which can appear on the data field and their meanings are given below Message on the data field Meaning Pt The type number of the bS Buffer Start Address bE Buffer End Address PS EPROM Starting Address PE EPROM Ending Address the parameter values are evaluated modulo 64K and a parameter entry is terminated by any valid delimiter Valid delimiters are NEXT and EXEC If an invalid entry is made the message Err is flashed in the address field and the prompt for the offending parameter is displayed again so that the user can enter the correct value Pressing NEXT key takes the user to the next parameter if one is required Otherwise it is treated as error condition Pressing the key completes the parameter entry process of the command i ESA 31 51 User s Manual NOTE Buffer means always data memory area If the program to be programmed on to an 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 9 4 1 PROG COMMA
22. gt to retry to establish the communication If the sign on message does not appear SE will be displayed on the trainer s address field indicating that trainer is trying to communicate with the host The above mentioned message appears on the host side again Pressing lt I gt will exit XT31 to DOS Now check for the following a Ensure that is connected to the correct COM port and that the COM port is functioning properly b Ensure that ESA31 is functioning properly and configured correctly c Check the RS 232 C cable and its connections Since the communciation package utilizes the hardware handshake signal DTR While communicating with ESA 31 the interfacing cable must support this signal also NOTE XT31 utilizes an interrupt driven routine for reading characters from the COM port Thus it is possible for XT31 to miss some characters if the system has any resident programs which are interrupt driven For example many systems 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 programs while XT31 is running If the problem persists please contact the manufacturer i ESA 31 51 User s Manual 10 3 10 3 RETURNING TO DOS User can terminate XT31 and return control to DOS by typing ALT X when the program is waiting for a keyboard input 10 4 OPERATIONAL DETAILS The complete command set of the ESA
23. has been set using BSP or BSD command FORMAT D PID CR OPERATION Enter the command DP or DD and carriage return to disable the preset breakpoint s Example To disable the breakpoint in the data memory gt DD CR gt Disable breakpoint does not clear the breakpoints 4 3 11 A ASSEMBLY COMMAND ESA31 provides a powerful PROM resident Assembler to simplify the user s task of program development This assembler available in serial mode of operation is a on line one and supports all the 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 gt address CR Assembly language instructions consist of three fields as shown below Address Object Mnemonic The fields may be separated by any number of blanks and tabs but must be separated by at least one delimiter Each instruction must be entered on a single line terminated by a Carriage Return No continuation lines are possible i ESA 31 51 User s Manual Opcode Field This required field contains
24. mode The system will display the message Writing data on to tape and begin transfering the specified data onto tape after the data a checksum byte is also written onto tape After completing the transfer the system will display the message Finished writing onto tape gt IMPORTANT NOTE Data is sent out once the user enters the lt CR gt after the ending address If the recorder is really not ready at this stage the data is still sent out and this will not get recorded on the tape OAD i ESA 31 51 User s Manual EXAMPLE Store the contents of locations 8000H to of program memory with a filename 14B3 on the tape Connect the recorder via the MIC jack and set it on RECORD mode Enter the following command sequence gt WP 8000 80FF 14B3 CR Writing data onto tape Finished writing onto tape gt 7 4 2 READING DATA FROM L command implements this facility The format for this command is as follows L filename CR Type L enter the filename and press CR Now the system will display the message Searching File filename Connect the recorder to the interface via the EAR jack Position the tape well ahead of the approximate starting point of the desired file Set the recorder in the play mode As and when the system finds a file it displays the filename as shown below Filename X X X X If the file is not the specified one the search continues When the specified file is found it disp
25. of memory 4 decimal point appears at the right edge of the address field Now enter the starting address of the area into which the block of data is to be moved This address is called the destination address Press the EXEC key to start the command execution 5 Monitor now moves the block of data from Start Address to End Address to the area beginning at the Destination Address After moving the data monitor displays the command prompt ERROR CONDITIONS 1 Specifying a value for the end address of the source block which is less than the value of the start address of the source block 2 Trying to move the data into non existent or Read Only Memory Example 1 Moving the block of program code listed in the example for the GO command to external data memory Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset BLK MOVE Block move command P P uos type of memory KER ESA 31 51 User s Manual Key Pressed Display Comments Special Address Data Field Field Field 8 P 0 0 0 8 Start address 8 P 0 0 8 8 0 P 0 8 8 0 0 P 8 8 8 0 NEXT P T 8 P 0 0 0 8 End address source block 8 P 0 0 8 8 0 P 0 8 8 0 3 P 8 8 0 3 NEXT destination type of memory EXT DATA d 8 0 8 8 0 Destination address 8 d 0088 2 d 0 8 8 2 0 d 8 8 2 0 EXEC Block moved command prompt Now using the EXAM MEM key observe the contents of the locations of data memory 8820H 8821H and 8822H 8823H and ve
26. program presented as example 1 for the GO command from the keyboard monitor section 3 4 5 You can execute it as shown below gt G 8800 CR The program can be executed by setting up breakpoints The procedure is as follows 1 Seta breakpoint in the program memory or data memory using BSP address CR i ESA 31 51 User s Manual 2 Ifthe desired breakpoints is range then enter BSP addr1 addr2 CR Enable breakpoint 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 Carriage Return key 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 key to terminate the process 4 3 9 S SINGLE STEP COMMANDS The ESA31 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 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 progra
27. routine can be used to print the desired information when the system is running in the keyboard mode Even in the 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 Name of the Routine PRINT Function Print a character Non printable one is printed as Calling address 1681H 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 C 0 EXAMPLE The following program if entered and executed from the keyboard prints ABCDEFGHIJKL i ESA 31 51 User s Manual Address opcode Mnemonic Comment 8000 90 80 50 MOV DPTR MSG point to msg 8003 4 11 8004 93 A DPTR get chr 8005 60 OE JZL2 end of msg 8007 82 PUSH DPH save pointer 8009 83 PUSH DPL 800 12 16 81 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 SJMPLI 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 4 49 4 4BH 4CH 805C 0D 0A 00 00H 8 5 CONNECTOR DETAILS The signal definitions on the 25 pin female D type connector used for parallel printer interface are given below PIN NO ON C
28. stop bit 60ms 7 5 3 FILE FORMAT Before recording the file a lead synchronization signal of 1 KHz frequency is recorded for 4 seconds Then a seven byte header is recorded The file header consists of filename 2 Bytes start address 2 bytes end address 2 bytes and checksum 1 byte Following this a mid synchronization signal is recorded This consists of a 2KHz signal for 2 sec and 1KHz signal for 0 8 secs Now the file data is recorded After this a tail synchronization signal of 2KHz frequency is recorded for 2 seconds Thus the file format is AD ESA 31 51 User s Manual Lead File Start Check Tail Data Sync name address address sync 1KHz 1 2KHz IKHz 2KHz 4sec mee Es Es Bytre 2sec 0 8 sec 2 sec 7 6 STORAGE CAPACITY As is obvious from the above description of the data formats the exact amount of data that can be stored on a tape depends upon the total number of files created The larger the number the smaller is the amount of data that can be stored because of the space consumed by the larger number of synchronization signals Assuming a typical number of 25 files for a standard tape of 90 minutes duration we see that approximately 10 minutes after allowing for about 15 seconds of inter file gap during recording may be taken up by synchronization signals This allows us to record approximately 72 KB of data on one such cassette However if data is recorded in files of smaller size say 128 o
29. the flag register Similarly a different bank can be selected by changing the bits RS1 and RSO of the flag register RS1 RSO Register Bank Address 0 0 0 00 07 0 1 1 08H 0FH 1 0 2 10 17 1 1 3 18 1 Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset EXAM REG rE Examine Register Command A A 00 contents of Reg A 8 A 08 New Data NEXT b 00 A register updated Next Register s contents displayed EXEC Command termination prompt 3 4 3 GO COMMAND FUNCTION The GO command is used to transfer control of the system from the monitor to user s program FORMAT GO addr EXEC OPERATION 1 To use this command press the GO key when prompted for command entry When this key is pressed the current contents of the User Program Counter are displayed in the address field and KER ESA 31 51 User s Manual contents of the location addressed by are displayed in data field A dot also appears at the right edge of the address field indicating that the user can update the value of user Program Counter if required 2 begin program execution press EXEC key Now the address and data fields are cleared and 15 displayed at left edge of the address field and control is then transferred to the user program at the current value of the user program counter 3 To abort execution of user program press RESET key However in this case all register informatio
30. to make a suitable cable if desired Please note that the cable must be short enough to be driven by the on board 8155A We suggest a maximum length of 3 feet for reliable operation 8 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 D 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 D command itself is also printed NOTES 1 control and non printable ASCII characters are printed as ASCII Code 2EH 2 If any errors occur during printing for eg 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 8 4 DIRECT OUTPUT TO PRINTER As already described when the printer interface is enabled any character sent to the console is 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 keyboard or serial Further this routine prints a character independent of the setting of SW5 Thus this
31. to the tape TPWR file name NEXT PRG MEM IEXT DATA start addr NEXT end addr EXEC NOTE Whenever a dot appears in the special field user has to enter the type of memory by pressing the following keys as the case may be KER ESA 31 51 User s Manual Type of memory Key to be to be selected pressed Program memory PRG MEM External data memory EXT DATA Bit memory BIT MEM Internal data memory INT DATA 3 4 1 EXAMINE MODIFY MEMORY COMMAND FUNCTION This command is used to examine the contents of selected memory locations The contents can be optionally modified if the memory location is in RAM area FORMAT EXAM MEM PRG MEM EXT DATA MEM INT DATA addr1 NEXT data NEXT PREV EXEC OPERATION 1 To use this command press the EXAM MEM key when prompted for command When this key is pressed the display is cleared and a dot appears at special field prompting the user to enter the type of memory to be examined Enter the type of memory by pressing PRG MEM EXT DATA BIT MEM or INT DATA key A dot appears at the last digit of the address field indicating that an address entry is required Enter the memory address of the byte to be examined memory addresses are evaluated modulo 64K if it is program memory or data memory and modulo 256 if it is internal data memory or bit memory This value is displayed in the address field of the display After entering the address value press the NEXT key The data by
32. user The signals related to Timer 0 1 and 2 are available on system connector J5 Connector details are provided in the last section of this chapter 5 7 SERIAL INTERFACE An 8251A Programmable communication interface at position U14 is used for implementing RS 232 C compatible serial interface This device is programmed for asynchronous operation 2 stop bits no parity data length of 8 bits and baud scale factor of 16X As already noted Timer of 8155 is used to generate the required Transmit and Receive clocks of 8251A based on the setting of the DIP Switch Refer section 2 1 3 on Baud Rate selection The I O address of 8251A can be found in Table 5 2 in section 5 4 The required voltage level conversion is i ESA 31 51 User s Manual done by MAX 232 at 020 The RS 232 C compatible signals are available on 9 pin D type female connector J7 Refer the last section of this chapter for connector details NOTE If the handshake signals are not required user can short DTR and DSR 5 8 PROGRAMMABLE PERIPHERAL INTERFACE DEVICES ESA31 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 of these devices can be found in Table 5 2 in section 5 4 The two 8255As at U35 and U27 are completely available to user The port signals are available on connectors 11 and J2 Refer
33. with the help of arrow keys and keep the space bar sp pressed till the desired value appears The parameters allowed to be set are Communication Port COM 1 COM2 Baud Rate 110 150 300 600 1200 2400 4800 9600 Number of Data bits 7 8 Parity NONE ODD EVEN and Number of Stop bits 1 2 After selecting the desired values press CR to set the parameters or press Esc to ignore the values i ESA 31 51 User s Manual 10 7 Communication parameters can also modified while user is in DOS by editing the file XT31 INS This file contains single data line having five integers separated by blanks representing various communication parameters These five integers represent serial communication port baud rate no of data bits no of stop bits and parity in sequence Table 10 1 shows details of the integer values and corresponding parameters 10 4 7 HELP On line help is available on all ESA31 monitor commands and commands specific to XT31 Help facility can be selected CTRL F1 A menu of commands is displayed from which desired command can be selected by using arrow keys and help information about that command is displayed in the remaining part of the screen Context sensitive help is available using ALT F1 This facility can be used if help information is desired about the command being entered against command prompt ESA 31 51 User s Manual 10 8 1 1 EXAMPLE PROGRAMS 1
34. 0 F0 CJNE 2 00 8956 22 RET 8957 EF MIN MOV A R7 subroutine to display minutes 8958 F5 60 MOV 60H A 895A 12 02 OB LCALL UPDAD 895D 02 89 OD LJMP UP 8960 ED HRS MOV 5 Subroutine to display hours 8961 F5 61 MOV 61H A 8963 12 02 OB LCALL UPDAD 8966 00 MOV R7 00H 8968 02 89 OD LJMP UP 11 11 Program to display 24 hours digital clock in SERIAL mode Execute the program from 8000h To change theMIN HOURS change the data in location 8009h amp 8007h respectively PUTBYTE EQU 185EH SOUTPT EQU 160EH DISPM EQU 164BH ADDRESS OBJECT MNENOMIC COMMENTS 8000 90 80 DD MOV DPTR ZDAT Keep string HRS MIN SEC in program memory 8003 12 16 4B LCALL DISPM dispaly routine 8006 23 START R7 23H Store hours in R7 reg i ESA 31 51 User s Manual 11 10 8008 800A 800B 800D 8010 8012 8015 8016 8018 801B 801D 8020 8022 8023 8025 8028 802B 802E 8030 8032 8035 8037 8038 803A 803B 803C 803F 8041 8043 8046 7E EF F5 12 74 12 EE F5 12 74 12 7A EA F5 12 12 12 7B 74 12 DB EA 24 D4 FA BA 74 5 12 58 71 18 20 16 71 18 20 16 00 71 18 80 80 03 08 16 9 01 60 00 71 18 5 5E 5 89 89 5 LOOP BEGIN SEC RPT i ESA 31 51 User s Manual MOV R6 58H MOV A R7 MOV 71H A LCALL PUTBYTE MOV A 20H LCALL SOUTPT MOV A R6
35. 0088 0 0880 Jah ESA 31 51 User s Manual Uv KER ESA 31 51 User s Manual 8800 0008 0088 0880 880F 8800 05 55 55 End address of block Constant value Start search Command termination prompt 4 SERIAL MONITOR 4 1 INTRODUCTION This chapter describes the commands supported by the Serial Monitor Program The Serial Monitor allows ESA31 to be operated from a CRT terminal Host Computer connected via the RS 232 C serial interface refer to chapter 5 on Hardware and Appendix C on RS 232 C 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 ES A 8051 Serial Monitor V x y is displayed x is the current version number and y is the revision number on one line and a prompt gt on the next line indicating that the monitor is ready to accept commands from the user With the exception of RESET key and BREAK key the keyboard is completely disabled 4 2 STRUCTURE OF MONITOR COMMANDS Whenever the monitor is ready to accept a command from the user it outputs a greater than symbol gt as the command prompt character at the beginning of a new line The commands entered by the user consists of a single character command mnemonic followed by a list of command parameters This list may consist of upto fo
36. 1 1 Program to display ESA P LTD in trainer display Execute the Program in KEYBOARD mode only OUTPUT EQU 0255H ADDRESS OBJECT MNENOMIC COMMENTS 8000 C2 D5 CLR 005 To select Program Memory 8002 90 80 50 MOV DPTR 8050 8005 12 02 55 LCALL OUTPUT Output routine to display string of 7 characters 8008 02 80 00 LJMP 8000 Keep data from 8050 to 8056 Program Memory 8050 D6 8051 77 8052 37 8053 83 8054 87 8055 ED 8056 97 The program is in a continuous loop Press RESET key to come out of the program ESA 31 51 User s Manual 11 1 11 2 Program to perform Multiplication of two numbers Execute this program either in KEYBOARD or in SERIAL MODE Taking 2 numbers in 9000 amp 9001 Data Memory and storing the result in 9002 amp 9003 Data Memory ADDRESS OBJECT MNENOMIC COMMENTS 8000 90 90 01 MOV DPTR 9001 Keep Data in 9000 amp 9001 Data Memory location 8003 MOVX A DPTR 8004 F5 F0 MOV 0F0 A 8006 90 90 00 MOV DPTR 9000 8009 MOVX A DPTR 800A A4 MUL AB Perform Multiplication operation 800B 90 90 02 MOV DPTR 9002 Store the result in 9002 amp 9003 Data Memory 800E FO MOVX DPTR A 800F A3 INC DPTR 8010 E5 FO MOV A 0F0 8012 F0 MOVX DPTR A 8013 75 MOV 0A0 80EI 8016 78 02 MOV 80 402 8018 2 MOVX 8019 20 03 JB 801 Check for Dip Switch 801C 20 00 00 0 Jump to SER Monitor 801F 02 04 FD LJMP 04FD Else to K B Promp
37. 2 Program to Perform Multiplication of 2 numbers 11 2 11 3 Program to Perform division Of 2 numbers 11 2 11 4 Program to Display ELECTRO SYSTEMS ASSOCIATES PVT LTD BANGALORE O h ies 11 3 11 5 Program to convert ASCII to HEX equivalent on console 11 4 11 6 Program to convert HEX equivalent to ASCII on the Display 11 4 11 7 Checking the Sth bit in the given bytfe 11 5 11 8 Program to display largest number among numbers 11 5 11 9 Program to display decimal count 0 to 20 11 7 11 10 Program to display 24 hour digital clock in key board mode 11 8 11 11 Program to display 24 hour digital clock in serial mode 11 10 APPENDICES APPENDIX A COMPONENT PLACEMENT DIAGRAM APPENDIX B ASCII CODES APPENDIX RS 232 CABLE REQUIREMENTS APPENDIX D PRODUCT LIST APPENDIX INSTRUCTION SET 1 INTRODUCTION SA31 is an extremely powerful microcontroller trainer based on the popular 8031 microcontroller It can be used as a flexible instructional aid in academic institutions Sophisticated features like Assembler and Disassembler allow the use of ESA31 for serious microcontroller developmental work in research institutions and R amp D laboratories On board fa
38. 3 11 Clear Break ua u qaa Saqi 3 11 Set eic p 3 12 Display Break scd ute ener ey 3 13 Disabl Break de 3 14 Enable Break 3 15 Single Step Command 3 15 Block Mov Command oues bU 3 17 Compare Command 3 18 MEE 3 20 Search Command ie ou Dd Du tbc Ot Up BU eU UE 3 22 4 41 42 43 4 3 1 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 5 3 5 4 5 5 5 6 5 7 5 8 5 9 5 10 5 11 SERIAL MONITOR 4 1 to 4 17 IntirOd uct lf usa 4 1 Structure of mo itorcommands L 4 1 Monitor commands iiio 4 2 S Modify Memory Cosnimiantl 4 4 D Display Memory Command 4 5 M Memory Comtmmand eite oe eet iie iei 4 5 Memory Command Lui ccm erecta auct prete pue iio eeu dd 4 6 C Compare Memory 4 7 R Examine modify Registers Command 4 7 J Jump to Address Set PC Command 4 9 G Go Command eet eite tet eee eder eee eee 4 10 S inae Step Command u u abri a ERA uM E 4 11 SR Single Step with
39. 31 is transparent and is fully supported by XT31 Refer to chapter 4 for the serial monitor mode commands Press F1 for the help command In addition XT31 supports the file download file upload and other commands which are explained below NOTE During parameter entry the system expects the alphabetic characters to be in upper case Thus it is convenient to use the key board with the CAPS LOCK on 10 4 1 DOWNLOAD OPERATION This feature allows downloading of the contents of an object code file into the memory of ESA31 NOTE The object code file must be HEX file 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 which are files with records in INTEL 8 Bit HEX format To perform download operation 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 gt If the filename is invalid it displays FILE NOT FOUND and prompts again for the filename If the path specified is invalid it displays a message PATH NOT FOUND and prompts again for the filename If none of the above errors occur the system will prompt for the Memory type as follows Memory ty
40. 56 at U8 0000 7FFF Program memory 62256 at U9 8000 FFFF User Program memory 62256 at U10 0000 7FFF User Data memory 62256 at U11 8000 DFFF User Data memory Battery Option The 62256 provided at U9 010 and U11 can be backed up by an optional battery The terminals for connecting the battery are brought out as BATT 5 4 ADDRESSING decoding is implemented using a E561 E562 E563 and E564 Thus foldback exists over the unused address lines The I O devices their addresses and their usage is summarized below TABLE 5 2 I O ADDRESS MAP Device Address Usage 8255A at U35 Available to user Port A E900H Port B E901H Port C E902H The signals are avai Control Port E903H able on connector J1 8255A at U27 Available to user Port A E800H Port B E801H The signals are avail Port C E802H able on connector J2 Control Port E803H 8253 5 at U13 Available to user Timer 0 Timer 0 is available to user on connector J3 cr AD ESA 31 51 User s Manual Device 1 2 Control Port 8251A at 014 Data Port Command port 8279 5 at U24 Data Port Command Port 8155 at U15 Internal RAM Command Status Port A Port B Port C Address 1 EA02H EA03H 1 1 000 E100H E101H E102H E103H 5 5 KEYBOARD DISPLAY INTERFACE Usage Timer 1 is available to user on connector J3 Timer 2 1s available to user o
41. 59 53 54 45 4D 53 20 41 53 53 43 8070 49 41 54 45 53 20 50 56 54 20 4 54 44 2E 8080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 8090 20 20 20 20 42 41 4E 47 41 4C 4F 52 45 2E OA 0 80A0 OA OD 00 ESA 31 51 User s Manual 11 3 11 5 Program to display ASCII Character console Execute this program in serial mode only ADDRESS 8000 8003 8004 8007 OBJECT 90 90 00 E0 12 02 16 OE 00 03 SOUTPUT EQU 160EH MNENOMIC MOV DPTR 9000 MOVX A DPTR LCALL SOUTPUT LJMP 3 COMMENTS Keep the ASCII value in 9000 data Memory return to serial monitor 11 6 Program to convert ASCII to its HEX equivalent 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 equivalent no lies between A amp F Execute this program in KEYBOARD mode only ADDRESS 8000 8003 8004 8005 8006 8008 800A 800B 800D 800F 8010 8013 8015 8016 8017 8019 i ESA 31 51 User s Manual OBJECT 90 E0 F9 94 40 9 24 78 F6 12 80 E9 C3 24 02 89 00 0A 0B 37 60 01 9B EB 30 80 OD MOVX MOV CLR SUBB JC MOV ADD MOV MOV LCALL SJMP MOV CLR ADD LJMP MNENOMIC DPTR 8900 A DPTR RIA 8015 1 37 RO 60 RO A 091B 8000 1 C A130 800D COMMENTS
42. 7 Reg MOV 5 61H A MOV A R7 MOV 60H A LCALL UPDAD Routine to Invoke Address field 11 8 8900 890 8910 8911 8913 8916 8919 891 891 8910 891E 891 8922 8924 8926 8929 892 892C 892D 892E 8931 8933 8935 8936 8938 8939 893A 893D 893F i ESA 31 51 User s Manual 79 E9 FE F5 12 12 9 24 D4 F9 B9 74 F5 12 EF 24 D4 FF BF 74 5 24 04 7D 7F 00 60 01 89 01 60 00 60 01 01 60 00 60 01 24 00 00 9B 44 ED 9B 26 23 UP RPT MOV MOV MOV MOV LCALL MOV MOV DA MOV CJNE MOV MOV LCALL MOV ADD DA MOV CJNE MOV MOV MOV DA MOV CJNE MOV MOV R1 00H 1 R6 A 60H A UPDDT DELAY A R6 A 01H A RIA R1 60H RPT A 00H 60H A UPDDT A R7 A 01H A R7 A R7 60H MIN A 00H 60H A 5 A 01H A R5 A R5 24H HRS R5 00H R7 00H Store Seconds in R1 Reg Routine to Invoke Data field compare 60 sec is over or not Compare 60 Minutes is over or not Compare 24 hours is over or not 11 9 8941 02 89 04 LOOP Jump to loop 8944 04 R2 04H To provide 1 sec delay 8946 7 BACK3 MOV R4 0FFH 8948 7B FF BACK2 R3 0FFH 894A 1B BACK2 DEC R3 894B BB 00 FC CJNE R3 00 BACK1 894 1 DEC R4 894F BC 00 F6 CJNE R4 00 BACK K2 8952 1A DEC R2 8953 BA 0
43. AL NB ESA 31 USER MANUAL Electro Systems Associates Pvt Ltd com This is user s manual for ESA 31 microprocessor trainer This manual describes hardware and software components of ESA 31 and gives the interface information necessary for expanding the system This manual describes in detail the facilities offered by the Keyboard Monitor Program and Serial Monitor Program the On line Assembler Disassembler packages The on board facilities Audio cassette interface Centronics parallel printer interface are also described in this manual Communication with a Host Computer is also described Please note that this volume is a user s guide for ESA 31 and as such does not deal elaborately with the features of 8031 microcontroller and related peripherals and their programming Details regarding these can be obtained from the following INTEL Publication MICRO CONTROLLER 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 all 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 ESA 31 51 User s Manual CONTENTS CHAPTER 1 CHAPTER 2 2
44. E PRG MEM EXT DATA INT DATA start addr NEXT end addr NEXT PRG MEM EXT DATA INT DATA dest addr EXEC SET BREAKPOINT Sets a breakpoint in program memory or data memory with facility of range ORing SET BRK PRG MEM EXT DATA addr NEXT EXEC PREV lt range end addr gt EXEC CLEAR BREAKPOINT Clears a breakpoint in program memory or data memory with facility of range ORing CLR BRK PRG MEM EXT DATA addr NEXT EXEC PREV lt range end addr gt EXEC KER ESA 31 51 User s Manual ENABLE BREAKPOINT Enables breakpoint in program memory or data memory EABLE BRK PRG MEM EXT DATA NEXT PRG MEM EXT DATA EXEC DISABLE BREAKPOINT Disables the breakpoint in program memory or data memory DABLE BRK PRG MEM EXT DATA NEXT PRG MEM EXT DATA EXEC COMPARE MEMORY Compares two blocks of memory COMP PRG MEM EXT DATA INT DATA start addr NEXT end addr NEXT PRG MEM EXT DATA INT DATA dest addr EXEC FILL MEMORY Fills a block of memory with a byte constant FILL PRG MEM EXT DATA INT DATA start addr NEXT end addr NEXT data EXEC SEARCH Searches a string of data in program or data memory SERCH PRG MEM EXT DATA INT DATA start addr NEXT end addr NEXT datal NEXT data2 NEXT data3 NEXT data4 EXEC DISPLAY BREAKPOINTS Displays the breakpoints in program memory or data memory DPBRK PRG MEM EXT DATA NEXT EXEC TPRD Reads from the tape TPRD file name EXEC TPWR Write
45. ENTRONICS CONNECTOR DIRECTION FROM ESA 31 PIN NO ON J3 SIGNAL DESCRIPTION STROBE Data 0 Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 STROBE pulse to the printer These signals represent 8 bits of parallel data High 1 Low 0 OQ FW 1 2 3 4 5 6 7 8 i ESA 31 51 User s Manual PIN NO DIRECTION PIN NO ON ON J3 SIGNAL FROM DESCRIPTION CENTRONICS ESA 31 CONNECTOR 9 A high incidates that printer can not receive data The Signals becomes high in following cases a During the data entry b During printing operation c In the OFF LINE state d During printer error status M AD ESA 31 51 User s Manual 9 SYSTEM 9 1 INTRODUCTION ESA31 EPROM programmer system is a powerful and easy to use facility provided by ESA31 This chapter describes the use of this EPROM Programmer System The ESA31 trainer and the EPROM programmer interface module with a 26 core flat ribbon cable together form the EPROM 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 keyboard monitor or from the serial monitor A 28 Pin ZIF socket is provided for placing the When a 24 Pin EPROM is to be placed it must be aligned with the bo
46. FF 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 ESA31 has four 28 Pin sockets for memory System firmware 32K bytes is supplied in a 27256 EPROM at the socket U8 32K bytes of static RAM is provided by a 62256 at the socket U9 as Program Memory 32K bytes of Data Memory is provided at U10 as Data Memory The fourth socket at is populated with 62256 to provide 24K bytes of Data Memory ESA 31 51 User s Manual 2 2 INSTALLATION ESA31 To install ESA31 the following accessories are required a Power Supply 5V 3 Amp b For Serial mode of operation CRT terminal with RS 232 C interface or host system like an PC Compatible with the driver software for host system Refer chapter 10 for details 2 2 1 INSTALLATION PROCEDURE FOR SERIAL MODE OF OPERATION a Select serial mode of operation 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 ESA31 to the CRT terminal host system through RS 232 C cable Appendix C describes the RS 232 C interface requirements over the connector J7 Refer Appendix A for locating the connectors If a terminal is being used turn on the terminal If a computer system is being used turn on the system and execute the driver software Ref Chapter 10 for details e Connect the power supply of r
47. In the keyboard mode the user enters the commands and data by pressing the appropriate keys on the keypad Responses are displayed by the system on the seven digit LED display Whenever the monitor expects a command the display shows dash at the left edge of the address field possibly along with an error message or with the sign on message upon reset When the monitor expects parameter s decimal point s will be displayed on the field into which the parameter s is are to be placed The parameter will be either an address to be entered in the address field or a byte of data to be entered in the data field The only exception explained later occurs in the use of the EXAM REG command The valid range for an address parameter is from 1 to 4 hexadecimal digits and the valid range for a data parameter is from 1 to 2 hexadecimal digits Longer numbers may be entered but such numbers are evaluated modulo 64K or 256 respectively i e only the last four or the last two digits entered will be accepted The RESET key causes a hardware reset and restarts the monitor The monitor displays the sign on message ESA51 across the address and data fields of the display Now the monitor will be ready to accept the commands from the user But the monitor does not save the information about the state register values etc of any previous user program However contents of the user portion of the RAM area are not disturbed by the monitor KER ESA 31 51 Us
48. MMANDS The keyboard monitor is capable of executing fifteen individual commands summarized in Table 3 1 Each command is represented by exactly one key with appropriate legend on the keytop The commands are described in detail in the sections which follow In both the table and in the individual command descriptions the following notation is used Upper case letters and numbers represent keyboard keys NOTATIONAL CONVENTIONS SYMBOL NAME USAGE curly braces with ellipses Encloses a required argument 1 or more times square brackets encloses an item that appears 0 or 1 time square brackets encloses an item that appears or more times vertical bar italics seperates alternative items in a list indicates a descriptive item that should be replaced with an actual item KER ESA 31 51 User s Manual TABLE 3 1 KEYBOARD MONITOR COMMAND SUMMARY COMMANDS amp FUNCTION FORMAT EXAMINE MODIFY MEMORY Displays Modifies the contents of a memory location EXAM PRG MEM EXT DATA MEM INT DATA addr1 NEXT data NEXTI PREV EXEC EXAMINE MODIFY REGISTER Displays modifies 8031 8051 register contents EXAM REG reg key Data NEXT PREV EXEC SINGLE STEP Executes a single user program instruction SINGLE STEP start addr NEXT count EXEC NEXT EXEC GO Transfers control from monitor to user program Go addr EXEC BLOCK MOVE Moves a block of data from one portion to another BLK MOV
49. MOV A 08H 8015 12 16 OE LCALL SOUTPT 8018 DB F9 DJNZ R3 LOOP 801A 12 80 43 LCALL DELAY Delay routine 801D 12 80 43 LCALL DELAY 8020 EA MOV A R2 8021 24 01 ADD A 01H 8023 D4 DA A Perform Decimal Adjust 8024 FA MOV R2 A Accumulator operation 8025 BA 21 CJNE R2 21H RPT Compare the count with 21 8028 02 00 00 LJMP 0000H 802B 7 00 KBD MOV R2 00H 802D EA RPTI A R2 i ESA 31 51 User s Manual 11 7 ADDRESS OBJECT 802E F5 60 8030 12 01 9B 8033 12 80 43 8036 12 80 43 8039 0A 803A EA 803B 04 803C FA 803D BA 21 ED 8040 02 04 FD 8043 7C DELAY 8045 7B FF BACK2 8047 1B 8048 00 804 1 804C BC 00 F6 804F 22 MNENOMIC COMMENTS MOV 60H A Routine to display LCALL UPDDT on Data field of trainer LCALL DELAY LCALL DELAY INC R2 MOV A R2 DA A MOV R2 A CINE R2 21H RPT1 LJMP O4FDH MOV R4 0FFH Delay routine MOV R3 0FFH DEC R3 R3 00H BACK1 DEC4 R4 00H BACK2 RET 11 10 Program to display 24 hours digital clock in keyboard MODE Execute the program from 8900 To change the Min Hours change the data in the location 8903 and 8901 respectively UPDAD UPDDT ADDRESS OBJECT 8900 7D 23 8902 7F 58 8904 ED LOOP 8905 F5 61 8907 8908 F5 60 890A 12 02 i ESA 31 51 User s Manual EQU 020BH EQU 019BH MNENOMIC COMMENTS MOV R5 23H Store Hours in 5 Reg MOV R7 58H Store Minutes in R
50. ND This command is used to program an EPROM This command requires the following four parameters in that order EPROM Type EPROM type should be one of the types listed in section 9 1 Buffer start Starting address of the source of data BufferEnd Ending address of the source of data EPROM Start Absolute Starting address of the EPROM from where programming is to begin Note that these parameters must satisfy certain conditions as explained in the section 9 3 1 P Command Once the correct parameter values are available the system checks the EPROM for blank values in the FF required zone If the EPROM is blank in the required zone the system proceeds further Otherwise it displays the message FULL in the address field and waits for user input Now if the user presses EXEC key the system returns control to the Keyboard Monitor If user presses NEXT key the system proceeds further Any other key will have no effect After this the system proceeds with programming and verification on a byte by byte basis As each location in the EPROM gets programmed the EPROM address is displayed in the address field and the programmed data is displayed in the data field The system utilizes Intelligent Programming Algorithm wherever applicable and this reduces the programming time significantly Tf the complete programming and verification is successful the system will display a 12 bit checksum in the address fie
51. P 0 8 8 0 0 P 8 8 8 0 NEXT d Prompt for source end 8 P 0 0 0 8 8 P 0 0 8 8 KER ESA 31 51 User s Manual Key Pressed Display Comments Special Address Data Field Field Field 0 P 0 8 8 0 7 P 8 8 0 7 NEXT prompt for destn P type of memory 8 p 0 0 0 8 Destination address 8 p 0088 1 0881 0 p 8810 Match command termination command prompt Now using Examine Memory command alter the contents of location 8805H and issue the compare command again The key sequence will be exactly same as described already Hence only the interaction after pressing EXEC key is shown EXEC 8805 55 Mismatch waiting for user input NEXT continue comparison command termination command prompt 3 4 8 FILL COMMAND FUNCTION This command is used to fill a block of memory with a constant data FORMAT FILL PRG MEM EXT DATA INT DATA Start addr NEXT end addr NEXT data EXEC OPERATION 1 To use this command press the FILL key when prompted for command entry When this key is pressed display field is cleared and decimal point appears at special field prompting the user to input the type of memory Enter the type of memory gt Two decimal points appear at the right edge of address field Now enter starting address of the block of memory to be filled Press the NEXT key Now the display field is again cleared and again a decimal point appears at the right edge of the address field Now enter the endi
52. ROM programmer menu and displays R Read B Blankcheck P Program V Verify E Exit AD ESA 31 51 User s Manual Enter Option The Serial 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 the Serial Monitor Aborting a command With it exits from the EPROM Programmer Menu to the serial monitor prompt Once a specific command is issued further prompts will depend on the command itself However if the user enters ESC whenever the system is looking for an entry from the user the current operation is aborted and control returns to the warm start of the Serial Monitor So in this case the user has to re enter the EPROM Programmer menu by entering P before issuing any command 9 3 1 P COMMAND This command is used to program an EPROM This command requires the following four parameters EPROM type EPROM Type should be one of the types listed above in section 9 1 Buffer Start Starting address of the source of data Buffer End Ending address of the source of data EPROMstart Absolute starting address of the EPROM from where programming is to begin NOTE Buffer always means data memory area If the program to be programmed on to an EPROM is in program memory area the user has to transfer it to the data memory area before a
53. Register Display Command 4 11 Single Step with Disassembly Command 4 12 N Single Step with cess eiaa 4 12 B Bredk point Sss 4 13 Clear Breakpoint Command sissien Lost UE 4 13 set Break pO COPBIIIBBI VR DUE 4 13 Display Breakpoint ua a i uA 4 14 FEnabl aS 4 14 Disable Breakpoint 4 15 A Assembly Command s L Ce eta onc eta Sie 4 15 Z Disassembler Command 4 16 H HelD Command u 4 17 HARDWARE 5 1 to 5 10 lcs D 5 1 CPU Address Data and Control Signals 5 1 honte Eod ciii m 5 1 5 2 Keyboard Display uuu circo tiae oto et rotes 5 3 Programmable Interval 5 5 Seral Interface te EE E 5 5 Programmable Peripheral Interface Devices 5 6 Programmable Input output and Timer 5 6 Bs 5 6 Connector n 5 7 6 6 1 6 2 CHAPTER 7 7 1 7 2 tal 7 3 1 3 2 7 4 7 4 1 7 4 2 7 5 7 5 1 7 5 2 7 5 3 7 6 8 8 1
54. a Pointer Low Register THO Register TLO Register Register TL1 Register Register P3 Program Counter High Program Counter Low Register RO Register R1 Register R2 Register R3 Register R4 Register R5 Register R6 Register R7 NOTE The flags register PSW is also displayed in bit format when Register command is executed The ESA 31 51 User s Manual meaning of the pattern CAFBBOGP is as follows PSW bit Abbreviated Function as 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 Examples Example 1 gt R lt gt B SP PSW DPH DPL THO TLO TL1 P3 PCH PCL EO FO 81 DO 83 82 8C 8A 8D 8B 90 BO oo 00 07 00 00 00 00 00 00 00 FF FF 00 00 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 00000000 gt Example 2 Examine and alter register and then examine register B RA CR A E0 24 CR B F0 25 lt ESC gt 4 3 7 J 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 com
55. a valid delimiter a carriage return is entered Hence a command entry can be canceled anytime before the delimiter is entered by pressing ESC key The command prompt character is output on a new line 4 3 MONITOR COMMANDS Each command described in this chapter consists of a one or two character followed by appropriate parameters and data These commands are summarized in Table 4 1 and are described in detail in the sections which follow In the table as well as in the subsequent descriptions the following notation is used NOTATIONAL CONVENTIONS SYMBOL NAME USAGE curly braces Encloses a required argument with ellipsis 1 or more times square brackets encloses an item that appears or 1 time square brackets encloses an item that appears 0 or more times vertical bar seperates alternative items in a list italics indicates a descriptive item that should be replaced with an actual item i ESA 31 51 User s Manual TABLE 4 1 SUMMARY OF SERIAL MONITOR COMMANDS COMMAND FUNCTION FORMAT A Assembler A address B Clear Display Set breakpoint in program memory external data memory B D PID I CIS PID address address2 Compare a block of memory with destination block C PIDII address1 address2 PIDII address3 D Disable breakpoint in program memory or data memory D PID E Enable breakpoint in program memory or data memory E PID Fill a block of memory with constant or searc
56. ailable on a 50 pin right angle connector OAD i ESA 31 51 User s Manual INTERFACE SIGNALS Parallel I O 48 lines 2 X 8255 2 of TTL compatible bus brought out to two spectra strip type ribbon cable connectors Serial I O 5 232 with standard MODEM control signals through on board 9 pin D type female connector Cassette interface signals Available on MIC and EAR sockets Parallel printer signals Centronics compatible parallel printer interface signals available on a 25 pin D type female connector in PC compatible pin configuration POWER SUPPLY Optional 35V 0 1 cr AD ESA 31 51 User s Manual 2 CONFIGURATION AND INSTALLATION 2 1 CONFIGURATION OF ESA31 ESA31 Microcontroller Trainer is versatile and can be configured in a number of ways as determined by the settings of a DIP Switch refer to the component layout diagram in Appendix A to locate the DIP Switch This chapter describes all the configuration options and the installation procedures 2 1 1 OPERATIONAL MODE SELECTION ESA31 can be operated either in the hexadecimal keyboard mode or in the serial mode In the hexadecimal keyboard mode the trainer is operated from the hexadecimal keyboard display unit In the serial mode the trainer is connected to a CRT terminal or to a host computer system like PC Compatibles through an RS 232 C interface In either mode of operation the system provides a variety of comma
57. am memory or data memory using BSP address CR 2 Ifthe desired breakpoints is a range 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 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 memory respectively with carriage return FORMAT BD PID CR OPERATION 1 Enter the command BDP or and carriage return to display the preset breakpoints 2 Enter Carriage Return to view remaining preset break point s or terminate the command with ESC key 3 No breakpoints found message is displayed if no breakpoints are set Example To display the breakpoint in the program memory which has been set in the previous command gt CR 000B lt gt The above address is displayed to indicate that breakpoint at address OOObH is 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 carriage return to enable the preset breakpoint s oO AD ESA 31 51 User s Manual Example To enable the breakpoint in the program memory which has been set in the previous command gt CR 4 3 10 5 DISABLE BREAKPOINT FUNCTION To disable the breakpoint which
58. bsolute ending address of the EPROM The parameters must satisfy the following relations 1 EPROM start lt Absolute last address of the EPROM i ESA 31 51 User s Manual ii EPROM End lt Absolute last address of the EPROM and 11 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 addresses and data read are displayed in the Keyboard Display unit s display fields If it is blank then the following message is displayed EPROM is blank Then 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 YY Where XXXX is the absolute EPROM address of the first non blank location and YY is its content Then it displays the address and data of subsequent non blank locations from next line onwards If ESC key is pressed control returns to the Serial Monitor 9 3 4 R COMMAND This command is used to transfer contents of the EPROM into the ESA31 memory space This command requires the following four parameters EPROM Type same as for P command EPROM Start same as for B command EPROM End same as for B command Buffer Start starting address in ESA31 memory space The parameter display and modification procedures are menu driven and are completely similar to the
59. cation Note that in serial mode a is always a prompt for data entry while a gt 15 the prompt for command entry To modify the contents of this location the user can enter the new value now Enter a Carriage Return 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 locations Example 1 Examine the PROM locations 11H gt 1 1 CR gt 0011 lt gt gt Example 2 a series of RAM locations starting at 8820H and modify contents of the location 8822H gt MD8820 lt CR gt 8820 xx lt CR gt 8821 xx lt CR gt 8822 xx 55 lt CR gt gt 8823 xx lt ESC gt i ESA 31 51 User s Manual 4 3 2 M DISPLAY MEMORY COMMAND FUNCTION This command is used to display the contents of the program or external or internal data memory FORMAT M PIDII address1 address2 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 the memory block and follow it with a Carriage Return Now the monitor will output th
60. cilities like Audio Tape Interface Serial interface RS 232 C and Centronics compatible Parallel Printer Interface enhance the power and utility of ESA31 system Following are the main features of ESA31 ESA3I can be operated either from on board keyboard or from a CRT terminal through its RS 232 C interface Keyboard and Serial Monitor Programs support the entry of user programs editing debug facilities like breakpoints and single stepping and full speed execution of user programs 1 Assembler can assemble any memory resident assembly language program l Pass Disassembler disassembles the object code into standard INTEL mnemonics On board Audio Tape Interface provides MIC and EAR sockets for operation with an Audio Tape Recorder Total of 120KB memory is provided of which 64KB of memory is program memory and 56 KB of memory is data memory The powerful monitor of the trainer occupies 32KB out of 64KB of program memory There is a battery backup option for 32KB of program memory and 56KB of data memory STD bus compatible signals available on the bus connector for easy expansion AD ESA 31 51 User s Manual Driver Software DOS Windows facilitates downloading uploading of user programs from to a host computer system RS 232 C cable for serial interfacing Options Available a Interface Modules for training purpose Calculator keyboard Elevator Display ADC with DAC Dual S
61. d then switch ON the power supply If the problem still persists please contact the manufacturer 2 2 3 INSTALLATION PROCEDURE FOR KEYBOARD MODE OF OPERATION a Select Keyboard mode of operation Ref Section 2 1 1 b Connect the power supply of required capacity to ESA31 and switch ON the power c Now the following message appears on the address field of seven segment display for few seconds POST Power ON Self Test will be done Following initialisations are also done registers will be initialised to Reset condition of 8031 8051 Breakpoints in both program and data memory will be cleared and disabled Then appears the sign on message as follows ESA 51 Now ESA 31 is ready for operation in the keyboard mode 2 2 4 NO RESPONSE IN KEYBOARD MODE If the correct sign on message does not appear in the keyboard mode check the following items a If seven segment display is blank check the power supply connections and voltages b If the seven segment 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 the RESET or switch OFF and then switch ON the power supply If the problem persists please contact the manufacturer OO AD ESA 31 51 User s Manual 3 KEYBOARD MONITOR 3 1 INTRODUCTION This chapter describes the commands supported by the keyboard monitor program
62. dot appears at the right edge of the data field Table 3 2 defines some of register names the hexadecimal keyboards acronyms the abbreviations appearing in the address field of the display and the sequence in which the registers are displayed When the register contents are displayed with the data update prompt the contents of this register can be modified if desired To do this enter the new value from the keyboard This new value will be displayed in the data field and the register contents are updated when either the PREV or NEXT or EXEC key is pressed After examining and optionally modifying the contents if the EXEC key is pressed the command is terminated If the NEXT key is pressed contents of the next register according to the order shown in Table 3 2 are displayed and opened for modification Note that sequence is cyclic and thus pressing the NEXT key when the R7 is displayed will not terminate the command If the PREV key is pressed the contents of the previous register according to the order shown in Table 3 2 are displayed and opened for modification 5 When any of the registers RO R7 has to be examined press EXAM REG key and then BIT MEM key Now press keys 0 7 on the hexadecimal keypad which corresponds to register RO to R7 The displayed registers contents of RO R7 is with respect to the current bank selected The information as to which bank is the current bank can be found by examining the bits RSI RSO of
63. e 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 equivalents of the displayed data values are also shown on each line The non displayable characters are shown as periods Examples Example 1 To display the contents of 5 bytes from location 8000H gt MD8000 8004 0 1 2 3 4 5 6 7 8 9 B C D ASCH 8000 41 42 43 OD 31 ABC 1 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 PIDII address1 address2 destination address CR OPERATION 1 gt pa ESA 31 51 User s Manual 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 start address 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 the carriage return This operation moves the contents of memory locations from address1 to address2 to consecutive memory locations starting from the des
64. eady stored on the tape there is no need for the user to enter these values Connect the earphone of the recorder to EAR jack of the Tape Interface Hardware Position the tape well ahead of the approximate start of the desired file Now press the EXEC key and then press the PLAY key of the recorder The display will be dashes in all the digit positions while the search is on for the desired file As and when a filename is read by the system it is displayed on the address field When the specified file is found the type of memory and the file name is displayed on special and address fields of the display rd will be displayed on the data field of the display indicating that data is being transferred from the tape on to the memory As noted already the starting and ending addresses of the memory block are read from the tape itself After the data transfer a checksum also recorded on the tape during tape write is read and is compared with the checksum of the actual data transferred If they do not match or if the data transfer is not correct the system displays error message E r r and control returns to the monitor If the data is transferred without any errors control returns to the monitor which will display the command prompt EXAMPLE To read the contents of the file with the file name of 123F Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset TPRD Tape Read command 1 0001 2 0012
65. entry A dot appears at special field prompting the user to specify the type of memory 2 Press PRG MEM or EXT DATA key to select program memory or data memory 3 A dot appears at the address field for user to enter breakpoint address Enter the required breakpoint address 4 User can enter one or more breakpoint address by pressing NEXT key and address and terminate the command with EXEC key User can also specify a range of address to be cleared by pressing PREV key after entering the first address Two dashes appear at the data field to indicate range Enter the range s last address and press EXEC key to terminate or NEXT key to continue Example Following procedure clears breakpoint in program memory for range 0 to FFFFH Key Pressed Special Field RESET CLR BRK P 0 PREV uv Uu 3 4 4 2 FUNCTION Display Address Field ESA 0000 000F FFFF Data Field 51 Comments System Reset Enter the comamnd Enter the type of memory Enter the start address of range Enter the last Address of range Terminate the command This command is used to set breakpoint in program memory or data memory FORMAT SETBRK PRG MEM EXT DATA addr NEXT EXEC PREV lt range end addresss gt EXEC KER ESA 31 51 User s Manual 1 To use this command press SETBRK key when prompted for comma
66. equired capacity to ESA31 and turn on the power Power On Self Test will be done Following initialisations are also done registers will be initialised to reset condition of 8031 8051 Breakpoints in both program and data memory will be cleared and disabled Then appears the Sign On message as follows ESA 8051 Serial monitor V x y V x y indicates version x and revision y The sign on message is followed by the command prompt gt in the next line Now ESA31 is ready for operation in serial mode NOTE The keyboard display module will display Serial 2 2 2 NO RESPONSE IN SERIAL MODE If there is no response from ESA31 in serial mode after installing it as described in the previous section check the following items a Check RS 232 C cable connections at both the ends Appendix C describes the interface in detail b Check the power supply connections and voltage levels c Check the handshake signals of RS 232 C interface Ref Appendix C AD ESA 31 51 User s Manual d Check the baud rates of ESA31 and device connected to it e computer system is the controlling device check that the driver program is running the RS 232 C cable is connected to the correct port and the port is working f Check the configuration of ESA31 again DIP Switch settings NOTE DIP Switch status is read only at Power On Reset If you change the settings either press the RESET key or switch OFF an
67. er option E gt AD ESA 31 51 User s Manual OO 1 0 COMMUNICATION WITH A HOST COMPUTER SYSTEM 10 1 INTRODUCTION As already noted ESA31 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 communicate with ESA31 ESA provides both WINDOWS and DOS based communication packages which allow the user to establish a communication link between asynchronous serial ports of the computer COM1 COM2 and ESA31 The CD supplied along with the trainer with the trainer contains these packages The communication software packages fully support the commands of ESA31 Further they allow the contents of a disk file to be downloaded from the computer system into memory of ESA31 User can develop assembly language program on the PC cross assemble them using a suitable cross assembler and linker to generate HEX files that can be downloaded into ES 31 memory for execution Thus the extensive developmenmt facilities available on the PC can be used to supplement the facilities available on ESA 31 Further either of these packages allows uploading of data from memory of ESA31 to the computer The data so uploaded is saved in a disk file Thus this facility can conveniently be used to save user program as a HEX file 10 2 INSTALLATION Configure ESA31 for serial mode of operation and set the serial port of ESA31 for des
68. er s Manual 3 2 The system monitor utilizes 256 bytes of data memory from E000H to EOFFH as reserved area for system User programs should not disturb this area otherwise the results are unpredictable 3 3 KEYBOARD AND DISPLAY As noted already the display consists of 7 seven segment LED displays separated into three fields The left most single digit forms the special field next four digits form the address field and the last two digits form the data field The 36 key keypad consists of the following groups of keys a Hexpad 16 keys representing the hexadecimal digits 0 through In the use of the EXAM REG command some of these keys represent register names also as indicated by the legends on keytops This usage is further explained in the description of the EXAM REG command Further two of these keys serve the functions of command keys also The context of operation defines the meaning of the key b Command Group 13 command keys of which 2 keys DPBRK amp SERCH are delimiter keys also These commands are in addition to the two commands mentioned above c Memory Group 4 keys PRG MEM EXT DATA BIT MEM INT DATA to select the type of memory d System Operation Keys RESET BREAK and EXEC keys RESET key as already noted causes a hardware reset of the system BREAK can be used to stop the execution EXEC is used to invoke execution of commands and to terminate commands 3 4 MONITOR CO
69. ess Data Field Field Field RESET ESA 51 System Reset SINGLE STEP XXXX XX Current value of PC and the byte at this PC 8 0008 8 0088 0 0880 0 8800 8802 4 Instruction at 8000 is executed Next instruction to be executed 15 displayed NEXT 8803 dF Next instruction EXEC Command termination KER ESA 31 51 User s Manual NOTE Single step command disables the breakpoint in program memory and data memory 3 4 6 BLOCK MOVE COMMAND FUNCTION This command is used to move a block of data from one area of the memory to another area FORMAT BLKMOVE PRGMEM EXT DATA INT DATA Start addr NEXT end addr NEXT PRGMEM EXT DATA INT DATA dest addr EXEC OPERATION 1 To use this command press the BLK MOVE key when prompted for command entry When this key is pressed display field is cleared and prompts the user to enter type of memory 2 decimal point appears at the right edge of the special field Press PRG MEM EXT DATA or INT DATA key to select program memory external data memory or internal data memory 3 Now enter the starting address of the block of data to be moved Press the NEXT key Now the display field is cleared again and two decimal points appear at the right edge of the address field Now enter the ending address of the block of data to be moved Press the NEXT key Monitor prompts the user to enter destination type of memory by displaying a dot at the special field Enter the destination type
70. 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 locations 8200H and 8201H to complete the disassembly AD ESA 31 51 User s Manual Example gt Z 0 6 CR Address Object Mnemonic 0000 02 00 30 LJMP 0030H 0003 02 2A BE LJMP 2ABEH 0006 FF MOV R7 A gt 4 3 13 H HELP COMMAND FUNCTION The HELP command is used to list all the commands supported by the serial monitor FORMAT gt H lt CR gt OPERATION As soon as H and lt CR gt is 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 gt H lt CR gt Command Syntax Assemble A address Breakpoint B D PID I CIS PID address1 address2 Compare Memory address address2 address3 Disable Brkpnt D PID Enable Brkpnt E PID Fill Search MEM PIDII address1 address2 data data data data S Go Execution G address Help H Jump J address Load from Tape L filename Memory M J address address2 PIDII address3 N SS Count N count Single Step Count lt OFFH gt Register R register Single step S R address Write to tape W PID address1 address2 filename Z Disassembly Z address1 address2 U amp V Commands are reserved for system usage
71. h a string of data in program memory external data memory and internal data memory PIDII address 1 address2 data data data data S G Transfers the processor control from the monitor to user program breakpoints G address H Help List all the commands supported by the Serial Monitor H J Jump to address J address L Load data from tape Refer Chapter 7 M Modify Display Move memory contents in program memory external data memory and internal data memory with all combinations M address address2 PIDII address3 N Execute one or more instructions specified by user N count gt Programmer OO AD ESA 31 51 User s Manual 5 Execute one Instruction of user program S R address W Write data onto tape Refer chapter 7 Z Disassembler Z addr1 addr2 U amp V commands are reserved for system usage 4 3 1 M MODIFY MEMORY COMMAND FUNCTION The M Modify Memory command is used to examine the contents of specified memory locations Further if the locations are in RAM their contents can be altered if desired and block move contents of memory from program data internal memory to program data internal memory for all combinations FORMAT M address1 address2 PIDII address3 OPERATION 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 lo
72. haracters The string of characters will be displayed from program memory area or data memory area depending on the status of flag register bit FO If flag register bit 0 program memory will be selected If flag register bit FO 1 data memory will be selected 7 AUDIO INTERFACE 7 1 INTRODUCTION Audio tape is an economical large capacity non volatile storage medium During the program development the user can store the necessary information Programs and data on the audio tape and at a later point of time user can reload the saved information into the system memory This relieves the user from the burden of manually entering large volume of information every time the system is powered on Audio cassette recorder is an attractive solution as a back up storage device in comparison with the more versatile floppy disks primarily because of the low cost Any ordinary commercial tape recorder can be used The on board audio tape interface consists of the necessary hardware and software to allow the user to store data and read data from a commercial audio tape recorder The data is stored and read as named files 7 2 INSTALLATION The interface consists of two sockets one marked as MIC and other as EAR Refer the Component Placement Diagram in Appendix A Use any standard audio cable to connect MIC or EAR socket to the tape recorder 7 2 1 OPERATIONAL HINTS 1 Connect only one socket MIC or EAR at any t
73. he Keyboard Display unit s display fields continuously After programming the specified range the system displays 16 bit checksum and returns to sub menu Checksum 9 3 2 V COMMAND This command is used to verify the contents of an EPROM against a source The parameters 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 programmer sub menu If the verification fails a message and parameters 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 Then control returns to the EPROM programmer sub menu The user can abort to main menu by pressing ESC key Thus the operation of this command is quite similar to the operation of the P command except that here the EPROM is just verified not programmed 9 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 a
74. ight edge of the address field Enter the file name as a string of hexadecimal digits Any number of digits can be entered but the last 4 digits entered currently displayed in the address field are treated as valid After entering the filename press the NEXT key The display is cleared and a dot appears at the special field of the display Now enter the type of memory by pressing PRG MEM or EXT DATA key to select program memory or data memory as the case may be The display is again cleared with two dots at the right edge of the address field Now enter the starting address of the block of data to be transferred to the tape and press the NEXT key The display is again cleared with a dot in the address field Now enter the ending address of the block of data to be transferred to the tape After entering the ending address connect the microphone input of the recorder to the MIC jack of the tape interface hardware press PLAY and REC keys of the recorder and then press the EXEC key Now data is transferred onto the tape After writing the data the system records a checksum byte also During the transfer the type of memory in the special field name in the address field and st in the data field will be displayed to indicate that a file with the specific name is being stored onto tape After transferring the data control returns to the Monitor i ESA 31 51 User s Manual IMPORTANT NOTE If the recorder is not ready and if y
75. ime to tape recorder Connecting both the sockets permanently to the tape recorder may short circuit both the signal lines if the recorder common point connection is different from the convention followed in ESA31 i ESA 31 51 User s Manual 2 The volume and tone controls of your tape recorder may have to be adjusted to sufficiently high levels for reliable operation of this interface 3 The reliability of the recording can be increased by using a recorder and tape of good quality 4 The interface can accommodate normal variation in the tape speed Ensure that your recorder does not produce too significant changes in the tape speed 5 Avoid storing relatively large files If the file is really large split it into multiple files of smaller size Though this scheme reduces the utilization of the tape space it improves the chances of restoring the complete file correctly 7 3 OPERATION FROM THE KEYBOARD MONITOR The software allows the user to store data on the tape and read the recorded data from the tape as named files 7 3 1 STORING DATA ONTO TAPE TPWR command implements this facility Thus to invoke this facility press TPWR key when prompted for command entry After typing TPWR set the recorder in record mode and now enter the parameters as shown below Filename NEXT PRG MEMI EXT DATA starting address NEXT ending address EXEC OPERATION As soon as TPWR key is pressed the display is cleared with a dot at the r
76. inter connect RTS and CTS PIN 7 and 8 and DSR and DTR PIN 6 and 4 OO AD ESA 31 51 User s Manual APPENDIX D PRODUCT LIST i ESA 31 51 User s Manual APPENDIX INSTRUCTION SET i ESA 31 51 User s Manual
77. ired baud and No parity Refer sections 2 1 1 and 2 1 3 Then connect ESA31 to the host computer over the COM1 COM2 i ESA 31 51 User s Manual 10 1 serial port using a suitable RS 232 C cable Refer to Technical Manual of your system for details regarding the signal definition on COM ports The signal definitions of the RS 232 C port of ESA31 can be found in Appendix C i Installation procedure for WIN31 Insert the CD containing the driver software into the available drive of the computer To install the driver run SETUP EXE file contained on the CD The setup program will guide the user through the rest of the installation procedure Once the software is installed successfully the package offers a comprehensive online help for working with the commands ii Installation procedure for XT31 Insert the CD containing the file XT31 EXE into the available drive and directly run the program XT31 EXE This file may be directly copied to and executed from hard disk also Now the following message appears on the screen d Now the following message appears on the screen XT31 Version 1 4 ELECTRO SYSTEMS ASSOCIATES PVT LTD BANGALORE ALT S Set Communication Parameters CTRL F1 Help ALT F1 Command Help lt Esc gt Clear Command lt 1 gt Previous Command Character F3 Command Recall CTRL U Upload Command CTRL D Download Command Command Dos Shell Command ALT X P2 Exit Press any Key to Contin
78. isplay Enter the destination type of memory A decimal point appears at the right edge of the address field Now enter the starting address of the area into which the block of data is to be moved This address is called the destination address press the EXEC key to start the command execution The monitor now compares the data in the specified source block against the data in the destination block If no mismatch is detected in the entire address range specified the command is terminated and the command prompt is displayed If any mismatch is detected the source address and data are displayed and the system waits for user s input If user presses EXEC key the command is terminated and the command prompt is displayed If user presses the NEXT key the system proceeds with the comparison from the next location ERROR CONDITION 1 Specifying a value for the end address of the source block which is less than the value of the start address of the source block EXAMPLES Example 1 Using Examine Memory command enter the following data into memory locations 8800H to 8807 H 8800 00 01 02 03 04 05 06 07 Now use the block Move command to move this data into the destination block starting 8810H Now compare these two blocks of memory Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset COMP Compare command prompt for P P iun source start 8 P 0 0 0 8 type of memory 8 P 0 0 8 8 0
79. l 10 6 10 4 3 DOS COMMANDS At the command prompt gt any valid DOS command can be entered preceded by XT31 environment is saved and the DOS command is executed Then XT31 environment is restored and XT31 command prompt is displayed again 10 4 4 BOTTOM LINE During the session XT31 displays many of the XT31 commands at the bottom line in reverse video for the convenience of user The bottom line is displayed as Ctrl F1 Help Alt F1 CmdHlp Alt S Commn Esc ClrCmd Alt X Exit F1 4 10 4 5 COMMAND RECALL This feature facilitates recall of the commands already entered by the user upto a maximum of 16 commands Press F3 to recall the previous command the commands are kept in a circular buffer User may use Up arrow and Down arrow keys to traverse through the sequence of commands in backward or forward direction respectively in a circular fashion User may recall just the previous command character by character by pressing F1 desired number of times Current command being entered can be cleared by using lt ESC gt key any time before pressing CR 10 4 6 COMMUNICATION comn Baud Data Stop Parit int 5 port int 1 Rate int 2 Bits int 3 Bits int 4 y 7 0 1 0 0 0 1 0 1 2 3 4 5 6 Table 10 1 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
80. lays the message Loading data from file and begins loading data into memory As already noted the start and end addresses of the memory block are read from the tape itself Further the checksum byte recorded on the tape during Tape Write operation is also read This checksum byte is compared with the checksum calculated from the actual data read from the tape and if they do not match it 15 treated as error condition If the file is loaded without any errors it displays the message File loaded and control returns to the monitor If any errors occur either in read or in writing into the memory it displays the message Unable to write at memory location xxxx and control returns to the monitor xxxx is the memory location Example Read the contents of the file with filename 14B3 L 14B3 lt lt gt gt Searching file 14B3 Filename 14B3 Loading data from file File loaded V i ESA 31 51 User s Manual 7 5 DATA RECORDING FORMATS 7 5 1 BIT FORMAT Both 0 and 1 are recorded as combination of some high frequency 2KHz signals and some low frequency 1KHz signals as shown below n n s n n m gn Ua N 2KHz 8 Cycles 1KHz 2 cycles 6ms Biol n B n B E lt lt ___ _ _ _ 2KHz 4 Cycles 1KHz 4 cycles 6ms 7 5 2 BYTE FORMAT A byte is recorded as one start bit a zero 8 data bits and one
81. ld If the programming is unsuccessful the address of the failed EPROM location is displayed in the address field and EPROM data is displayed in the data field The system now waits for user input If user presses EXEC key control returns to the keyboard monitor If NEXT key is pressed the next failed location and its content are displayed 9 4 2 VRFY COMMAND This command is used to verify the contents of an EPROM against a source The parameters and their interpretation is completely similar to that of the PROG command Tf the verification is successful the 12 bit checksum is displayed in the address field i ESA 31 51 User s Manual Tf the verification fails u will be displayed in the special field the parameters at the failed location are displayed as in the PROG command i e EPROM address and data are displayed Now if EXEC key is pressed control returns to the Monitor If NEXT key is pressed the next failed location and its content are displayed Pressing any other key except RESET has no effect 9 4 3 BLNK COMMAND This command is used to check if a specified range in the EPROM is blank contains FF This command requires the following three parameters in that order EPROM Type Same as in PROG Command EPROM Start The absolute starting address of the EPROM EPROM End The absolute ending address of the EPROM The parameters must satisfy certain relatio
82. lope ADC 8 bit 16 channel ADC Dual DAC Logic Controller Crystal Clock Divider Traffic Lights RTC Tone Generator Stepper Motor Numerical Printer etc b 26 core ribbon cable connector set c Ni Cd batteries for battery backup SPECIFICATIONS MICROCONTROLLER 8031 8051 operated at 11 0592 MHz MEMORY Four 28 pin JEDEC sockets offer 120KB of memory as follows 32KB of firmware in one 27256 program memory 32KB of static RAM using one 62256 with optional battery backup as user program memory 56KB of static RAM as data memory using two 62256s with optional battery backup FIRMWARE Serial and Keyboard Monitors 1 pass Assembler 1 Pass Disassembler Package can be used in serial mode only Audio Tape Interface Driver Software Centronics Printer Interface Driver Software PERIPHERALS 8279 5 control 36 keys keyboard and 7 digit 0 5 seven segment LED display 8253 5 3 Programmable Interval Timers Timer 0 1 2 are available to the user 8251 A For serial communication supports all standard bauds from 110 to 19 200 Baud is selected through on board DIP Switch 8255 2 Two numbers available to user providing 48 programmable I O lines 8155 2 Used by the system to read DIP Switches to control centronics printer audio tape interface and the timer is used to generate baudclock for serial communication and 128 bytes of RAM is used as a scratch pad memory BUS EXPANSION STD bus compatible signals are av
83. m 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 the When this key is pressed the instruction at the current PC value is executed and then all the register values are displayed 3 execute one instruction at the desired value of PC enter SR and the desired starting address of the program and then press key 4 To execute instructions one by one there are two ways a Press key whenever you want to execute one instruction at a time In this case single stepping is totally under users control Each time key is pressed one instruction is executed To terminate the command press ESC key b Press space bar whenever you want to continuously single step a program Now single stepping will be continuous and when you want to stop and see registers press space bar again now single stepping is stopped At this stage you can continue single stepping by pressing space bar or execute one instruction at a time by pressing key or can terminate command by pressing ESC key JL ESA 31 51 User s Manual Example 1 Suppose program given as example to illustrate GO command has been entered in memory Now this program can be single stepped as follows gt SR 8800 CR A
84. mand entry Now enter the desired starting address of the program you wish to execute Enter Carriage Return Now command prompt reappears on the next line i ESA 31 51 User s Manual 4 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 address1 CR OPERATION To use this command enter G when prompted for command entry Execution starts from the PC value Now if you wish to modify the value of the PC i e the address to which control is to be transferred enter the new value Enter Carriage Return 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 breakpoint 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 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 addresses is useful when debugging a program section containing branch instructions EXAMPLE Enter the
85. n about user program is lost Note that in any case the contents of the user portion of the RAM area are not disturbed by the Monitor 4 There are two methods to break the user program execution a Set breakpoints at specific addresses and enable them b Press BREAK key When any of the specified enabled breakpoints is encountered control returns to the monitor which saves all the registers and displays the address where the program broke and the data at that address on the display It also displays the memory type in the special field It will display P if the program broke in the program memory or d if the program broke in the data memory Refer to section 3 4 4 for more details If BREAK key is pressed control returns to the monitor which saves all the registers and displays the address where the program broke and the data at that address on the display It will display U on the special field indicating that the program broke due to pressing of user break key Examples Example 1 Suppose the following program has been entered in the program memory by EXAM MEM command Location Object Code Mnemonic 8800 74 42 8801 42 8802 F9 8803 80 SJMP 8800H 8804 FB KER ESA 31 51 User s Manual To run this program press keys according to following sequence Key Pressed Display Comments Address Data Field Field RESET ESA 51 System Reset GO 0000 02 GO Command current PC and the byte
86. n are unaltered 3 4 2 EXAMINE MODIFY REGISTER COMMAND FUNCTION The examine register command is used to examine and optionally modify the contents of some of the 8031 8051 s registers FORMAT EXEM REG reg key Data NEXT PREV EXEC OPERATION 1 use this command press the EXAM REG key when prompted for a command Now the display is cleared amp rE is displayed in the address field Thus the next hexadecimal key pad entry will be interpreted as a register name if valid TABLE 3 2 PROCESSOR REGISTERS Register Name Display Register A A Register B b Stack pointer SP KER ESA 31 51 User s Manual Register Name Display Flags Register F Data pointer high dPH Data pointer low dPL Register THO tHO Register TLO tLO Register TH1 tH1 Register TL1 Register 1 P1 Register P3 P3 Program counter high PCH Program counter low PCL Register RO r0 Register R1 rl Register R2 12 Register R3 13 Register R4 r4 Register R5 r5 Register R6 r6 Register R7 r7 FORMAT OF THE FLAG BYTE F m KER ESA 31 51 User s Manual Dx m wm ow O Auxillary User Flag Bank Bank verflow User Flag Parity Flag Flag Carry Flag Select 1 Select 0 Flag Fig 3 1 FORMAT OF REGISTER When the hexadecimal key is pressed the corresponding register abbreviation is displayed in the address field and the contents of this register are displayed in the data field and a data update prompt
87. n connector J3 Used for implementing serial Communication Used for implementing keyboard display interface Reserved for system Reserved for system Parallel printer interface data To read the DIP switch status Printer interface and audio tape interface The Keyboard Display section of ESA31 is controlled by 8279 The port addresses are given in section 5 4 The 8279 is configured for the following operation mode Encoded scan keyboard with 2 key lock out 8 digits 8 bit left entry display The keyboard reading is implemented by polling the command status port of 8279 The codes assigned to the keys of the on board keypad are listed below Serial No ON AD ESA 31 51 User s Manual TABLE 5 3 Key 0 PRRD 1 P1 BLNK 2 PROG 3 P3 VRFY 4 SP S PSW Corresponding Code 00H 01H 02H 03H 04H 05H Serial No 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 6 PCH 7 8 DPTH 9 DPTL A TPRD B TPWR C THO D TLO E THI F TL1 SET BRK CLR BRK EABLE BRK DABLE BRK NEXT DPBRK PREV SERCH PRG MEM EXT DATA FILL COMP SINGLE STEP BLK MOVE EXAM REG EXAM MEM GO EXEC BIT MEM INT DATA Corresponding Code 06H 07H 08H 09H OBH 10 11 12 13 14 15 16 17 16 19H 1 1BH 1CH 1DH 1EH 1FH 20H 21H NOTE RESET and BREAK key
88. n the special field the address of the offending location is displayed in the address field and EPROM data is displayed ESA 31 51 User s Manual in the data field The system now waits for user input If EXEC key is pressed control returns to monitor If NEXT key is pressed the next offending location and its data are displayed 9 5 EXAMPLES Example 1 From keyboard read the contents of a 2732 EPROM into memory locations 8000H to SFFFH Key Pressed Display comments Address Data Field Field RESET ESA 51 PRRD 273 2 Pt Transfer command Type prompt NEXT 0000 PS EPROM Start NEXT OFFF PE EPROM End NEXT 0000 bS Buffer start 8 0008 bS 0 0080 bS 0 0800 bS 0 8000 bS EXEC 234 CS Successful transfer Checksum Return to monitor In keyboard mode if the user wants to know the 16 bit checksum only 12 bit checksum is displayed on the trainer the user may examine the external data memory locations MSB of the checksum is stored here and EOE2H LSB of the checksum is stored here Example 2 From Serial monitor program the contents of locations 8000H to 8FFFH into 2764 starting at 1000 B Blankcheck P Program V Verify E Exit Enter option P EPROM type 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 B Blankcheck P Program V Verify E Exit Ent
89. nd entry dot appears special field prompting the user to specify the type of memory 2 Press PRG MEM or EXT DATA key to select program memory or data memory 3 A dot appears at the address field for user to enter break point address Enter the required breakpoint address 4 User can enter one or more breakpoint address by pressing NEXT key and address and terminate the command with EXEC key User can also specify a range of address to be set by pressing PREV key after entering the first address Two dashes appears at the data field to indicate range Enter the last range address and press EXEC key Example Following procedure sets breakpoints in data memory for range 0 to and 1000H Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset SET BRK Enter the Command EXT DATA d Enter the type of memory 0 d 0000 Enter the starting PREV d address of range 4 000 Enter the last F d OOFF address of range NEXT d 1 0001 0 0010 0 0100 0 1000 Terminate command 3 4 4 3 DISPLAY BREAK FUNCTION This command is used to display breakpoint in program memory or data memory FORMAT DP PRG MEM EXT DATA NEXT EXEC KER ESA 31 51 User s Manual OPERATION 1 use this command press DP key when prompted for command entry dot appears at special field prompting the user to specify the type of memory Pre
90. nd the byte at this location is displayed in the data field To execute the one instruction at the current value of the program counter press the EXEC key When this key is pressed the instruction at the current PC value is executed the new value of user PC 15 displayed in the address field and its associated instruction byte is displayed in the data field Press NEXT key to continue single stepping To execute one instruction at the desired address enter the address and now press the EXEC key One instruction gets executed Press NEXT key to continue single stepping To terminate command press the EXEC Key Note that after terminating the SINGLE STEP Command if you again press the SINGLE STEP key control returns exactly to the point where you pressed the EXEC key To single step a program with count first press SINGLE STEP key Now enter the desired starting address of the program and press NEXT key Now a dot appears at the right edge of the data field prompting the user to enter the count Enter the count 00 to FF and press EXEC key Now as many instructions as specified by the count get executed and the user can either continue stepping with count by pressing NEXT key or can terminate the command by pressing EXEC Key EXAMPLES 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 Key Pressed Display comments Special Addr
91. nds for program development debugging However several features of ESA31 like on line assembler disassembler etc are available only in the serial mode of operation The selection of the desired mode of operation is done as follows Switch 4 of the DIP Switch Operational Mode OFF Hexadecimal Keyboard Mode ON Serial Mode factory installed option Chapter 3 describes the commands available in keyboard mode and chapter 4 describes the commands available in serial mode i ESA 31 51 User s Manual 2 1 2 PRINTER ENABLE DISABLE ESA31 firmware includes the driver program for centronics compatible parallel printer interface This driver can be enabled disabled as shown below Switch 5 of the DIP Switch Printer driver OFF disabled ON enabled factory installed option Chapter 8 describes the parallel printer interface in detail 2 1 3 BAUD RATE SELECTION In the serial mode of operation ESA31 configures the on board 8251A USART as follows asynchronous mode 8 bit character length 2 stop bits parity Timer of the on board 8155 2 provides the transmit and receive baud clocks for the USART Refer chapter 5 for a detailed discussion of the hardware This timer is initialised by the system firmware to provide proper baud clock based on the settings of the DIP Switch at the time of Reset or Power On as shown below Baud Rate Selection S3 S2 S1 Baud Rate ON ON ON 110 ON ON OFF 300 ON O
92. ng address KER ESA 31 51 User s Manual of block Press the NEXT key Monitor displays a decimal point at right edge of the address field Now enter the constant Press the EXEC key to start the command execution 3 Monitor now fills the block of memory from start address to end address with the speficied constant Then the monitor displays the command prompt sign ERROR CONDITIONS 1 Specifying a value for the end address of the source block which is less than the value of the start address of the source block 2 Trying to fill data in non existent or ROM area Example Filling the block of program memory from 8800H to 880FH with a constant 55H Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset FILL Fill command P P pu Type of memory 8 P 000 8 Start address 8 P 008 8 0 0 8 8 0 0 P 8 8 0 0 NEXT P 8 P 0008 End address of block 8 P 0 08 8 0 P 0880 880F NEXT 880 i 5 P 88 0F 05 Constant value 5 P 880F 55 EXEC Block filled Command prompt Now using the EXAM MEM key observe the contents of the locations 8800H to 880FH and observe the data to be 55H KER ESA 31 51 User s Manual 3 4 9 SEARCH COMMAND FUNCTION This command is used to search a block of memory for a string of data upto 4 values FORMAT SERCH PRG MEM EXT DATA INT DATA start addr NEXT end addr NEXT datal NEXT data2 NEXT data3 NEXT data4 EXEC OPERATION
93. ns as explained in the section 9 4 3 on B command Once valid parameter values are available the EPROM is checked for blank state in the specified range the EPROM is blank in the specified range the message PAS is displayed in the address field and control returns to the Keyboard Monitor Otherwise b is displayed in the special field the address of the first non blank location is displayed in the address field and the EPROM data is displayed in the data field The system now waits for user input If EXEC is pressed control returns to the monitor If NEXT key is pressed the next non blank location and its contents are displayed 9 4 4 PRRD COMMAND This command is used to transfer the contents of the EPROM into the memory space of ESA 31 This command requires the following four parameters in that order Type Same as in PROG command EPROM Start Same as in Blank check command EPROM End Same as in Blank check command BufferStart Starting address in ESA 31 memory space These parameters must satisfy certain conditions as explained in the section 9 3 4 on command Once correct parameter values are available the system reads the EPROM and transfers the contents to successive locations starting from the specified Buffer start The EPROM address and data are displayed in address and data fields respectively If the transfer is successful a 12 bit checksum is displayed Otherwise r is displayed i
94. ntents of all CPU registers and flags are affected If Reg 0 no dot if Reg B 1 2 No of dots in the data field AD ESA 31 51 User s Manual 0255 OUTPUT 0170H CLEAR 02A2H RDKBD Outputs a string of 7 characters to display The parameters for this routine are as follows Reg DPTR Starting address of string of characters The string of characters will be displayed from program memory area or data memory area depending on the 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 Clears the display This routine blanks the entire display field Reads keyboard This routine waits until a character is entered from the system keyboard and upon return it places the character in the register The register A and F F s are affected 6 2 SERIAL MONITOR ROUTINES ACCESSIBLE TO USER Calling Address Mnemonic 16E2H GETCH 160EH SOUTPT 164BH DISPM cr AD ESA 31 51 User s Manual Function Description Gets one character from the USART input parameters None Output A Character ASCII received from USART Reg A and flags are affected Outputs one character to the USART Inputs A Character ASCII to be output to USART Reg A and flags are affected 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 c
95. o ESA31 While the downloading is going on the system will display the following message Downloading in progress xxx After downloading is system returns the command prompt of ESA31 It also displays the starting address of each record being downloaded 10 4 2 UPLOAD OPERATION This feature allows uploading of the data from the memory of ESA31 to the computer system and save the data in the specified disk file in INTEL 8 Bit HEX format To perform upload operation type Ctrl U in response to the command prompt gt The system will now prompt for the name of the disk file into which the 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 Append Select the first option by pressing Y to overwrite the contents of the existing file Pressing lt 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 follows AD i ESA 31 51 User s Manual 10 5 Memory Type PID The user has to enter P or D depending on whether program has to be uploaded to program or data memory Now the system will prompt for the starting address of the program as follows Start Address
96. 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 880E 55 CR Now you can use the M command to examine the block of memory to see that it is filled with the constant 55H i ESA 31 51 User s Manual 4 3 5 COMPARE MEMORY COMMAND FUNCTION Compare command can be used to compare the contents of one memory block with the contents of another memory block FORMAT C 1 of block 1 address2 of block1 PIDII address of block 2 CR OPERATION 1 To use this command enter C when prompted for command entry and select the type 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 comma and then the starting address of the second block followed by the Carriage Return 2 The monitor now compares the contents of location beginning at address of block1 with the contents of location beginning at addressl of block2 This process continues till the contents of address2 are compared with those of the corresponding location in the 2nd block Any differences detected are displayed Examples 1 Compare the contents of memory locations 8000H to SFFFH with those of a memory block beginning at 9000H gt CP8000 SFFE P9000 CR gt This response showed that there is no mismatch 2
97. on NEXT P 0001 00 Next location and its contents NEXT 0002 30 Next location and its contents PREV P 0001 00 Previous location and its contents EXEC Command termination prompt Example 2 Examine and modify the contents of memory location 8DOOH Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset EXAM MEM Examine Memory Command PRG MEM P Type of memory 8 0008 D P 008d Memory location to be examined amp modified 0 P 0840 0 8400 NEXT P 8d00 XX Contents of this location A P 8d00 0A New data to be entered F P 8d00 AF EXEC Command termination prompt after updating the data KER ESA 31 51 User s Manual To check that data was updated successfully press EXAM MEM key program memory as option and enter memory address 8DOOH and note that AF is displayed in the data field when NEXT key is pressed Example 3 Trying to modify ROM location Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset EXAM MEM Examine Memory Command PRG MEM P Type of memory A P 000A Address of location to be examined NEXT P 000A FF contents of location 7 P 000A F7 A P 000A 7 New data to be entered NEXT Err Error message You tried to modify the contents of a Read Only Memory location Hence the error message along with command prompt character was displayed You can repeat the above sequence of keys to see that the contents of this locatio
98. ones described for P command The starting and ending addresses of the EPROM must satisfy the relations described for the B Blank check command After the optional modification of the parameters the contents of the EPROM in specified range are transfered into ESA31 memory starting at the specified Buffer starting address The EPROM addresses and data read are displayed in the Keyboard Display unit s address and data fields respectively During the transfer as each byte is written into memory it is read back and verified If the write is successful for all the locations a 16 bit checksum is displayed and control returns to the sub menu i ESA 31 51 User s Manual If an error occurs during transfer 1 unsuccessful write into a location the following message is displayed Read fails 9 XXXX where XXXX 1s the address of the location where write failure occured Then control returns to the Serial Monitor 9 4 OPERATION FROM THE KEYBOARD MONITOR The Keyboard of ESA 31 has four keys which can be used to invoke the functions of the EPROM Programmer System The keys and their functions are Key Function PROG Program an EPROM VRFY Verify an BLNK Blank check an PRRD Read an Parameter Entry The following information is common to all the commands Whenever a parameter entry is required the system will display a message in the data field which indicates the type of parameter to be
99. ou press the EXEC key data would be sent out from the interface and this data would not be recorded on tape Hence ensure that the recorder is ready and in record mode before pressing the EXEC key Example To store the contents of locations 8000 80FF on tape with a file name 123F Key Pressed Display Special Address Field Field RESET ESA TPWR 1 00 0 1 2 00 1 2 3 01 2 3 1 2 3 NEXT P P 8 P 0 0 0 8 0 P 0 0 8 0 0 P 0 8 0 0 0 P 8 0 0 0 NEXT P 8 P 0008 0 P 0080 080F 8 123FSt KER ESA 31 51 User s Manual Data Field 51 Comments System Reset Tape write command Filename 123F Type of memory Prompt for starting address Start address8000H Prompt for ending address Ending address80FFH Connect the microphone of the recorder to MIC Press REC and PLAY keys of the recorder Data is being recorded on the tape Display is all dots control returns to Monitor after completing the transfer 7 3 2 READING DATA FROM TPRD command implements this facility Thus to invoke this facility press TPRD key when prompted for command entry After pressing TPRD enter the desired filename followed by EXEC Then set the recorder in PLAY mode TPRD Filename EXEC OPERATION As soon as TPRD key is pressed the display is cleared with a dot at the right edge of the address field The user must now enter the desired filename As starting and ending addresses are alr
100. pabilities of ESA31 oO AD ESA 31 51 User s Manual 5 11 CONNECTOR DETAILS There are six connectors on ESA31 in addition to the power connector 16 Of these J1 and J2 are 26pin I O connectors for 8255 ports J5 is the system connector providing address data and control signals and 14 is the user expansion providing additional signals for system expansion J3 is the printer connector providing centronics parallel printer interface J7 is the RS 232 C serial connector The signal definitions on all these connectors are listed below This information is available in Appendix B also PORTS CONNECTOR PIN NO SIGNALS PIN NO SIGNALS W N J2 PORTS CONNECTOR PIN NO SIGNALS PIN NO SIGNALS 1 2 3 4 5 6 7 8 9 10 11 W N AD Do ESA 31 51 User s Manual 5 7 OO J3 PRINTER CONNECTOR PIN NO SIGNALS PIN NO SIGNALS STROBE DATA 0 DATA 1 DATA 2 DATA 3 DATA 4 DATA 5 DATA 6 DATA 7 NC BUSY NC NC S Q Q t 2 5 Z 5 99999999 Z 34 8751 USER EXPANSION CONNECTOR PIN NO SIGNALS PIN NO SIGNALS P0 0 P0 2 P0 4 P0 6 P1 0 P1 2 P1 4 P1 6 P3 0 P3 2 INT P3 4 P3 6 WR P2 0 P2 2 P2 4 P2 6 ALE NC 45V GND ESA 31 51 User s Manual 15 SYSTEM EXPANSION AND TIMER CONNECTOR PIN NO SIGNALS i ESA 31 51 User s Manual
101. pe 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 starting address of the program as follows Start Address Enter the starting address followed by lt CR gt A maximum of four hex digits are allowed for the starting address Now the system will prompt for the ending address as follows AD Do ESA 31 51 User s Manual 10 4 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 to enable the file to be downloaded to the desired address range For Example if the starting address of a file is 8000 and Ending address is 80FFH and if the user wishes to download it to an address range starting at the user has to enter an offset value of CO00H 8000H 4000H 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 will read the file gather the data in the specified address range reformat the data for compatibility with the protocol required by ESA31 and send the data t
102. r 256 bytes file the number of files stored will increase and total data storage capacity may fall to about 40K bytes i ESA 31 51 User s Manual 9 PARALLEL PRINTER INTERFACE 8 1 INTRODUCTION ESA31 trainer supports centronics compatible parallel printer interface The interface makes use of BUS Y 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 8155 is made use of to implement this interface 8 2 INSTALLATION To install the printer interface a Switch OFF the power supply b Connect one end of the printer cable to J3 25pin D type connector of ESA31 Refer the component layout diagram in Appendix A to locate the connector J3 c Connect the other end of connector to the printer d Configure the 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 SW5 of the on board DIP Switch to ON position f Switch on the power to the printer and ESA31 NOTE The necessary printer cable could be obtained from Electro Systems Associates P Ltd as an OO AD ESA 31 51 User s Manual optional accessory However connector details are given in section 8 5 and user can make use of these details
103. rify that the code has indeed been moved into the destination block NOTE BLOCK MOVE moves a block from one area to another area It does not consider whether the block being moved consists of program code or data Thus no relocations of program code occurs and the block is simply moved The system determines if the destination block overlaps the source block It moves the data from either the starting address or from the ending address as required when overlap exists 3 4 7 COMPARE COMMAND FUNCTION This command is used to compare two blocks of memory FORMAT COMP PRG MEM EXT DATA INT DATA Start addr NEXT end addr NEXT PRG MEM EXT DATA INT DATA dest addr EXEC 1 To use this command press the COMP key when prompted for command entry when this key is pressed display field is cleared and prompts the user to enter type of memory A decimal point appears at the special field press the PRG MEM EXT DATA or INT DATA key to select program memory external data memory or internal data memory N KER ESA 31 51 User s Manual Now enter the starting address of the block of data to be compared Press the NEXT key Now display field is cleared again and two decimal points appears at the right edge of the address field Now enter the ending address of the block of data to be moved Press the NEXT key Monitor clears the display field and prompt the user to enter destination type of memory by displaying a dot at the left most d
104. s are not connected to keyboard controller Display Drive The segment drive outputs of 8279 AO through A3 and BO through B3 form a single 8 bit parallel output driving the display element segments The correspondence between the data bus segment outputs of 8279 and the display element segments is shown below AD i ESA 31 51 User s Manual 5 4 Display Segment Control CPU D7 04 D3 DATA BUS 8279 A2 Al OutPut Segment enabled Bit 1 Corresponding segment is ON d dp 0 Corresponding segment is OFF Display segments Example display the data format requires that segment a f g e and d should be ON and other segments should be OFF So the data should be 1001 0111 97H Display codes for other patterns can be worked out similarly Display Position To display characters in the address field 8279 must be instructed to start from display position 0 by sending 90H to the command port of 8279 and to display characters in the data field 8279 must be instructed to start from display position 4 by sending 94H to the command port of 8279 5 6 PROGRAMMABLE INTERVAL TIMER ESA31 has an on board programmable interval timer 8253 5 at socket position U13 Its I O addresses can be found in Table 5 2 in section 5 4 8253 has one command status port and three data ports called Timer0 Timer1 and Timer2 to provide three programmable timers the timers are available for
105. ss PRG MEM or EXT DATA key to select program memory or data memory The first address is displayed in the address field Two dashes appear in the data field and dot in the address field if the breakpoint is a range of addresses with starting address displayed in the address field Press NEXT key for the next breakpoint address or last address of the range Terminate the command with EXEC key or the command gets terminated if no more breakpoinnts are found Example Following procedure displays breakpoints in data memory Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset DPBRK Enter command Enter the type of memory EXT DATA d 0000 Starting address of range NEXT d OOFF Ending address of range NEXT d 1000 EXEC Terminate the command 3 4 4 4 DISABLE BREAK FUNCTION This command is used to disable the breakpoints which are previously set FORMAT DABLE BRK PRG MEM EXT DATA NEXT PRG MEM EXT DATA EXEC OPERATION 1 To use this command press DABLE BRK key when prompted for command entry 2 dot appears in the special field prompting the user to enter the type of memory 3 Press PRG MEM or EXT DATA key to select program memory or data memory 4 Press EXEC key KER ESA 31 51 User s Manual Example Following procedure disables program and data memory breakpoints Key Pressed Display Comments Special Address Data Field Field Field RESET ESA
106. t 11 3 Program to perform Division of 2 numbers Execute the program either in KEYBOARD mode or in SERIAL mode Taking 2 numbers in 9000 amp 9001 Data Memory After division operation store the result in 9002 amp 9003 Data Memory ADDRESS OBJECT MNENOMIC COMMENTS 8000 90 90 01 MOV DPTR 9001 Keep Data in 9000 amp 9001 Data Memory location 8003 E0 MOVX A DPTR 8004 F5 FO MOV OFO0 A i ESA 31 51 User s Manual 11 2 ADDRESS OBJECT MNENOMIC COMMENTS 8006 90 90 00 MOV DPTR 49000 8009 EO MOVX A DPTR 800A 84 DIV AB Perform division operation 800B 90 90 02 MOV DPTR 9002 Store the result in 9002 amp 9003 Data Memory 800E FO MOVX DPTR A 800F A3 INC DPTR 8010 E5 FO MOV A 0F0 8012 F0 MOVX DPTR A 8013 75 MOV 0A0 80EI 8016 78 02 MOV R0 402 8018 E2 MOVX A RO 8019 20 E3 03 JB OE3H 801F Check for Dip Switch 801C 02 00 00 LJIMP 0 Jump to SER Monitor 801F 02 04 FD LJMP 04FD Else to be K B Prompt 11 4 Program to Display ELECTRON SYSTEMS ASSOCIATES PVT LTD BANGALORE on the console Execute this program in SERIAL mode only DISPM EQU 164BH ADDRESS OBJECT MNENOMIC COMMENTS 8000 C2 05 CLB 005 8002 90 80 50 MOV DPTR 8050 Keeping the Data in 8050 Program Memory 8005 12 16 4B LCALL 164B Routine to display string of characters to console 8008 02 00 00 LJMP 0 0 1 2 3 4 5 6 7 8 9 D E F 8050 20 20 20 20 20 OA 20 20 20 20 20 45 4 45 43 54 8060 52 4F 20 53
107. te at the addressed memory location will be displayed in the data field and a decimal point a dot appears at the right edge of the data field indicating that data may be updated If the contents of the addressed memory location are only to be examined press the EXEC key to terminate the command or press the NEXT key to examine modify the next consecutive memory location or the PREV key to examine modify the previous memory location To modify the contents of an addressed memory location enter the new data from the keypad note that data values are evaluated modulo 256 However this new value displayed in the data field is not entered into the addressed memory location till NEXT or EXEC or PREV is pressed ERROR CONDITIONS Error conditions occurs while attempting to modify a non existent or Read Only Memory ROM location Note that the error is not detected until the PREV or NEXT or EXEC key is pressed When an error is detected the characters Err are displayed along with the command prompt character in the address field Uo ESA 31 51 User s Manual EXAMPLES Example 1 Examining a series of memory locations starting from OOOOH the start of keyboard monitor Key Pressed Display Comments Special Address Data Field Field Field RESET ESA 51 System Reset EXAM MEM Examine Memory Command PRG MEM P Enter type of memory 0 P 0000 First memory location to be examined NEXT P 0000 02 Contents of this locati
108. the last section of this chapter for connector details 5 9 PROGRAMMABLE INPUT OUTPUT AND TIMER ESA31 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 Port A Port B Port C command port and two 8 bit registers to load counter for timer The Port A of the 8155 is configured as output Port to provide data for printer interface The Port B is configured as input Port The 0 5 are used to read the DIP Switch of the trainer The Port B bit is used as busy signal for printer interface The B7 bit inputs from an EAR socket for Audio Tape interface The Port C is configured as output port The CO bit gives strobe for printer interface The bit C1 is used to send data for audio tape interface The Timer in is fed with clock generated by crystal clock generator of 1 5MHz The timer out of the 8155 gives baud clock for serial communication with respect to DIP Switch setting VECTOR ADDRESS LOOK UP TABLE FOR INTERRUPTS Function Interrupt Vector Trainer Source Address Address External Interrupt 0 IEO 0003H 2CBOH Timer Interrupt 0 000BH External Interrupt 1 0013H FFF3H Timer Interrupt 1 TFI 001BH FFF6H Serial Interrupt RI amp TI 0023H FFF9H 5 10 BUS EXPANSION ESA31 permits easy expansion of the system by providing all the necessary signals on two connectors 14 and J5 The signals are STD bus compatible and thus user can easily expand the ca
109. the mnemonic operation code for the 8031 instruction to be performed Operand Field The operand field identifies the data to be operated on by the specified opcode Some instructions require no operands Others require one two or three operands As a general rule when two operands are required as in data transfer and arithmetic operations the first operand identifies the destination or target of the operation s result and the second operand specifies the source data and the two operands must be separated by a comma Examples gt 8000 CR Address Opcode Mnemonics 8000 E9 MOV A R1 CR 8001 74 42 MOV A 42H CR 8003 lt ESC gt gt 4 3 12 Z 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 the user to understand verify the program OPERATION To use this facility type Z when prompted for command by the Serial Monitor gt Z 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 Q The disassembly can be aborted at any time by pressing Esc key NOTE If the disassembly of the last instruction requires reading of data from locations beyond the specified address2 the system will read them to complete the disassembly For
110. tination address The system determines if there is any overlap between source and destination blocks and accordingly transfers the data beginning either at the 4 1 or at the address2 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 locations Examples Example 1 Move the contents of the locations 800H through 80FH to the memory block beginning at 8840H gt 800 80F P8840 lt CR gt Example 2 gt MP800 80F P200 lt CR gt error An attempt to move data into PROM locations produces the error message 4 3 4 F FILL MEMORY COMMAND FUNCTION This command is used to fill a block of memory with a specified constant FORMAT F PIDII address address2 constant lt CR gt OPERATION 1 To use this command enter 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 Carriage Return key to start the command execution 3 Monitor now fills the block of memory from address to address2 with the specified constant Then the monitor displays the command prompt sign ERROR CONDITIONS 1 Specifying a value for address2 of the source block which is less than the value of the address
111. ttempting 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 a new value followed by Carriage Return or simply enter Carriage Return 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 9 1 ii Buffer end address must be greater than or equal to the Buffer start address i ESA 31 51 User s Manual iii The EPROM must have enough space to accomodate all bytes specified by the Buffer start address and Buffer end address In other words the following relation must be satisfied EPROM Start Buffer end address Buffer start address lt Highest absolute address of the EPROM For example suppose EPROM type is 2764 Then its highest absolute address is 1FFF Suppose the other parameters are as follows Buffer Start 8000 Buffer End 9OFFF EPROM Start 100 Then 100 9FFF 8000 20FF gt 1FFF So this combination of parameters is invalid After user enters the parameter values the above mentioned constraints are checked and if any of the constraint is violated it displays a message invalid parameter s entered and returns to the sub menu However if the EPROM type entered is invalid it immediatel
112. ttom row 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 The devices supported by the system and the type number to be entered by the user are listed below Device Type number to be entered by the user 2716 25V 2716 27C16 25V 2716 2732A 21V 732A Device Type number to be entered by the user OAD JL ESA 31 51 User s Manual 27C32A 21V 732A 27C32 25V 2732 2732 25V 2732 2764A 12 5V 764A 27C64D 12 5V 764A 27C64 21V 2764 2764 21V 2764 27128A 12 5V 128A 27 128 12 5V 128A 27128 21V 0128 27256 12 5V 0256 27C256 12 5V 0256 27C256 21V 2256 27512 12 5V 0512 The device selection is totally software controlled and no hardware changes or jumper settings are necessary for selecting any of the above listed devices 9 2 INSTALLATION PROCEDURE a Turn OFF power to ESA31 trainer b Attach the hardware module EPROM Programmer Interface to ESA 31 over connector J2 using 26 core ribbon cable supplied with the module c Connect black yellow and blue wires coming from the four pin polarised connector on the programmer module to corresponding power supplies as shown below colour of the wire supply to be connected BLACK GND YELLOW 12V BLUE 30V d Power ON the system 9 3 OPERATION FROM SERIAL MONITOR Enter P when prompted for command entry Then system enters EP
113. ue AD i ESA 31 51 User s Manual 10 2 XT31 checks for presence of communication ports 1 amp 2 If both ports are not available it will display the message No serial port present as reported by BIOS and exits to DOS Otherwise XT31 will read the communication parameters from file XT31 INS and initializes the communication port XT31 searches current directory for file XT31 INS If search fails it will search the path given by the DOS environment variable INIT If the file is not present following message is displayed XT31 INS is not found Serial parameters are set to COM1 9600 8 2 None Do you want to change Yes No If option is selected the communication parameters Serial Port COMI 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 10 4 6 Now XT31 attempts to establish communication between the computer and ESA31 If successful the command prompt gt appears on the screen Subsequently during the power on or RESET of the training the sign on message ESA 8051 SERIAL MONITOR appears on the screen followed by command prompt gt The word SERIAL will be displayed on the trainer s keyboard display Otherwise it will display the message Unable to transmit data Retry or Ignore If ESA31 is not powered on power it on and press lt R
114. ur parameters depending on the particular command being used When more than one parameter is required a single lt or space is used between the parameters as a separator i ESA 31 51 User s Manual A command is terminated by a Carriage Return Commands are executed one at a time and only one command is allowed within one command line PARAMETER ENTRY numeric parameters are to be entered as hexadecimal numbers 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 parameters is 0000 to FFFF and longer values are evaluated modulo 64K i e only the last four digits are valid All the commands except the R 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 Error is displayed on the next line with a sign attached pointing to the place where the error occured and a new command prompt is issued The possible error conditions are described while illustrating the individual commands Command execution occurs only after
115. y 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 OFFH in the required zone It displays the message Blankcheck in progress If the EPROM is not blank the following prompt appears EPROM is not blank Continue programming Y N If user types N the command is aborted and control returns to command prompt of the Serial 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 can support it 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 i ESA 31 51 User s Manual If the programming is unsuccessful the following information is displayed Programming failed XXXX YY Where XXXX is the EPROM address where programming failed and YY is the data at that location on EPROM NOTE During programming and verification from serial mode the location in EPROM and the corresponding data that is being programmed are displayed in t

Download Pdf Manuals

image

Related Search

Related Contents

www.pce-iberica.es    Philips ID5552B    Instructions.  télécharger le programme 15/16  Leica S2 Operating Instructions    QUIP 1000  

Copyright © All rights reserved.
Failed to retrieve file