Im starting on a school project and my current goal is to control the LED lightup
(using Microsoft Visual C++) by connecting them to the PC via the serial port . My Question is how do you connect the serial port connector to the PC. Should I plug it directly to the computer or should I buy a cable (and do solder work) to connect it?
The signal level on the RS232 port pins are +12VDC or -12VDC.
It will be easier to use the parallel port of the PC ; the signal level is + 5VDC.
Please refer to **broken link removed** for driver to use the parallel port
Yes the parallel port is easier to use and program for.
for ease of working on your project you would be better using a cable between your test setup and your PC, although you can plug in directly having a cable does make it easier to play with on the desk.
You can easily control two LEDs with the serial port's RTS and DTR handshake output signals, but controlling four LEDs would require extra cleverness.
A typical serial port outputs about +10V when "on", and about -10V when "off". You should add diodes to protect the LEDs from excessive reverse voltage in the "off" state.
I think it is better to see Mazidi's book 8051 there you can find enough about serial port pins,
if you sends a bitstream of ones it is ok to turn on LEDs but the current must be about 10mA for 5mm LEDs so choose proper resistors. for example 10V/10mA=1Kohm resistors.
bye
viva Persia
Hi Roxanna,
The serial (COM) port has only a single transmit line. Thus if you only want to use LEDs and resistors the parallel (LPT) port will be more sufficient. If you however also lan on using a microcontroller then the COM port will be suitable.
Elsewhere someone noted that you can use the control lines as well. This will indeed function OK, so some cleverness is required but it is most definitely possible.
The serial canonly a single transmit line.you only want to use LEDs and resistors the parallel (LPT) port will be more sufficient. If you however also lan on using a microcontroller .