SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By mozy
#18279
Ok, hi. I'm trying to send data from a PIC16F84 through an the RF Link to an RS-232 port on my laptop. The PIC transmits serial data just fine, I hooked it up to the laptop port and can see the data. So I know the PIC works.

Now, I set up all the wiring for the PIC->Transmitter and it seems that is ok. Powering it via 5v.
Then I set up the receiver (also powered by 5v) part which takes the data sent from PIC->Transmitter to the serial port on my PC. It's not working.

I know the PIC is ok because it's sending out serial data at 2400bps (confirmed on a wired rs232 connection). The RF Link is supposed to be MAXED OUT at 4800bps right? So my 2400bps should be OK. But no matter what I do, I can't get any data to transmit. Not one bit. I'm lost. It's late and I'm tired, so if this doesnt make sense, sorry.

Can anyone recommend anything I should do or look at? Thank you.
By riden
#18288
The PIC is sending data via the RS-232 cable, but when you hook the data to the transmitter, it can't be received on the receiver? Have a look at this thread for some help. I'm not running duplex, but I am using these modules to reliably send data at 2400 baud from the PIC to my PC 100 feet away.
By mozy
#18289
Thanks for the reply guys. I still can't figure out whats wrong though. The links you guys pasted are good but way over my head.

I'm using a sotware UART with PicBASIC's SEROUT command sending data at 2400bps if that means anything. I'm basically following the "instructions" at http://www.sparkfun.com/datasheets/RF/K ... hrough.pdf
but at the receiver side, instead of sending data to another MCU, I'm sending data to my laptops RS232 connection.

When I don't have the DB-9 wiring connected to my receiver, I get about 2.7v (if i remember correctly) at GND and DATA (#1), but as soon as I plug in my Rx and GND lines for the DB-9 to those pins, +V drops to 0 and nothing at all happens. Do I need some resistors somewhere? I dont think it's too technical of an issue, I just want to see SOMEMTHING show up on the receiver->db9(rx) line, but nothing shows. I know its probably something really simple or dumb.

Forgive my noobness, I'm a hobbyist by night suit by day :P

Thanks again.
By mozy
#18290
One more thing, on the datasheet it says that the "DATA" output pin on the receiver (the one I want to send data to RS232) is a "DIGITAL" output. What exactly does that mean? Does it mean I can't simply plug the output pin to my Rx pin on the DB-9 (with appropriate grounds) and have it work?
By mozy
#18303
I GIVE UP!

I KNOW my PIC is transmitting fine, and the wirless transmitter is working because i got a voltage reading and an LED flashing when the data is transmitting.

Then when I put a DVM onto the receiver, I get between 2v and 4.96v readings, jumping around, so I KNOW it's receiving SOMETHING (data or garbage, anything).

But how do I pipe that output to my RS-232 serial port on my PC screen? I'm not using HyperTerm, I know it sucks.

So the Transmitter and Receiver seem to work, my PIC works. The only problem is I don't see anything on the serial port (screen) of my PC, WHATS GOING ON? HELP!
By riden
#18305
mozy wrote:One more thing, on the datasheet it says that the "DATA" output pin on the receiver (the one I want to send data to RS232) is a "DIGITAL" output. What exactly does that mean? Does it mean I can't simply plug the output pin to my Rx pin on the DB-9 (with appropriate grounds) and have it work?
The digital output appears to be the output of an internal comparator in the receiver (the output will be ON or OFF). The other output is an analog output whose amplitude will vary with the signal strength. The problem with the "digital" output is that it fires with noise and hence makes it problematic for UART in the PC to decode. That is why I use an external comparator connected to the analog output. If there is no signal present, there is no output. The comparator circuit that I use is very much like the one used in the Cricket receiver project referenced.
By riden
#18306
mozy wrote:Then when I put a DVM onto the receiver, I get between 2v and 4.96v readings, jumping around, so I KNOW it's receiving SOMETHING (data or garbage, anything).
It is receiving garbage (noise) when the transmitter is not on (sometimes even between bits). I really recommend using a simple comparator where you can adjust the threshold (look at the part of the Cricket receiver between the receiver module and the input to the PIC). For what it is worth, here is my Proton+ code that exercises the transmitter and receiver. Variations of this code are being used everyday to send and receive data without any issues. Remember that I use a comparator so when the transmitter is not transmitting the serial input port is not seeing any data.
Code: Select all
            ' Transmitter

            Device 16F88
            
            XTAL          = 8
            ALL_DIGITAL   = TRUE        
            HSERIAL_BAUD  = 9600
            
            Symbol RTX = PORTA.6

            Symbol BAUD_300_8N1  = 19697
            Symbol BAUD_600_8N1  = 18030
            Symbol BAUD_1200_8N1 = 17197
            Symbol BAUD_2400_8N1 = 16780
            Symbol BAUD_4800_8N1 = 16572
            
            Symbol Preamble = $55    
            Symbol Sync     = $AA     

            Dim I As Byte
            Dim Address As Byte

            DelayMS 500

            Address = 5
            
Loop:       HSerOut ["Transmitting data", 13, 10]

            ' Give the receiver a little time to "wake up" and adjust its AGC
            SerOut RTX,BAUD_2400_8N1,[Preamble,Preamble,Preamble] ' Sync Transmitter and receiver

            SerOut RTX,BAUD_2400_8N1,["RWI",Address,"The rain in Spain falls mainly on the plain... ABCDEFGHIJKLMNOPQRSTUVWXYZ", 13, 10]
            DelayMS 10000
            GoTo Loop 
             
            End
And the counterpart receiver code...
Code: Select all
            ' Receiver test code
            Device 16F876A
            
            XTAL          = 20
            ALL_DIGITAL   = TRUE        
            HSERIAL_BAUD  = 9600

            
            Symbol RRX = PORTC.0
            
            Symbol BAUD_300_8N1  = 19697
            Symbol BAUD_600_8N1  = 18030
            Symbol BAUD_1200_8N1 = 17197
            Symbol BAUD_2400_8N1 = 16780
            Symbol BAUD_4800_8N1 = 16572
            
            Symbol Preamble = $55    
            Symbol Sync     = $AA     

            Dim I As Byte
            Dim Address As Byte
            Dim SERDATA[76] As Byte
            Dim WaitString As Byte
            Dim Timeout As Byte
            
            
            DelayMS 500

          
            HSerOut ["Ready to receive data...", 13, 10]
                          
Loop:       Clear SERDATA
            SerIn RRX, BAUD_2400_8N1, 2000, Loop, [ Wait( "RWI" ), Address, Str SERDATA]
            HSerOut [Dec Address, " ", Str SERDATA, 13, 10]
            GoTo Loop 
            
            End
If you can get your receiver to generate output only in the presence of an actual signal, you'll be well on the way to getting things working.