Page 1 of 1

Problems Communicating 2 PICs via Transmitter/receiver

Posted: Mon Dec 22, 2008 7:34 am
by achillis1
hello,

I have 2 PICs that Communicate wirelessly via Fm transmiter/receiver(VY48-MAPLIN) through RS232 TX/Rx with 2 wires. At first the PICs were communicating ok. I was pressing the switches one the "sender" PIC and the desired value was transmitted on the "receiver" PIC and the value was indicated on LEDs. The PICs are placed on different boards. I was powering the 2 PICs by different power supplies, so they did not have common ground. After some time, one power supply did not work so I took power from the one board to the other and continued my tests but by mistake one day I connected the power to the one board the other way around!!! After I got a new power supply when I was powering the PICS from different power sources they do not work! Only if I connected them with the same power supply! The transmitter/receiver seems to be OK, so the PICs.
Have you any idea what must have happened? Do I have to replace the PICs and transmitter/receiver?
maybe I messed up the capacitor by changing the polarity of the power supply? ( I have electrolytic and ceramic-parallel with PIC)

Thank you in advance,
Best regards.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Mon Dec 22, 2008 11:00 am
by Benj
Hello

On no I hate it when that stuff happens. Sounds like you've fried the PIC chip that had the reverse polarity applied to it. Could also have fried one end of the wireless too but if that still seems to be working then it may be ok.

Try and test something simple on the PIC to see if it is alive still.

Caps and other discretes in the circuit should be fine.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Mon Dec 22, 2008 1:06 pm
by achillis1
It could be fried even if when I power both PICs with the same power supply, work?
I will try to test it with something simple and get back.
Thank you Ben!

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Mon Dec 22, 2008 1:52 pm
by Benj
Hello

Are you saying that if you use the same power supply for both PICs then they work. Ok in this case then they are not damaged. Maybe they are simply in need of a common ground.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Wed Jan 07, 2009 7:19 am
by achillis1
Hi Ben,
Tried something simple with the PICs and they work fine. Also I connect the 2 PICs directly with the RX/TX pins and work fine. The trouble now is this: I have the one PIC to send values through a switch connected on the port; and the other one takes the value and send it to the LEDs. So it is one way communication? Assuming that, if I want to try this I just connect the Tx pin of the "sender" PIC to the Rx of the "receiver" PIC, while not having the RX of the "sender" connected to Tx of the "receiver" and it works! Normally I should not connect both of the wires>>>TX to Rx and Rx to Tx and not just Tx ot Rx? Well sometimes when I reset the PICs the communication does not work and I have to connect both of the wires!
Nevertheless when I was making tests with this way and communicating with the fm transmitter/receiver pair(vy48) I connected only the Tx to Rx-1 wire- (Tx pin of "sender" to the transmitter and Rx pin of "receiver" to receiver module) and it was working; after I wrote you in my previous posts what happened with the reversed polarity. So my guess now is when I connect the one wire-Tx to the transmitter I should not have the Rx wire open collector? Even so I attached a receiver module to the "sender" PIC's board in order to connect the Rx pin to somewhere but with no luck!!!!
I do not know if I confused you but if you have a WILD guess on what must be the problem it would be very helpfull! : )
I forgot something, in the datasheet of VY48 for the receiver module connections there are some pins that must be connected to RF ground and other to AF ground; can you tell me what is the difference between them?
Thank you in advance,
Best Regards.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Wed Jan 07, 2009 10:22 am
by Benj
Hello Achillis

The UART is capable of locking up if specific errors are detected. If you leave the RX pin floating then it is possible that the UART will pick up spurious errors and lock up the whole UART. I would pull this line to 5V using say a 1K resistor if you are not using it. You can also do random RS232 read commands in your program to unlock the UART if it becomes locked.

