 |
 |
| View previous topic :: View next topic |
| Author |
Message |
bestbuylvr
Joined: 31 Jan 2007 Posts: 27 Location: Pittsburgh, PA
|
|
Posted: Fri Feb 02, 2007 7:27 am |
|
|
| How would you go about transmitting from one serial port to another? Is there a program to do it, or is there a way to write it into a C++ code? I havent had a whole lot of serial experience, so any help would be nice. Thanks guys. |
|
 |
newguy
Joined: 24 Jun 2004 Posts: 1946
|
|
Posted: Fri Feb 02, 2007 1:08 pm |
|
|
Hyperterminal to one COM port, and CCS serial port monitor program to the other. Once they're each set up with the proper baud rate, etc., whatever you type in one window should show up in the other. If you can move a message from one port to another and back again, then your hardware isn't the problem.
The only thing is, I'm sure your hardware is the problem because you were able to move messages back & forth from the PC to the PIC when they were directly wired. This setup will allow you to more easily diagnose the issue and fix it. |
|
 |
bestbuylvr
Joined: 31 Jan 2007 Posts: 27 Location: Pittsburgh, PA
|
| You'll like this. |
Posted: Fri Feb 02, 2007 2:24 pm |
|
|
| Ok, so here is the twist to this whole thing. It does indeed send data both ways when using hyperterminal and having the bluetooth devices hooked directly to the computer. This is a rather crazy find, since the PIC acts as though it is getting nothing. Now in order to connect the serial bluetooth device to the computer, I have to use a NULL modem(Femal to female), but I have a NULL modem (Male to Female) that I used to connect the Bluetooth to the PIC, just in case that was the problem. Neither way, straight or Null, worked. I dont know if the two NULL modems are any different because of the connections, but I would think that trying straight or inverted, I would have covered all bases. Do you think I need some other type of connector perhaps? By the way, thank you newguy for all of your help. I really do appreciate it. |
|
 |
newguy
Joined: 24 Jun 2004 Posts: 1946
|
|
Posted: Fri Feb 02, 2007 2:44 pm |
|
|
What sort of board is the PIC on? Is it a commercial prototyping board or something you put together yourself?
Are you sure that you use a null modem cable to connect the bluetooth device to the PC? That just doesn't seem right. Not at all.
Anyway, try this. Use a multimeter to see what pin goes where on the female-female cable that you used to connect the bluetooth device to the PC (and you know works properly). The PC transmits on pin 3, and receives on pin 2. See if pin 3 is connected to the other pin 3, or if pin 3 on the PC end is connected to 2 on the other end of the cable.
Then measure which pin is connected where on the PIC's board. All you need to know is where PIC pins C6 and C7 go on the DB9 connector.
See where this is going? You'll need to verify that you have equivalent wiring to the bluetooth device at the PC and PIC ends and that you don't have any swapped or broken connections on the tx and rx lines.
PC -> DB9 pin 3 -> Bluetooth 1 data in
PC <- DB9 pin 2 <- Bluetooth 1 data out
PIC -> C6 -> DB9 pin 3 -> Bluetooth 2 data in
PIC <- C7 <- DB9 pin 2 <- Bluetooth 2 data out
One more thing, do you have a level converter (max232 or equivalent) in the PIC circuit? Since the bluetooth device works if connected to the PC's serial port, it must have an RS232 level converter. Therefore there has to be one between the PIC and the bluetooth device as well. |
|
 |
bestbuylvr
Joined: 31 Jan 2007 Posts: 27 Location: Pittsburgh, PA
|
|
Posted: Mon Feb 05, 2007 7:40 am |
|
|
The Board I have is indeed a commercial prototyping board. The Bluetooth device I connect to the PC is only connected through the serial port when I was testing it and does indeed come with a null modem to use for that purpose. Under normal circumstances, that bluetooth device is connected to the serial cable of the PIC.
I will run through all of the connection checks that I can on the PIC side, but the other PC end is as I said a USB connector that only makes a virtual serial port, making it almost imposseble to tell what pins are transmitting or recieving there, but I guess we can assume it is not that whick is the problem considering it loops data correctly when using only the computer.
I am not quite sure about the level converter you are referring to. I know that the bluetooth serial device is powered by an external source, but the USB is powered internally, if that means anything. Again I thank you for your help. |
|
 |
bestbuylvr
Joined: 31 Jan 2007 Posts: 27 Location: Pittsburgh, PA
|
| Update |
Posted: Mon Feb 05, 2007 9:56 am |
|
|
| Here is an interesting update. I used a multimeter to find out what pins on the PIC's serial were connected to the actual headphone-like end. It turns out that Pin 5 is GND, and pins 2 and 3 are Tx/Rx. I used the jumper wires I had to manually connect the serial port to the bluetooth serial adapter. I got it to work to the point I had before with it transferring from the PIC to the computer, but it still wont go back. I tried every pin connection between the PIC's serial pin 3 and all but the computer's GND and pin 2, which was receiving from the PIC. Does this mean a possible technical difficulty or a programming error? I have went over the code and it works flawlessly when physically connected. I assume something in the hardware may not be right, though I have no way to be certain. Your opinion? |
|
 |
bestbuylvr
Joined: 31 Jan 2007 Posts: 27 Location: Pittsburgh, PA
|
| RESOLVED |
Posted: Tue Feb 06, 2007 9:05 am |
|
|
OK, so apparently this bluetooth adapter I was using is waiting for a clear to send signal. Since the PIC doesnt send a CTS signal, it never got it and therefore decided not to send data over the connection even though I set it not to use CTS. I guess one of the adapters apparently doesnt agree with that, but using a 5 Volt signal on pin 8 seems to open the connection and solve the problem. Thank you guys again for your help, especially newguy.
~Harrison |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|