AnimalCrew:
I have a 434Mhz transmitter and Receiver pair. A 8946 and a 8950. Can I expect to be able to send serial out commands that I have been sending to an LCD panel to the transmitter data pin and receive the same data on the receiver to pass to a remote panel?
In theory, yes. I’m doing this right now with that pair using a couple of PSoCs at ~1200bps and 5V.
There are caveats though: These devices are strictly ASK. There’s no intelligence in the transmitter to do things like CD (carrier detect) before transmitting. The receiver ramps up the gain depending on the received signal strength and, if you look at the receiver output when you’re not transmitting, you’ll likely see it toggling like crazy due to noise etc. Just as the TX has no brains, this is also the case with the RX. It’s simply “listening” at 434MHz and is outputing what it sees. When the gain is high, you’re going to see a lot of noise being received. Your firmware has to deal with this.
So:
-
What are you using for antennas on the TX and RX?
-
What’s the physical separation between the TX and RX? Are there any obstacles (e.g. walls) the signal must pass through?
-
Are you using any sort of “framing” and synchronization in your firmware?
To point #3, you can’t really expect to send a sequence of bytes from one point to another without (a) framing it and (b) error checking it. By framing I mean adding stuff to your TX protocol to help the RX align itself to your transmitter. This might be sending a break character before your message. For example, in my project, I have a state-machine in F/W that does the following:
State 0: TX_SET_TX
- connect the TX to the transmit pin and set timer for 25mS idle line
State 1: TX_XMIT_PRIME
- wait for 25mS idle line to finish
State 2: TX_RECV_GAIN_ADJ
- send 5 0xF0 characters to get RX to adjust its gain
State 3: TX_PREAMBLE
- send message preamble character (0xA5)
State 4: TX_SRCID
- send the source ID byte (i.e. the address of the transmitter…e.g. 0x23)
State 5: TX_SEND_DATA
State 6: TX_SEND_CHECKSUM
- send the message checksum (sum of preamble + source ID + data)
State 7: TX_SEND_POSTAMBLE
- send a 0x5a postamble as a framing character
State 8: TX_CLEANUP
- when last character gone, disconnect TX from transmitter, reset state machine etc…
Your message structure may be different but the idea is that you first get the attention of the receiver, you send your message with some framing and you add a checksum or CRC. The receiver must see the preamble, recognize the source ID (in my case), the checksum must be good and it must see the postamble. This provides a pretty robust message for a simple project like I’m working on.
I should mention that in my project, I don’t want to tie up the 434MHz band in my little area all the time so I disconnect my TX from the transmitter when it’s not actually required. UART TX pins idle high which is the transmit state for the transmitter. By adding a pull-down to the data line and disconnecting it, I can free up the band for other devices. This is one reason I need a couple of states to establish my TX presence and to allow the receiver to adjust its gain. Because it’s relatively close-by, the TX dominates the band and the RX gain goes way down, reducing the amount of noise it sees.
Because the RX is not coupled to the TX and doesn’t know when it’s transmitting, the RX needs to be ready to deal with all the noise and crap that the receiver will see in high-gain. You’ll be getting a lot of framing, overrun and noise errors. You simply need to (a) make the RX ISR fast and (b) look for a valid, error-free preamble…
If so, I can’t make it work and I have tried 1200 and 2400 baud. I get nothing at all.
Do you mean you’re not receiving any characters at all or the message is garbled or … ?
Do I need to convert these signals with max232 chip first?
Nope. I run my TX and RX at 5V and have them directly connected to the PSoC UART pins.