RF ground is normally tied to the antenna and RF booster circuitry. AF ground I am assuming will be the same as the PICmicro ground. You may have to keep these two grounds completley seperate for the RF to work or you may simply have to keep them connected but as far apart as possible to avoid noise issues.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Wed Jan 07, 2009 10:48 am
by achillis1
Hi Ben,
Thank you for your response!
Sorry but it seems that I have forgotten to attach the VY48 datasheet in case you wanted to take a look!
On my board I have an antenna and it is connected to the DATA IN(ant) pin of receiver and transmitter module. Now the (rf ground)pin of the receiver where do I connect?
Sorry to bother you with this kind of questions but my knowledge here is verry narrow and I remember that once you said that you used in one of your projects that VY48 transmitter/receiver!!!
The AF ground I connect it to the board's ground.
Also the "test point" pin should I leave it unconnected?
Thank you Ben,
Best Regards.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Wed Jan 07, 2009 3:46 pm
by Benj
Hello Achillis

As far as I can tell you simply common the grounds together and that will work ok. In some sensitive applications you may want to try and limit the amount of connectivity between the two grounds by using caps etc but you shouldn't need to do this for your application.

Yes you can also leave the test point pin unconnected.

Let me know how you get on.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Wed Jan 07, 2009 6:36 pm
by achillis1
Complete disaster!!!!!
Nothing works! Now the receiving PIC outputs on LEDs 255 0r 127 or sometimes LEDs just blink randomly!
Without the trasmitter/receiver the PICs work fine but that does not mean that they are not unstable?
By all that I assume that the tranmsitter/receiver are the cause of malfunction-even though I replaced them-by being damaged or by confusing the PICs when connected together.

Also Ben I am confused with those you wrote previously; that I must common the grounds together in contrast to previous statements of yours that I have to keep separate the>>>RF ground and AF ground!
Also the two PICs, that is for sure that I must not have common ground, because the project will not be wireless.
The only thing left to do now is to get two new PICs and try them or change everything, PICs and trasmitter/receiver and capacitors!!! (maybe board also!!!)

I am already searching for new and different type of trasmitter/receiver or tranceiver to replace the others.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Thu Jan 08, 2009 10:29 am
by Benj
Hello Achillis
Nothing works! Now the receiving PIC outputs on LEDs 255 0r 127 or sometimes LEDs just blink randomly!
Sounds like good news this. The 255 is stating that nothing has been received. The 127 and random blinking would be incoming data. Maybe if the rx input is left floating this could happen.
Without the trasmitter/receiver the PICs work fine but that does not mean that they are not unstable?
Not sure what you mean by this.
in contrast to previous statements of yours that I have to keep separate the>>>RF ground and AF ground!
In industrial designs you would connect the RF ground to the AF ground at a single point away from the microcontroller to try and keep any noise spikes away from the digital circuitry. The transmitter and receiver shouldnt be that noisy in a home or non industrial context so you should just be able to tie all the grounds together.
Also the two PICs, that is for sure that I must not have common ground, because the project will not be wireless.
The common ground between the PICs is only needed for the wired communications as a return path for the signal. When moving to wireless you do not have to worry about this as the signals are going via radio waves and do not need return paths for the current.
The only thing left to do now is to get two new PICs and try them or change everything,
Its usually something very simple thats causing the problems. Do not throw it all in the bin if it doesnt all work straight away. My suggestion is that you try and get the wireless working without the PICs for now. Check the antenna connections and try to get a more in depth datasheet. That one you attached to the forums was very basic so there must be a more in depth datasheet available somewhere. Test the wireless by flicking a switch at one end and seeing an LED at the other. Once this is working the UARTs of the PICs can be connected and fingers crossed it will all work. Also remember to start with as low a baud rate as possible. This will vastly improve your chances of success.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Tue Jan 20, 2009 1:01 pm
by achillis1
Hello Ben,

First of all, I am going to attach some pdf files of some tranceiver modules and if you have the time maybe you can take a quick look at, maybe there is a module that can "fit" better with the PICs.
Also I have attached the 2 pdfs of my transmitter/receiver modules(vy48),again, this time there are some tiny details that were low resolution in the previous datasheets.

Also some pictures taken of my PIC boards and trasmitter/receiver test board to take a look at. Maybe the position of the various components is not the optimum and maybe one interfers with another! Ex wires touching caps are making noise.

