I built a receiver and transmitter using two 89C51 atmel devices and the RLP/TLP434A pair.
The transmitter works perfectly. In the receiver, the 89C51 does not seem to detect the start bit from the RLP434A, however it does work when RLP module is bypassed and the data is sent from the PC.
I programmed the receiver code to turn on an LED and buzzer when the right packet was received. I checked the hardware and it is working.
I also did this same thing with a couple of avr 90S8515.
With the avr’s, both transmitter and receiver work well. With the 89C51, only the transmitter works.
If I hook up the receiver board to a terminal, and send the packet, the buzzer & LED operate, so I know the uart configuration is correct. I tried the avr chip in the receiver board (a few small mods to the reset circuit) and it works perfectly, so I know the hardware is good.
So I know my software is good, and the hardware works only with the avr chip, NOT THE 89C51.
Is there something missing like maybe some noise filtering capacitors, maybe some pullups, pulldowns that may be needed in the older 8051 device?
The avr does not need these, and it works perfectly.
If anyone has any ideas I would certainly appreciate it.
I’m thinking that there is a compatibility problem with the UART in the 89C51. Assuming that you have it correctly initialized, the signal waveform (duty cycle/timing) may be out of tolerance for the chip. If you search the forum, you will see a discussion (along with sample waveforms) that show the problem. Another thing to consider is that these receivers generate random output due to signal noise. This can play havoc with the hardware UART if it expects a nice clean waveform with the proper timing.
Things to try: 1) Confirm that the UART is configured properly, 2) If you are using a hardware UART, try a software UART (bit-bang) approach. Software UARTs are not as limited to the timing windows, and/or 3) Use the RSSI/Analog output of the receiver if it has one to create a squelch circuit so the receiver won’t output data until the transmitter is active.
There are many posts on getting these RX/RX pairs working, and I’m sure that you will be able to find something that will help you.
riden:
If you search the forum, you will see a discussion (along with sample waveforms) that show the problem.
I really did search and came up with nothing. Lots of stuff on PIC and AVR, but nothing on 8051.
riden:
Things to try: 1) Confirm that the UART is configured properly,
I did this by bypassing the RLP434A module and sending data from the terminal and echoing it back to the terminal. The uart is configured perfectly @ 2400 baud. (I also tried 1200 baud, and 4800 baud) they all work perfectly with the terminal and nothing happens with the module.
riden:
2) If you are using a hardware UART, try a software UART (bit-bang) approach. Software UARTs are not as limited to the timing windows
I also tried a software bit-bang 8051 routine. Same thing. Works perfectly with the terminal and nothing happens with the RF module.
riden:
and/or 3) Use the RSSI/Analog output of the receiver if it has one to create a squelch circuit so the receiver won’t output data until the transmitter is active.
I am not sure what you mean. Can you direct me to a schematic or some more information regarding this? I can only go by the datasheet (which is one page, kind of a joke)
Just to remind you that the module works PERFECTLY with an avr installed in the same circuit. All I have to do is change the reset circuit and it works with my avr code. As soon as I switch to 89C51, the module does not work.
I checked the module output with my scope and there is nothing. The pin stays high all the time.
So I know my hardware is working and I am sure the software is working.
Maybe the older 8051 device might need some noise filtering.
I am sure someone else ran into this problem and hopefully can provide some advice.
johnsmith123:
I checked the module output with my scope and there is nothing. The pin stays high all the time.
That is the problem with these RF modules (well, maybe not a problem, as they were designed that way, its only a problem if you don’t know how to use them).
These modules are always[/i] receiving, thus, picking up all noise in the area and spewing it out to you. There are many posts on this forum that address how to deal with this problem. Some deal with how to address it using hardware UART features, some resorting to purely software implementations, some using external hardware (ie squelch circuit + UART or software or both). There are many different ways to make this work. All I can suggest is to search the forums for [RLP/TLP or RF or the likes, and read all the threads until you know what the problem is. You can’t begin to address the problem if you don’t know what the problem is. Here’s a list of threads, not necessarily specific to your processor, but there are many posts about the problem you are having: viewtopic.php?t=6017 viewtopic.php?t=5348 viewtopic.php?t=7990 Hope this helps! -Nate P.S. - Note, I remember reading somewhere that some of the receiver modules have the analog output and the digital output tied together. I’m not sure if this means that they are both digital outputs, or both analog outputs, or if it is even true, but I thought I’d mention it before I forgot.](http://forum.sparkfun.com/search.php?mode=results&search_keywords=RLP)
johnsmith123:
I also tried a software bit-bang 8051 routine. Same thing. Works perfectly with the terminal and nothing happens with the RF module… Can you direct me to a schematic or some more information regarding this?
That means that building a squelch circuit won’t solve your immediate problem. FYI, [here is a schematic from Mondo-Technology that illustrates what I’m talking about. It only works if your receiver has an “analog”, “RSSI”, or signal strength output. The threshold is set so that random noise will not toggle the output pin.
johnsmith123:
Just to remind you that the module works PERFECTLY with an avr installed in the same circuit… As soon as I switch to 89C51, the module does not work. I checked the module output with my scope and there is nothing. The pin stays high all the time.
I assuming that you have made no changes in the wiring of the receiver (i.e., other than the output pin, everything is wired exactly the same). This leaves me perplexed. I’d remove the 89C51 from the equation. Take the output pin from the receiver (in the 89C51 configuration), tie it to ground through a 10k resistor, and observe the signal with the oscilloscope. You should see data. If you don’t, be sure you have both VDD lines of the receiver connected to +5 volts. Another (less likely) situation is that you have one of the receivers that has pin 6 configured as an enable line. I encountered exactly one receiver in a lot that had one – the silk screen had E/D instead of GND. My PCB had pins 6 and 7 tied to ground and that disabled the output of the receiver leaving the output at 5v all the time. I tied pin 6 to 5v via a 10k resistor and all was well.
Next connect the output of the receiver to the 89C51 and the data should still be there. If it isn’t (and it sounds like it won’t be), perhaps the output pin is configured as an output or something else is pulling the output to logic 1.](http://mondo-technology.com/crickr.gif)
riden:
I’d remove the 89C51 from the equation. Take the output pin from the receiver (in the 89C51 configuration), tie it to ground through a 10k resistor, and observe the signal with the oscilloscope. You should see data.
What a good idea. I didn’t think of that.
riden:
Next connect the output of the receiver to the 89C51 and the data should still be there. If it isn’t (and it sounds like it won’t be), perhaps the output pin is configured as an output or something else is pulling the output to logic 1.
Ok so I pulled the 89C51, checked it with the scope, and there is data there. ( i knew the receiver WAS working) As soon as I plug in the 89C51, the data line goes to 5V and stays there. This leads me to believe that somehow the 8051 microcontroller is pulling the line high. This does not happen on the avr.
Presently I am using the bit-bang serial routines for reception.
Now the data pin (P3.0) is configured as an input. The code writes FFh to all of port3 on start up. Its not like the avr where you can separately configure inputs or outputs using Data Direction Registers.
I tried clearing P3.0 but it does not work. I also tried a 4.7K pullup, then a pulldown resistor, same thing - nothing. I even tried other 89C51’s, 89C52’s, 89C51ED2, a Dallas microcontroller, every 8051 I had here, nothing is working, line is still high. It does receive data when I connect the data line to the max232 just not from the RF module. I am removing the Max232 when it is not being used just to be sure there is no extra noise that may cause grief.
Well If anyone else has some great ideas I would appreciate it. I am all out and I am running out of hair to pull.
Thanks to everyone for their great ideas. I hope someone had a similar experience they can share their outcome.
This may be old information to you, but unlike a PIC whose ports default to inputs, the 8051 I/O pins default as outputs and need to be initialized to be used as inputs. Here is a paper that discuss the process: http://www.edsim51.com/8051Notes/8051/p … Ouput.html. If you still are having problems, I might be able to power up a 89C52 board that I have and give it a whirl. It depends on how busy I get over the weekend.
riden:
This may be old information to you, but unlike a PIC whose ports default to inputs, the 8051 I/O pins default as outputs and need to be initialized to be used as inputs. Here is a paper that discuss the process: http://www.edsim51.com/8051Notes/8051/p … Ouput.html. If you still are having problems, I might be able to power up a 89C52 board that I have and give it a whirl. It depends on how busy I get over the weekend.
I am 100% positive that the hardware is set up correctly. IF any of the 8051 pins were not connected correctly(i.e reset circuit or EA pin to 5V) then the software would not work when echoing the bytes back to the PC.
I am also sure that the software is configured correctly because it works when I connect the max232 circuit.
I see no way to upload a schematic of my circuit here. There is a problem with the I/O pin going low (detecting the start bit).
I have never seen any 8051 code for these modules, OR any schematics anywhere on the net. Lots of guys asking for help but never any code or schematics posted.
P.S. - Note, I remember reading somewhere that some of the receiver modules have the analog output and the digital output tied together. I’m not sure if this means that they are both digital outputs, or both analog outputs, or if it is even true, but I thought I’d mention it before I forgot.
That's correct. The 4800 baud modules that I got from SFE have the same (digital) signal on both pins.
Regarding the 89C51 problem:
From what I understand in this thread, everything works except the case of the RLP module driving the RX input of the C51.
Perhaps there is voltage signal-level difference that the C51 is sensitive to. Or perhaps the rise/fall times of the bits is a problem.
You could try inserting a non-inverting buffer between the RLP and C51. Make sure the buffer’s Vcc is connected to the C51’s Vcc (don’t use separate power rails). I’d probably use a Schmitt trigger type of buffer. The AVR may have Schmitt inputs built-in (like many PICs), and perhaps the C51 doesn’t…
From what I understand in this thread, everything works except the case of the RLP module driving the RX input of the C51.
yes that is correct.
saipan59:
Perhaps there is voltage signal-level difference that the C51 is sensitive to. Or perhaps the rise/fall times of the bits is a problem.
You could try inserting a non-inverting buffer between the RLP and C51. Make sure the buffer’s Vcc is connected to the C51’s Vcc (don’t use separate power rails). I’d probably use a Schmitt trigger type of buffer. The AVR may have Schmitt inputs built-in (like many PICs), and perhaps the C51 doesn’t…
Pete
I have a 7407 non-inverting buffer lying around, I’ll give that a try. I’ll bet that it would work with a Holtek decoder/encoder pair, but I wanted to get away with the least amount of components.
Thanks for you help. I will try the buffer and let you know the outcome.
OK - note that a 7407 is open-collector, so you will need to add a pullup resistor (try 1K or so). Also, it is not a Schmitt input, but it’s still worth a try.
brother john smith i connected the circuit according to yr given zip file(i downloaded it from edaboard yr link is not working) but at receiver’s end i am receiving garbage. basically i am using transmitter tlp434A and receiver rlp434 with AT89c51 at receiver’s and at transmitter’s end as well .i want to transmit (just testing) digit 18 (converted to ASCII,from binary).when i conect the TXD pin of MCU (at transmitter’s end) with the Rxd pin of mcu (at receiver’s end with a wire).it perfectly transmit didgit 18 and is displayed on lcd perfectly but when i tranmit it by using tlp434 with rlp434 receiver,so digit is not displayed on lcd plz help me