| ??? 09/16/03 15:54 Read: times |
#54819 - RE: Using P0 port as data/cmd lines for lcd? Responding to: ???'s previous message |
Thanks for all the replies.
1) The 8-bit data/cmd bus from the lcd is tied to p0, and the read/write goes to the 8051's read/write pins. Enable and chip select goes to p1.0 and p1.1. Using a development board and monitor program, I think using the movx @dptr, a should work. Yes, no ? 2) To simplify debug efforts, I have moved the bus and read/write pins of the lcd to p2 and p1.5/p1.6, so read and write is controlled by code. What I notice now is that the monitor program actually changes the address of lcall after 2 lcalls to WriteDisplayCMD, i.e. the code below executes correctly (I'm using the single-step feature of the monitor program) until the 3rd lcall WriteDisplayCMD. I start the code at 8000h and the code actually has WriteDisplayCMD at 803dh, but after the 3rd lcall, it reflects a WriteDisplayCMD address at 8002h. DisplayInit: lcall delay clr p1.1 ;select LCD mov a, #reset_display ;reset display lcall WriteDisplayCMD mov a, #lcd_bias_1_9 ;set LCD brightness lcall WriteDisplayCMD mov a, #adc_select_reverse ;segment driver lcall WriteDisplayCMD mov a, #common_output_normal ;set LCDdisplay WriteDisplayCMD: clr p1.0 ;a0_bit clr p1.1 ;cs1_bit clr p1.6 ;wr_bit setb p1.5 ;rd_bit mov p2,a setb p1.6 ;wr_bit nop ret Delay: mov r0, #02h Delay1: djnz r0,delay1 ret Any ideas why it's changing the lcall address after calling it the 3rd time ? Thanks.... |
| Topic | Author | Date |
| Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: correction | 01/01/70 00:00 | |
| RE: correction | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| RE: Using P0 port as data/cmd lines for lcd? | 01/01/70 00:00 | |
| Salam LCD + Code | 01/01/70 00:00 | |
RE: Salam LCD + Code | 01/01/70 00:00 |



