Rev. 0 / 1985-07-08 CASE Program Initialization initialize port 3 alternate functions (P3 = CBH) read memory location for interrupt from CPU (= reset interrupt) read memory location for interrupt to CPU (= reset interrupt) initialize two port 1 pins to enable reading interrupts to/from CPU reset all RAM cells from 00H - 7FH if necessary, reset RAM 80H - FFH except 80H, 90H, A0H, and B0H initialize stack pointer set serial port to mode 3 and multiprocessor comm (SCON = E0H) set double baud rate (PCON = 80H) set timer 0 to mode 2 to control timeout and polling frequency and timer 1 to mode 2 to be a baud rate generator (TMOD = 33H) set baud rate to 38.4 kBaud (TH1 = FFH, which provides that the oscillator frequency is 7.3728 MHz) set timer 0 to produce 0.4 ms time elements (TH0 = 0BH) set upper polling freq limit to default value 30 Hz (= load 53H into upper polling frequency limit register) set lower polling freq limit to default value 10 Hz (= load FAH into lower polling frequency limit register) set start reception timeout time to default value 4 ms (= load 0AH into start reception timeout time register) set byte-to-byte timeout time to default value 2 ms (= load 05H into byte-to-byte timeout time register) * RAM test (similar to that for trackball) * ROM test ( -"- ) enable timers (TCON = 50H) enable timer 0 interrupt (IE = 82H) enter scan loop END Program Initialization