Download Alphanumeric LCD infrared control via computer`s parallel port
Transcript
RET CLEAR_LCD: CLR RS MOV DATO,#01h SETB EN CLR EN LCALL WAIT_LCD RET WRITE_TEXT: SETB RS MOV DATO,A SETB EN CLR EN LCALL WAIT_LCD RET END Main This is where program starts. The tag takes care of calling the sub-methods of INIT_LCD and CLEAR_LCD and then transfers the control of the program to the STDBY tag. Stdby The instructions that follow this tag are performed in a cycle, since the main task of the program after the LCD has been initialized is to wait for a character to be received and then to send it to the module. The first instruction (MOV A,READ) reads the data from the READ port to the Accumulator. Then this data is compared with zero, so in case a zero was received (JZ STDBY), the port will be checked again in a cycle. This cycle is broken when a value different from zero is received, so the program calls the WRITE_TEXT routine (explained later). Then the value of zero is placed again on the Accumulator (MOV A,#0h) and the cycle to wait for a character starts again (JMP STDBY). Wait_lcd This subroutine is important because as it is explained in the HD44780U datasheet, when the LCD module is done with an instruction, a signal will be sent on the DB7 pin. The current subset of instructions takes care of check for that 34