3v0 said:Simple things first. I am guessing you know this but it needs to be checked.
DTE and DCE. If you do not have one of each you need a null modem cable to connect them. In short TX and RX (2 and 3) are crossed.
3v0 said:If both of your uC's can talk to a PC then they will not be able to talk to each other.
You need a Null Modem Cable. As I said the sort version is that TX and RX wires (pin 2 and 3) are crossed.
This sounds stupid but: Think of it like this. You have two pipes.
Your friend speaks into one and listens to the other.
You speak into the one he listens to, and listen to the one he speaks in.
If you get it wrong you are both speaking into the same pipe and listening on the other (that no one is speaking into). It is a good chance that is what you are doing.
AceOfHearts said:Im sorry, I really dont understand whats going on here. I only have half duplex comms as I am transmitting from one uC only and not not doing transmit/receive at any time.
It just makes sense that my Tx pin of one uC goes into the Rx pin of the other uC.
As far as I am concerned, the data is ready and is comming out of the Tx, and it shouldnt be a problem going into Rx.
Leftryretro says "It's obviously important that one ends send pin is wired to the other device's receive pin and visa verse." but you said something opposite?
I am sure there is a way to get around the problem (whatever it is) without buying a Null Modem Cable (built one if necessary).
But at the moment, I am still trying to absorb what the problem really is, because I just dont understand it as of yet!
Many thanks for the responses.
However the problem is, when I try to connect the serial link between the two uC and press any key, I get wierd symbols appearing on the LCD.
AceOfHearts said:However the problem is, when I try to connect the serial link between the two uC and press any key, I get wierd symbols appearing on the LCD. For some reason connecting the two subsystems do not work, whereas I know they both work on their own.
Leftyretro said:Well you do say that there is data moving from one uC to the other uC, only it's garbled characters displayed on the LCD. That should mean it's not a hardwired data direction problem. What baud rate are you using? It's possible that the baud rate error (there is always a small amount of error due to uC clock speed variation) for either uC is small enough to work via the PC but when working together the error is adding such that it's garbling characters. You might try slowing the baud rate to the slowest speed possible and see if the garbled characters improve. Also make sure that there isn't a 7 bit Vs 8 bit problem. Your PC may ignore 8th (strip off the non ASCII 8th bit), but your LCD may not and is displaying non-ascii characters?
You just have to keep try things using logical steps, you're not the first to have trouble establishing a serial link
Good luck
Lefty
AceOfHearts said:Thanks for all the responses, much appreciate it.
I will try and switch things around a little and see what I get.
But my LCD has 8 bit data line?
Brevor said:How far apart are the two uc's, do they share a common ground?
It sounds like you are not using a max 232 IC.
Pommie said:RS232 works fine even with digit % differences. If you are still worried about the crystals then swap them and see if the error changes. Also, try swapping the chips around. If the error stays the same then you know the problem is software. I don't know much about the 8051 but know that they cannot drive outputs high, is the internal pull up adequate, maybe an external pullup may improve things.
Mike.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?