Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RF module interface with PIC

Status
Not open for further replies.

dilton13

New Member
Hi,

I am interfacing a 433 MHz transmitter receiver pair with PIC 16F73 using the serial port.

I have connected the transmitter to another PIC.

The transmitter PIC sends data serially, continuously, at baud rate 2400.
I can receive the data with the receiver module. I can see the data stream in a scope, whose output is TTL.

But when I connect it (the RX output) to the RX pin of PIC, the amplitude drops to 2V and an offset of 1V appears on the scope. I cant receive the data serially.

But if I connect the two PICs with wires, the serial port works well and fine.

Is it a problem with my RF receiver or do I have to add something else to the circuit??

Thanks!!
 
probably the RX pin is configured as an output, so you have a conflict on the line. At startup set TRISC (set Bit 7 for RC7 to 1), then set the registers to configure USART properly.
 
probably the RX pin is configured as an output, so you have a conflict on the line. At startup set TRISC (set Bit 7 for RC7 to 1), then set the registers to configure USART properly.

RC7 is set already. The RX pin is not shared.
 
Radio data modules should be used with "Manchester data encoding" in order to avoid DC levels as they are capacitively coupled - see https://en.wikipedia.org/wiki/Differential_Manchester_encoding

Nigel has provided a tutorial that covers it:

It does the encoding and serial transmission all in software. The PIC hardware usart cannot do it by itself (Although it is possible to write some code to convert bytes to Manchester encoding then send them via the Usart in similar way).

Edit: By the time I finished typing this, Nigel had already replied.
 
Last edited:
picasm said:
It does the encoding and serial transmission all in software. The PIC hardware usart cannot do it by itself (Although it is possible to write some code to convert bytes to Manchester encoding then send them via the Usart in similar way).

Far better NOT to use the USART, it's really not suitable for sending Manchester coding - although there are some fairly limited 'bodges' to the data which can give a similar effect.

If you check the data my tutorials use, you will see that a hardware UART couldn't do it, they are restricted to 7 or 8 bit data.
 
Nigel,
Thanks for the tutorial. A good one!!

But I was receiveing the serial data fairly good with the scope. I have already added headers, and I am sending continuous data.There are no long breaks of any sorts. I get fairly good TTL output with the output unconnected to PIC.

for an update, i connected a buffer in between the PIC and the RF module. Now its working, though not reliably. I connected a .1uF tantalum across the power apart from the other discs, now it seems to be a bit ok (though not reliable, i guess.). I still wonder whats really happening..
 
Hmm.. Solved. Even though i do not know if it is the right design.

The module couldn't drive an input, i guess. Even when i connect it to a 74245, the amplitude went low at times.

So what i did was to connect a transistor (BC547) as a switch, and another one(BC 547) to the output to invert it. Now I get a clean signal at the scope even when i connect the PIC.

The Manchester coding seems to be interesting, so i guess this will be the last time I use UART with the RF module.

Thanks to all for the time. Please correct me if there is anything wrong in connecting two transistors like this.

Thanks!
 
From what I understand, you've inverted the logic of the RS232 (an inverter at either end) - this is mentioned in my tutorial, and provides a crude, less reliable system, which is why Manchester coding (or something similar) is always used.
 
From what I understand, you've inverted the logic of the RS232 (an inverter at either end) -

No it wasnt the case.

There was no logic inversion. The transmitter PIC transmitted as usual. The RF module received it, and the output of the RF module was switched by two transistors. I think it was more like a fan out problem of the RF receiver.

As I mentioned earlier, the problem is not in receiveing, the problem was RF module could not 'drive' the RX pin of PIC, if it is ok to use the term 'drive'

cheers!!
 
That was even what I was wondering. But it worked well, really well, with the two transistors rather than a 74245 or a 7404.

:confused:

i tried with RC7 set and RC7 not set. the results were the same.
 
Hi, i found that this is already a very old thread.
But anyway, still hope there got person will reply here.

I have already read through the nigel tutorial,
But maybe i am not good in english understanding, there is some confusing for me.

For me, i am going to build a similar project,
use the PC interface with the RF module and send data to the MCU side.

from the conversation above,
u guys say there is no good to using USART port to interface with RF module.
I not really understand why?

So, beside USART port, i can simply use other IO port to interface with my RF module?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top