Peter_wadley said:
Hey,
So is the MAXIM 232 the best chip to use? How would I hook it up?
Ive set up VB6 as you've stated.
So If I were to type 'ABC' into the textbox..
Would the PIC recieve:
100 0001 for A
100 0010 for B
and
100 0011 for C ?
hi Peter,
Assuming you set the VB RS232 comms for say, 9600,n,8,1 [baud rate 9600, no parity, 8 bit data, 1 stop bit]
The bit stream for the "A" character would be
1 Start bit
8 data bits ,,,, ASCII "A" is 0x41 == 01000001
1 Stop bit
ASCII "B" is 0x41,,, "C" is 0x42
You may, on some strings to a terminal also have to send the code for CRLF [carriage return line, line feed]
after the ie: "ABC" 0x0D, 0x0A
This depends upon the program in the receiving PC, some programs look for the CRLF in the string as a line terminator.
Use the ON COMM event in VB, there are examples in the online help files within the VB program.
Use the error trapping routines shown in the help files.
The MAX232 has 2 line drivers[transmitters] and 2 line receivers,
usually you just use one transmitter on the TXD output from the PIC to PC
and one line receiver to the RXD input of the PIC from the PC.
Eric