intel MCS BASIC-52 — Intel MCS BASIC-52 Versions 1 & 1.1 Operating and Reference Manual PDF

int e l 4.37 DESCRIPTION OF STATEMENTS STATEMENT: PGM MODE: COMMAND AND/OR RUN TYPE: INPUT/OUTPUT The PGM statement gives the user the ability to program an EPROM or EEPROM while executing a BASIC program. The PGM statement requires that the user set up internal memory locations 18H (24D), 19H (25D), 1AH (26D), 1BH (27D), 1EH (30D) and 1GH (31D). Note that these internal memory locations are normally reserved for the user!! The User must initialize these internal memory locations with the following: EXAMPLE:

LOCATION CONTENTS 1BH:19H THE ADDRESS OF THE SOURCE INFORMATION THAT IS TO BE (27D:25D) PROGRAMMED INTO THE EPROM ъ LOCATION 19H IS THE LOW BYTE AND LOCATION 1BH IS THE HIGH BYTE 1AH:18H THE ADDRESS - 1 OF THE EPROM LOCATION(S) THAT ARE TO (26D:24D) BE PROGRAMMED, LOCATION 18H IS TH LOW BYTE AND LOCATION 1AH IS THE HICH BYTE 1FH:1EH THE NUMBER OF 8YTES THAT THE USER WANTS TO PROGRAM (31D:30D) LOCATION 1EH IS THE LOW BYTE AND LOCATION 1FH IS THE HIGH 8YTE The user must also initialize the width of the desired EPROM programming pulse and store the value in internal memory locations 40H (64D) (high byte) and 41H (65D) (low byte).

The reload for a 50 millisecond EPROM programming pulse is calculated as follows: 10 REM R = RELOAD VALUE. W = WIDTH IN SECONDS (50 MILLISECONDS) 20 W = .05 30 R = 65536 - W * XTAL/12 40 DBY(40H) = R/256 50 DBY(41H) = R .AND. 0FFH In addition, the user must also SET or CLEAR BIT 38.3 (26.3H) to select the INTELligent EPROM programming algorithm. The Bit is SET to select INTELligent programming and CLEARED to select the normal 50 millisecond algorithm. To SET the BIT, execute a DBY(38) = DBY(38) .OR. 8H Statement, to CLEAR the BIT, execute a DBY(38) = DBY(38) .AND. 0F7H instruction. - 72 -