??? 09/12/07 19:17 Read: times |
#144496 - Hardware Flow Control |
Hello All,
I am using a GPS and CPU to communicate to the 8051 using serial communication(RxD TxD). Since i need to inter face two device to one serial port i am using IC 74125 Buffer. I am using P1.0 to control the selection of GPS or CPU. A low on P1.0 enables the buffers for Rx and Tx of GPS to P3.0 and P3.1. A high on P1.0 disable The GPS buffer control and using an NOT gate enables the CPU to the pins P3.0 and P3.1. I am normally storing the GPS data and check after every byte if RTS is low(active low). RTS from DB9 goes into MAX232 level convertor and then into Pin P1.1. This pin is set as input pin by writing 1 on it. If the RTS is foung low the program jumps to the routine to read 16 characters and display on LCD. CTS line (active Low) is same as inverted Pin P1.0. Code is appended below: Here i have displayed the incoming GPS data on LCD:- DISPLAY: CLR P1.0 ; GPS Enabled WAIT_GPS:JNB RI, WAIT_GPS ; wait till byte received MOV A,SBUF ACALL DISP_CHAR ; this displays the byte on LCD CLR RI CHK_RTS:JNB RTS,CPU_IN ; after each byte is displayed ;RTS pin is checked. ; If found LOW(active low?)it jumps to display 16 bytes. SJMP DISPLAY CPU_IN: SETB P1.0; Enable CPU buffer control AND CTS ACALL CLR_LCD ; clears the LCD display MOV R0,#0FH ; Count to display 16 characters WAIT_CPU:JNB RI, WAIT_CPU ; Wat for Byte MOV A, SBUF ACALL DISP_CHAR ; Diplay on LCD CLR RI DJNZ R0,WAIT_CPU ; Loop till 16 Charcters displayed SJMP DISPLAY ; If 16 characters displayed start all over Problem: The program continously displays the incoming GPS data. When i use Hyperterminal (using hardware flow control)to send characters, the program does not jump to the CPU_IN(RTS is never found low). |
Topic | Author | Date |
Hardware Flow Control | 01/01/70 00:00 | |
do you have a pullup resistor on P1.0 ? | 01/01/70 00:00 | |
No Pullup on P1.0 | 01/01/70 00:00 | |
no | 01/01/70 00:00 | |
Pullup Put | 01/01/70 00:00 | |
scope the pins | 01/01/70 00:00 | |
Pins Scoped | 01/01/70 00:00 | |
IC1A is HD74LS00P | 01/01/70 00:00 | |
Shematic Posted | 01/01/70 00:00 | |
is everything 5V powered? | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
More silly questions | 01/01/70 00:00 | |
Sillier Ques. | 01/01/70 00:00 | |
Scoping = "use an oscilloscope" | 01/01/70 00:00 | |
FYI Erik and Russ; Re: Scope | 01/01/70 00:00 | |
No line for RTS in cable!!!! | 01/01/70 00:00 | |
Will it work? | 01/01/70 00:00 | |
IT finally worked !! | 01/01/70 00:00 | |
so, you wasted almost a whole day | 01/01/70 00:00 | |
Aw, c'mon | 01/01/70 00:00 | |
It may not apply here, but .... | 01/01/70 00:00 | |
A little excessive![]() | 01/01/70 00:00 | |
even old timers have to debug | 01/01/70 00:00 |