Now the most important regarding the reliability of the trasmitter/receiver modules, I have set up a board to test them as you told me in your previous post.
1.Without connecting the data in, pin of transmitter or connected to ground >>> the output of data out pin of receiver is zero or -5v (if voltage meter connected in reverse)!!!!
2.When the transmitter pin is connected to +5v then >>> the output of receiver is variating from+1v to +1.5v up & down continuously or -3.6v (if voltage meter connected in reverse)!!!! The trebling of the voltage from 1 to 1.5 volts is causing the LED to light on and off quickly.
I think that are damaged or I do not know, if I attach some caps or diode or resistor in crusial points on the board could help them to work more properly.

I have tried 3 pairs of transmitter/receiver which previously were used in the boards with the PICs. There is one new pair that is not used before and I think I will test that one too.
So Ben in order to avoid burning them can you suggest anything. Is it best to attach a resistor on the power supply to minimize the current to the module or the module will "suck" as much current as it needs? Will that drop the voltage on the other hand? My power supply units have an output of 500mA and 2A.

The data sheets are from rfsolutions and hoperf.
http://www.hoperf.com/rf_fsk.asp http://www.rfsolutions.co.uk/acatalog/index.html http://www.hoperf.com/pro/HM-TRS.html
http://www.hoperf.com/pro/HM-TR.html

I have also one different question Ben, can flowcode version 3 create the programs in an intel hex format? If not; what kind of format does it create?
Also(many...alsos!!!!!!) i am thinking of purchasing new PICs and probably new programming board and I was thinking AVR, ARM or PIC? What is best?

oK I can see that I cannot upload all these, so Ben I am going to send them to your e-mail!

Thank you in advance,
Best Regards,
Achillis.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Mon Feb 09, 2009 2:35 pm
by achillis1
Hello Ben,

I am getting the new tranceivers 433Mhz and it seems that they are configurable via software. i am sending you a screenshot and if you can please take a look and see if maybe this is not compatible with the PIC we use e.x 16F877A and with flowcode component RS232?

Thank you in advance,

Best Regards
Achillis

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Mon Feb 16, 2009 12:49 pm
by Benj
Hello Achillis

Sorry for the delay in replying its very hectic around here at the moment.

Yes the device looks compatible,

Your settings look good too. Eg 8-bit data, No parity check bit, 1 stop bit.

I will go over the rest of your questions when I get some time to sit and think about it (hopefully later on today).

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Fri Feb 27, 2009 9:44 am
by achillis1
Hello Ben,

I have received the HM-TR-TTL tranceivers and connected them with two of my PICs. The "sending" PIC has the switch board and "receiving " PIC the LED board. When I press one of the switches's buttons I can see a red LED blinking indicating that the tranceiver sends, one the other hand, one the receiving side, the other tranceiver has a green LEd blinking indicating that is receiving data succesfully.

The problem now is that I have to keep pressing the buttons for more then 3 seconds or rapidly push and release them, in order for the "receiving" PIC to display the corresponding value on the LEDs!!! The big problem is with value (1), less for the value(2) and almost with no delay the value(3)!

PICs and tranceiver work with the same configuration>> NO CHECK/1 BIT STOP/9600 BAUD RATE.

I have contact the company from which I got the tranceivers, I sent 3 e-mail regarding this but unfortunatly-I think-due of luck of communication(they are chinese and their English are not to good!) they cannot help me!!!

Do you have any idea what might goes wrong?


Thank you,

Best Regards,
Achillis.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Fri Feb 27, 2009 10:31 am
by Benj
Hello Achillis

Yes I have seen this before. I think that if the signal remains constant for around 3 seconds then the transmitter assumes that it has finished transmitting its data. Therefore its just a power saving feature. Once you are transmitting data via the UARTS you hopefully should not have a problem.

Not 100% about this though as this was just my assumption. If you can get in contact with the company then they will be able to give you a more definative answer.

Re: Problems Communicating 2 PICs via Transmitter/receiver

Posted: Fri Feb 27, 2009 1:25 pm
by achillis1
hello Ben,

The data transmittion is already via UARTS, rs232 compnent.
I have sent you an e-mail with the datasheet of the tranceiver and some notes regarding a topic of it.
Check page 4 and 2(pin description).
You do not think that is a voltage stability issue or anything else? It will be software based?

Thank you,
Best Regards,
Achillis