|
|
|
Serial port test using LED
|
Original Message
|
Name: scout
Date: February 20, 2005 at 08:45:28 Pacific
Subject: Serial port test using LEDOS: Win XPCPU/Ram: P4 256 MB Ram |
Comment: Hi, I am trying to observe the output of a DIY serial cable RS232 using an LED. I have tried connecting the RTS and the ground wire to the LED and then using an assembly program to send a byte at 9600 baud to the serial port. However, the LED just light up for about a second. Why is this so? Is my baud rate too high? I have tried reducing it to the minimum of 110 baud but the same thing still happens. Have I got the procedure and connections wrong? If so, can someone please help me by describing to me the correct procedure to do so? I was told that I would observe the LED blinking according to the bits in the byte sent.
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: wizard-fred
Date: February 20, 2005 at 09:26:49 Pacific
Subject: Serial port test using LED |
Reply: (edit)All of the normal baud rates are too fast for the human eye. The character rate is approximately 1/10 the baud rate. 1/11 second for 110 baud, 1/960 second for 9600 baud. This is for the actual data. The handshake data (RTS) can be only a fraction of the character time depending upon the receiving equipment. You will best see the transitions if you observe with an oscilloscope. You will never see the 'blinking according to the bits in the byte' since you are not observing the sent data. RTS is a control signal that is actually sourced from the receiving device.
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: scout
Date: February 20, 2005 at 10:03:45 Pacific
Subject: Serial port test using LED |
Reply: (edit)Thanks for ur enlightenment.... I would like to clarify a concept. Does it mean that during serial communication, when the bits are transmitted, the RTS and the DTR will interchange between logic '1' and'0' but it cannot be captured from the LED?
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: wizard-fred
Date: February 20, 2005 at 10:54:49 Pacific
Subject: Serial port test using LED |
Reply: (edit)You should look at the timing chart of the control signals. If connected to real equipment some of the signals may not change as long as the receiver is always ready to process the characters (faster than the sender). You could also directly write to the registers for DTR or RTS and toggle the LED's on and off.
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: scout
Date: February 20, 2005 at 11:42:32 Pacific
Subject: Serial port test using LED |
Reply: (edit)Sorry to trouble u guys again. May I know that if I were to observe the bits in the sent data byte instead, will I be able to see the 'blinking' or transitions in the LED? There is no receiver equipment available and I am supposed to "drive" the LED using the serial port. OR is the result still the same as the RTS signal since the baud rate is too fast?
Report Offensive Follow Up For Removal
|
|
Response Number 5
|
Name: newman
Date: February 20, 2005 at 16:06:37 Pacific
Subject: Serial port test using LED |
Reply: (edit)Hi, The only way to see the individual bit is to use an instrument. scope, or data analyser. you can't see it with your eyes without using some sort of instrument. The bits are too fast. I think you got it right. newman,
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: elric
Date: February 21, 2005 at 06:05:40 Pacific
Subject: Serial port test using LED |
Reply: (edit)G'day, If you just send one byte out of the port you will only see the LED light up for that given period (determined by the baud rate) and the previous posts are correct: it will happen too fast for you to see. I'm not sure exactly what you want to do, but I will make some comments/ suggestions for you to think about. If you just want to check the data output, you could connect the cable to another computer and use a terminal programme to "catch" the output to a file. If you want to watch the RTS and serial lines, try using a loop in your assembler programme and send out a known byte continuously. As the previous posts have stated, you will need some test equipment (protocol analyser, oscilloscope etc) to see the fast transitions. However, depending on your electronics knowledge, you could do a number of things: You could set up a counter circuit to divide down the rate a known amount (ie make 9600 baud come down to 0.96 baud by using 4 divide by ten counters in series). The LED will then change once a second (approx) and you will be able to see it. A rather more extreme solution would be to feed the output back into the printer port and use an interrupt routine (or a polling one) to count the events. Either way, good luck Elric
Report Offensive Follow Up For Removal
|

|

|
Use following form to reply to current message:
|
|

|