Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 17th January 2008, 05:37 PM   (permalink)
Default RF module interface with PIC

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!!
dilton13 is offline  
Old 17th January 2008, 05:50 PM   (permalink)
Default

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.
spectrum is offline  
Old 17th January 2008, 05:53 PM   (permalink)
Default

Quote:
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.
dilton13 is offline  
Old 17th January 2008, 06:24 PM   (permalink)
Default

You can't send plain RS232 data via RF modules reliably, check my PIC tutorials for a better way of doing it.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 17th January 2008, 06:32 PM   (permalink)
Default

Radio data modules should be used with "Manchester data encoding" in order to avoid DC levels as they are capacitively coupled - see http://en.wikipedia.org/wiki/Differe...ester_encoding

Nigel has provided a tutorial that covers it: http://www.winpicprog.co.uk/pic_tutorial.htm

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 by picasm; 17th January 2008 at 06:34 PM.
picasm is offline  
Old 17th January 2008, 06:37 PM   (permalink)
Default

Quote:
Originally Posted by picasm
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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 17th January 2008, 06:40 PM   (permalink)
Default

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..
dilton13 is offline  
Old 17th January 2008, 07:44 PM   (permalink)
Default

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!
dilton13 is offline  
Old 17th January 2008, 11:30 PM   (permalink)
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 18th January 2008, 02:13 PM   (permalink)
Default

Quote:
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!!
dilton13 is offline  
Old 18th January 2008, 03:21 PM   (permalink)
Default

Considering the PIC input is a CMOS gate, and is VERY!! high impedance, it shouldn't be a problem?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 18th January 2008, 06:37 PM   (permalink)
Default

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



i tried with RC7 set and RC7 not set. the results were the same.
dilton13 is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Using a PIC microcontroller to interface with a DS1302 real time clock ssylee Micro Controllers 51 9th January 2008 09:54 AM
pic and mosfet interface h.d General Electronics Chat 16 11th December 2007 09:18 PM
RF receive using PIC USART col_implant Electronic Projects Design/Ideas/Reviews 11 15th November 2007 05:06 PM
Rf Pic flemmard Electronic Projects Design/Ideas/Reviews 1 9th September 2007 09:34 PM
Motor control interface dreamproject Micro Controllers 0 31st March 2005 04:48 AM



All times are GMT. The time now is 12:47 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker