![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
i am asked to do AT89C55WD to transmit to MAX232 and the MAX232 interfacing to the PC.I am asked to use hyperterminal to transmit data to the AT89C55WD and then send back data to AT89C55WD which LCD DISPLAY (2X 16) will display the character. i have to use assembly language to do it. can anyone help me? [/img] | |
| |
| | #2 |
|
ORG 0000H JMP MAIN ORG 0100H MAIN: CLR P2.5 ; send command CLR P2.6 ; write MOV A,#38H :5*8 font CALL STROBE MOV A,#0CH :cursor off CALL STROBE MOV A,#06H ;display pattern CALL STROBE MOV A,#01H ;clear display CALL STROBE MOV A,#02H ;return home CALL STROBE SETB P2.5 ;rs send data MOV SCON,#50H ;set serial mode MOV TMOD,#20H ;set timer1 to mode 2 MOV TCON,#00H ; set baud rate to 9600bps MOV TH1,#FDH SETB TR1 MOV A,#41H ;mov 41h to a TX: MOV SBUF,A ;put character into sbuf WAIT: JNB TI,WAIT ;check tx ready? CLR TI ;yes,clear flag RX: JNB RI,RX ;any character rx? CLR RI ;yes,clear flag MOV A,SBUF ;read character into a CALL STROBE ;display in LCD JMP TX ;endless loop STROBE: SETB P2.7 ;Set e to high MOV P0,A ;send to port 0 CLR P2.7 RET END | |
| |
| | #3 |
|
block diagram
| |
| |
| | #4 |
|
this picture i didnt add the reset button(pin 9 at89c55wd) due to space restrict.
| |
| |
| | #5 |
|
Do not test your software all at once. Works on the LCD routine alone to make sure that your can display correct characters on the LCD in its two lines. After you have completed that, then you can test out your serial routine. A brief look at your code indicates that your have not consider the proper power on reset sequence to place the LCD into operating mode(You need to wait for sometime and send several commands to do that, its all been described inside the datasheet of HD44780 LCD datasheet).
__________________ L.Chung | |
| |
| | #6 |
|
The above program have been tested on the LCD and it works. u mean i didnt not do the power rest on the hardware? (if yes i already put a reset button on the AT89C55WD) Can pls give me an example code? Thanks 4 replying to me | |
| |
|
| Tags |
| at89c55wd, data, max232, receive, transmit |
| Thread Tools | |
| Display Modes | |
| |