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

int e l 9.8 RESOURCE ALLOCATION Specific statements in MCS BASIC-52 require the use of certain hardware features on the device. If the user wants to use these hardware features for interrupt driven routines, conflicts between BASIC and the assembly language routine may occur. To avoid these potential conflicts, the programmer needs to know what hardware features are used by MCS BASIC-52. The following is a list of the COMMANDS and/or STATEMENTS that use the hardware features on the 8052AH. CLOCK1 -- uses TIMER/COUNTER 0 in the 13 bit 8048 mode.

PWM -- uses TIMER/COUNTER 1 in the 16 bit mode LIST# -- uses TIMER/COUNTER 1 to generate baud rate in 16 bit mode PRINT# -- same as LIST# PROG -- uses TIMER/COUNTER 1 for programming pulse ONEX1 -- uses EXTERNAL INTERRUPT 1 In addition, TIMER/COUNTER 2 is used to generate the baud rate for the serial port. What the preceding list means is that if CLOCK1, PWM, ONEX1, LIST#, PRINT#, and PROG commands/statements are used by the programmer, the user MAY NOT use the associated TIMER/COUNTER or EXTERNAL INTERRUPT pin for an assembly language routine. MCS BASIC-52 initializes the TIMER/COUNTER modes by writing a 244 (0F4H), 16 (10H), and 52 (34H) to the TCON, TMOD, and T2CON registers respectively.

These registers are initialized only during the RESET initialization sequence, and MCS BASIC-52 assumes that these registers are NEVER changed. So, if the user changes the contents of TCON, TMOD, or T2CON, something funny and/or disastrous is bound to happen if the Statements/Commands listed above are executed. If the user does not execute any of the previously mentioned Statements or Commands, the user is free to use the interrupts in any way suitable to the application. - 131 -