Showing posts with label Serial Communication. Show all posts

Serial communication software



Pc to lcd communication:

                                                                                                                                                                                                                                 ORG 00H
RS EQU P3.4
RW EQU P3.5
EN EQU P3.7
DATAPORT EQU P1
MAIN:
                MOV TMOD,#20H
                MOV TH1,#0FDH
                MOV SCON,#50H
                ACALL LCD_INIT
                SETB TR1           ;start timer1
                ACALL SERIAL
SERIAL:
HERE2:  JNB RI,HERE2     ;Wait for character to come in
                MOV A,SBUF                                     ; move recevied data into a
                CLR RI
                ACALL DATA_WRT
                ACALL DELAY
                SJMP SERIAL
LCD_INIT:
                MOV A,#38H
                LCALL COMND_WRT
                ACALL DELAY
                MOV A,#0EH
                LCALL COMND_WRT
                ACALL DELAY
                MOV A,#01H
                LCALL COMND_WRT
                ACALL DELAY
                MOV A,#06H
                LCALL COMND_WRT
                ACALL DELAY
                MOV A,#80H
                LCALL COMND_WRT
                ACALL DELAY
                ;CJNE A,#8FH,AA
;;AA: MOV A,#0C0H
;               LCALL COMND_WRT
;               ACALL DELAY
                RET


COMND_WRT:
                MOV DATAPORT,A
                CLR RS
                CLR RW
                SETB EN
                ACALL DELAY
                CLR EN
                RET
DATA_WRT:
                MOV DATAPORT,A
                SETB RS
                CLR RW
                SETB EN
                ACALL DELAY
                CLR EN
                RET
LCD_CLEAR:
                MOV DATAPORT,#01H
                ACALL COMND_WRT
                RET
DELAY:
                                MOV R0,#0FFH
HERE1:  MOV R1,#0FFH
HERE:    DJNZ R1,HERE
                                DJNZ R0,HERE1
                                RET

RS 232 serial communication with microcontroller using ftdi usb serial adapter

rs232 communication is also possible with microcontroller so that microcontroller is able to communicate with pc using ftdi usb serial adapter. Data is transferred serially so that it is known as serial communication.




I have implemented this circuit on proteus as well as on hardware. It is very simple and easy to implement. You should buy usb to serial adapter for implementing this project and a software like flash magic or hyper terminal. After connecting hyper terminal or flashmagic to appropriate COM port. type the word from your pc keypad. It will be then displayed on LCD.


- Copyright © Microcontroller Projects -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -