*this question might require the need of one well versed in visual basic as it has abit of programming involved
i want to send out a constant LOGIC 1 to the serial port.
The reason i want to do this is because I would like to turn on an LED connected to the output of a MAX 232 driver whenever i press the transmit command button in visual basic using MSComm
the block diagram is as follows:
PC------> MAX232--------> LED
I understand that the voltage stream coming out of MSComm to the serial port is coded in ASCII and therefore I have to refer to the ASCII table.
My questions are:
1.I noticed that the ASCII Table does not have a character with a hex value of $FF. How can i output a character that has a value of $FF so i can turn on the LED?
2. Seeing that the ASCII table has a $o character, i inverted the polarity of the LED ( Negative TO TTL output pin while the positive pin is connected to +5V with a resistor in series) and tried the following code ( so that a 0V will appear at the output TTL pin causing the LED to light up.
Private Sub Form_Load
MSComm1.CommPort=9
MSComm1.PortOpen=True
MSComm1.Settings="9600,N,8,1"
MSComm1.SThreshold=1
End
Private Sub cmdTransmit_Click
Do while(1)
MSComm1.Output=Chr$(0)
Loop
but it didnt work...Is it at this part that my attempt is wrong?
I also noticed thru my DMM that during an idle state of no transmission by the MSCOmm, the voltage output from the serial port is Logic 1(-6V)
and the output of the max232 TTL driver is 0V...shouldnt the output be 5V denoting a Logic 1? im using 1uF caps ...
when i executed the above code which supposed to send a positive voltage of between +3 TO +12V to the serial port, the voltage reading at the serial port became -3V...
is there any reason why this is happening? is my understanding of rs232 parameters correct? perhaps the capacitance values?
help would be greatly appreciated.
i want to send out a constant LOGIC 1 to the serial port.
The reason i want to do this is because I would like to turn on an LED connected to the output of a MAX 232 driver whenever i press the transmit command button in visual basic using MSComm
the block diagram is as follows:
PC------> MAX232--------> LED
I understand that the voltage stream coming out of MSComm to the serial port is coded in ASCII and therefore I have to refer to the ASCII table.
My questions are:
1.I noticed that the ASCII Table does not have a character with a hex value of $FF. How can i output a character that has a value of $FF so i can turn on the LED?
2. Seeing that the ASCII table has a $o character, i inverted the polarity of the LED ( Negative TO TTL output pin while the positive pin is connected to +5V with a resistor in series) and tried the following code ( so that a 0V will appear at the output TTL pin causing the LED to light up.
Private Sub Form_Load
MSComm1.CommPort=9
MSComm1.PortOpen=True
MSComm1.Settings="9600,N,8,1"
MSComm1.SThreshold=1
End
Private Sub cmdTransmit_Click
Do while(1)
MSComm1.Output=Chr$(0)
Loop
but it didnt work...Is it at this part that my attempt is wrong?
I also noticed thru my DMM that during an idle state of no transmission by the MSCOmm, the voltage output from the serial port is Logic 1(-6V)
and the output of the max232 TTL driver is 0V...shouldnt the output be 5V denoting a Logic 1? im using 1uF caps ...
when i executed the above code which supposed to send a positive voltage of between +3 TO +12V to the serial port, the voltage reading at the serial port became -3V...
is there any reason why this is happening? is my understanding of rs232 parameters correct? perhaps the capacitance values?
help would be greatly appreciated.