PDA

View Full Version : RF Modules



tonyfelloni
- 18th October 2008, 18:35
Hey

I have 2 wireless RF Transceivers. The datasheet states that the baud rate is 19200 and that it is customizable. It mentions nothing about how to change it.

What i'm unsure about is if the baud rates I am using for my serout and serin commands need to match the Rf modules baud rate, or does the baud rate setting on the transceivers just control the rate of data from one module to another allowing me to feed in whatever baud rate I like no matter what the modules are set to.

Cheers

Tony

mackrackit
- 19th October 2008, 02:39
Hey,
You forgot to tell the make, model, and mileage of the modules ;)

tonyfelloni
- 20th October 2008, 00:53
Hey cheers for the reply.

Sorry for not posting the data sheet. I thought it was more of a general question assuming most RF module opperate in a semi similier manner. As for the make and model, there pretty much a no name device, I bought them off ebay, model Cy2198TR-a. Have attached the data sheet that came with them.

Best Regards

Tony

http://www.sure-electronics.net/rf,audio/GP-GC010.pdf

skimask
- 20th October 2008, 05:06
http://www.sure-electronics.net/rf,audio/GP-GC010.pdf
That datasheet pretty much blows IMO. Looks to me like a car owners manual...doesn't tell you how to overhaul the engine, just what the car is supposed to do.
Any other data around for this module?

mackrackit
- 20th October 2008, 07:28
I thought it was more of a general question assuming most RF module opperate in a semi similier manner.
That would be to easy. Some transmit the data as it is received no matter what the baud with out configuring (up to a point) and others can/need be configured.

The data sheet you have does not help.
Maybe Dave Houston will see this thread, he has a loot of experience with RF and maybe he has seen this one before.

Is this what it looks like?
http://www.sure-electronics.net/rf,audio/GP-GC010_1_b.jpg

RussMartin
- 20th October 2008, 07:56
That's fairly sparse as far as a useful data sheet. (It's also a good example of why I don't purchase a module or component until after I've seen its data sheet!)

Lacking more specific information, you can probably assume default channel, mode, and baud rate at startup. I wouldn't count on much of a buffer, so stick to 19,200 and try it that way.

Luciano
- 20th October 2008, 09:36
Hi,

(what I understand from the manual).
http://www.sure-electronics.net/rf,audio/GP-GC010.pdf

The baud rate is 19200. The module has a TX buffer of 64 bytes.
When you send, the data (up to 64 bytes) is stored first in the
TX buffer of the module and then, 10ms after that the last byte
has been received, the data is automatically sent. The duration
of the transmission depends on the quality of the RF link and the
number of bytes that you have in the buffer. Use the "Busy" output
to see when the transmission task has been completed and the buffer
is ready to receive the next data packet.

The word "customizable" probably means that you can order modules
with a different baud rate in case your device is not able to
use the baud rate 19200. (Probably a minimum quantity will apply
for this special firmware).

The module can use one of 64 channels. Make sure that both modules
use the same channel.

Best regards,

Luciano

tonyfelloni
- 20th October 2008, 16:41
Is this what it looks like?
http://www.sure-electronics.net/rf,audio/GP-GC010_1_b.jpg

That's the one alright!

Thanks for all the input.
I have managed to get these working, they will only work when the baud rate is set to 19200 and the DEFINE HSER_TXSTA must be set to 24h when working off a 4Mhz Crystal.

Thanks

Tony

Pedro Santos
- 10th January 2009, 16:25
Hello tonyfelloni

I look for a similar wireless solution. What you say about this moduls? Work´s good? It's hard to use it? Have you a sample code that works that you can share?

Thanks
Best regards
Pedro

tonyfelloni
- 11th January 2009, 02:36
Hi Pedro

The modules I used were cheap as chips and I have found them quite reliable...I would reccommend them all the way, the instructions are crap but the comments above are completely accurate and will iron out any issues you may have. You need to use a PIC that has a hardware USART such as 16F88 as the RF modules only run at a baud of 19,200 and with picbasic only the Harware USART can achieve this.

Apart from that if you can't follow the instructions written by some asian dude in a language fit for a 12 year old get back here and ill try help you out with any problems u may have.

Tony

tonyfelloni
- 11th January 2009, 02:40
Luciano's analysis of the modules is 100% by the way.

Tony

Pedro Santos
- 11th January 2009, 14:28
Hi tonyfelloni

I will get 2 pieces to test it and if i have problems to run it i ask for your help

Thank You

Best regards
Pedro

Bruce
- 11th January 2009, 14:44
FYI. DEBUG can send serial data at 19200 with a 4MHz oscillator, and you can use most any I/O-pin.

@ DEVICE PIC16F627A, WDT_OFF, MCLR_OFF, LVP_OFF

DEFINE OSC 4
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 2
DEFINE DEBUG_BAUD 19200 '38400
DEFINE DEBUG_MODE 0 ' 1 = inverted, 0 = true

Main:
DEBUG "Testing 19200 bps @ 4MHz",13,10
PAUSE 1000
GOTO Main

Pedro Santos
- 11th January 2009, 16:30
Hello Bruce

tonyfelloni said that it must use the hardwareUart from the pic. I not understand why.
Perhaps a buffer problem why it not function with SoftUart?
The modul hande up to 64 bytes, is this why must use the hardwareUart

Regards
Pedro

Bruce
- 12th January 2009, 22:48
You need to use a PIC that has a hardware USART such as 16F88 as the RF modules only run at a baud of 19,200 and with picbasic only the Harware USART can achieve this.

My guess would be he didn't know DEBUG would work at 19200.

tonyfelloni
- 13th January 2009, 13:52
Correct, I wasnt aware of this....but now I know! :-)

Cheers

DanPBP
- 23rd April 2009, 10:50
Hello Tony,

Could you please post an example on how to send and receive data with these modules?

Thanks!

Daniel.

tonyfelloni
- 24th April 2009, 00:48
Hi Daniel

Using these modules is the same as communicating between two pics if there was a wire connecting them.

Below is the code the sending module is attached to, I have removed all unnecessary code and left all the defines etc so you can copy them exactly see if it works.




'************************************************* ***************
'* Name : Sensirion SHT71.pbp *
'* Author : Tony Flynn *
'* Notice : Copyright (c) Tony Flynn *
'* : All Rights Reserved *
'* Date : 30/10/2008 *
'* Version : 7 - Code transmits TempC, TempF, RH & Time to *
'* PICS on the network and serially to the PC *
'* Notes : *
'************************************************* ***************

'------------------------- Port Assignments --------------------------------

' PORTA.0 (02) Time flag pin from user interface, make pin input and pull to gnd (26)
' PORTA.1 (03) Serin time + all other settable parameters from User Interface (07)
' PORTA.2 (04) Serout to PID Controller (17)
' PORTA.3 (05)
' PORTA.4 (06)
' PORTA.5 (07) Serout to Ethernet - Must select HS OSC on this module &
' Ethernet PIC. Also non-inverted both sides. (38)
' PORTB.0 (21) Interrupt Pin Square wave from DS1307 (07)
' PORTB.1 (22) SHT11 SCK Clock Pin (03)
' PORTB.2 (23) SHT11 Serial Data Pin (02)
' PORTB.3 (24) RS232 Serial Out to PC (Obsolete, moved to PID)
' PORTB.4 (25) Power Failure pin (Obsolete, moved to PID)
' PORTB.5 (26) Hatch Status pin (Obsolete, moved to PID)
' PORTB.6 (27) ICSP Pin 5
' PORTB.7 (28) ICSP Pin 4
' PORTC.0 (11)
' PORTC.1 (12)
' PORTC.2 (13)
' PORTC.3 (14) I2C Clock Line SCL DS1307 - 4k7 Pull up resistor (06)
' PORTC.4 (15) I2C Data Line SDA DS1307 - 4k7 Pull up resistor (05)
' PORTC.5 (16)
' PORTC.6 (17) USART TX Pin to wireless transceiver (03)
' PORTC.7 (18) USART RX Pin

'********************** 16F876A Configuration Fuses ****************************

@ DEVICE HS_OSC
' Crystal Selected (High Speed is above 4MHz)
@ DEVICE WDT_ON
' Watch Dog Timer is on - Needed for SLEEP command
@ DEVICE PWRT_OFF
' Power Up Timer off, unit stays in reset for 72ms allowing Vdd to settle
@ DEVICE BOD_ON
' Brown Out Detect on
@ DEVICE LVP_OFF
' Low Voltage Programming off
@ DEVICE CPD_OFF
' Data EEPROM code protection
@ DEVICE WRT_OFF
' Write to Flash protection off
@ DEVICE DEBUG_OFF
' On board Debugger off
@ DEVICE PROTECT_OFF
' Protects code from being read from the chip


'************************************************* ******************************

'--------------------------- Setup DEFINE's ----------------------------------

include "modedefs.bas" ' Contains Serout Baud rates
DEFINE OSC 12 ' Using 12 MHz Oscillator
DEFINE CHAR_PACING 1000 ' Pacing for serout Chars
DEFINE HSER_RCSTA 90h ' enable hardware serial port
DEFINE HSER_TXSTA 24h ' enable high speed transmit (Burgh=1)
DEFINE HSER_BAUD 19200 ' set the baud rate for MIDI communications

'------------------------ Port Initialization -------------------------------

CCP1CON = %00000000 ' Disable CCP Module
ADCON1 = %10000111 ' Set analog ports to digital mode, right justified
CMCON = %00000111 ' Turn off comparator
OPTION_REG.6 = 0 ' Interrupt on falling edge of RB0/INT pin
OPTION_REG.7 = 0 ' PORTB Pullups enabled
INTCON = %10010000 ' Global and RB0 Interrupts enabled
TRISA = %000001
TRISB = %00000111
TRISC = %00000000

'----------------------------------USART----------------------------------------

USART: ' Data sent to the wireless transceiver for remote module
pause 5
hserout [$55,$55,$55,$55,"TC",TempC.lowbyte,tempc.highbyte,TempF.lowbyte,TempF. highbyte,RHTempComp.lowbyte,RHTempComp.highbyte]
Return



Then the code on the receiving module is:




'************************************************* ***************
'* Name : Monitoring Station - Rev 1 *
'* Author : Tony Flynn *
'* Notice : Copyright (c) 2008 Tony Flynn *
'* : All Rights Reserved *
'* Date : 29/10/2008 *
'* Version : Rev 3 - Components removed for low power op *
'* Notes : Wireless minitoring station using 16F88 and *
'* wireless module Cy2198TR. Data is displayed on *
'* LCD. System operates at 4MHz. Data is beamed to *
'* this module from other transceiver. Line into *
'* other transceiver is non inverted USART from PIC *
'* line into this PIC also non-inverted. Unit is *
'* Designed to run off 3 AA Alkaline batteries. *
'* *
'************************************************* ***************


'------------------------- Port Assignments --------------------------------

' PORTA.0 (17) LCD Data Line - Bit 4
' PORTA.1 (18) LCD Data Line - Bit 5
' PORTA.2 (01) LCD Data Line - Bit 6
' PORTA.3 (02) LCD Data Line - Bit 7
' PORTA.4 (03) LCD Data Line - Register Select - 10k pullup resistor to VDD
' PORTB.0 (06) HPWM out to dim LCD light to off after X seconds
' PORTB.1 (07) Button to turn on display for X time
' PORTB.2 (08) Seiral Data in from wireless module. Wireless module voltage
' should be no greater than 1.5V less than MCU (5V). Tx from
' transceiver links directly to Rx of PIC.
' PORTB.3 (09) LCD Data Line - Enable
' PORTB.4 (10) Wireless module Enable active low, High = low power mode.
' PORTB.5 (11) Alarm Out pin

'************************ 16F88 Configuration Fuses ****************************

@ DEVICE PROTECT_OFF
@ DEVICE CCPMX_OFF
@ DEVICE DEBUG_OFF
@ DEVICE WRT_OFF
@ DEVICE CPD_OFF
@ DEVICE LVP_OFF
@ DEVICE BOD_ON
@ DEVICE MCLR_OFF
@ DEVICE PWRT_ON
@ DEVICE WDT_ON
@ DEVICE XT_OSC
@ DEVICE2 IESO_OFF
@ DEVICE FCMEN_ON


' Code Protection - _CP_OFF, CP_ON
' CCP1 Pin Selection - _CCP1_RB0, _CCP1_RB3
' In-Circuit Debugger Mode - _DEBUG_OFF, _DEBUG_ON
' Flash Program Memory Write Enable - _WRT_PROTECT_OFF, _WRT_PROTECT_256, _WRT_PROTECT_2048, _WRT_PROTECT_ALL
' Data EE Memory Code Protection - _CPD_OFF, _CPD_ON
' Low-Voltage Programming Enable - _LVP_OFF, _LVP_ON
' Brown-Out Reset - _BODEN_OFF, _BODEN_ON
' RA5/MCLR/Vpp Pin Function - _MCLR_OFF, _MCLR_ON
' Power-Up Timer - _PWRTE_OFF, _PWRTE_ON
' Watchdog Timer - _WDT_OFF, _WDT_ON
' Oscillator Selection - _EXTRC_CLKOUT, _EXTRC_IO, _INTRC_CLKOUT, _INTRC_IO, _EXTCLK, _HS_OSC, _XT_OSC, _LP_OSC
' Oscillator Switchover - _IESO_OFF, _IESO_ON
' Fail-Safe Clock Monitor - _FCMEN_OFF, _FCMEN_ON

'************************************************* ******************************

DEFINE OSC 4 ' tell program we are using a 4mhz oscillator
DEFINE HSER_RCSTA 90h ' enable hardware serial port
DEFINE HSER_TXSTA 24h ' enable high speed transmit (Burgh=1)
DEFINE HSER_BAUD 19200 ' set the baud rate for MIDI communications
define HSER_CLROERR ' Auto clear overflow buffer error.


CCP1CON = %00000000 ' Disable CCP
SSPCON.5 = 0 ' Disable SSP Module
ANSEL = %00000000 ' Set analog ports to digital mode
CMCON = %00000111 ' Turn off comparator
TRISA = %100000 ' Port A I/O Selection
TRISB = %11110110

Display:
low lowpower ' Disable lower power operation
pause 15 ' Give module time to wake
Hserin[WAIT("TC"),TempC.lowbyte,tempc.highbyte,TempF.lowbyte,tempf .highbyte,RHTempComp.lowbyte,RHTempComp.highbyte]
high lowpower ' Set wireless tranceiver to low power mode




I used the Hserin command as I could set this to the required baud. At the time I was unaware that the Debug option could be used. I am still using this setup today an it hasn't caused me any trouble at all.

An initial problem I had was that the voltage on one of the modules was slightly on the low side and wasn't working. It worked fine once this was sorted. I havent used any inverters or the like. Serial data sent from the pin of one pic is fed into pin 3 (RX) of the wireless module through a 1k resistor, then on the other side pin 4 (TX) of the module is fed directly to the pic, no resistor.

Hope this helps, it took me a while to get them going first!

Tony

DanPBP
- 24th April 2009, 02:21
Thank you very much! I'll order these modules today, test them, and let you know. ;)

Daniel.

DanPBP
- 30th April 2009, 09:11
Hi Tony,

One short question, on the eBay webpage it says:

Running voltage: 2.2-5.4V

On the PDF file it says:

PIN1: VCC +2.4 to +4.2

How many volts are you using to power up this RF module?

Because getting 5 volts is easy, less volts it's a little more complicated. :)

Thanks!

Daniel.

tonyfelloni
- 1st May 2009, 00:21
Hi Danny

I have mine powered from the 5 volt supply through 2 diodes
these drop the voltage by about 0.6v each, works fine like this.

Regards

Tony

ruijc
- 14th June 2009, 17:44
The modules I used were cheap as chips and I have found them quite reliable...I would recommend them all the way

Well,

i've been working with them all week with NO success!

I've tried using DEBUG/DEBUGIN, SEROUT/SERIN and HSEROUT/HSERIN.

I have 99% confidence in my code because it works when both pics are connected to each other.

Using these modules just doesn't work and i'm out of solutions ! :confused:

DanPBP
- 14th June 2009, 21:39
Did you try Tony's code? Are you using +2.4 to +4.2 volts to power it up?

ruijc
- 14th June 2009, 23:07
Hello danielhr77,

thank you for your support.

Tony's code is just a sample and not the entire code, but Yes...i did tried the the Serin/Serout lines on my code and didnt worked!

I'm using 4,24V on both RX and TX modules to power them up.

Have you got these modules also ?
Were you able to use them correctly ?

DanPBP
- 15th June 2009, 10:42
I bought them but I haven't tried them yet... Next month I'm going to test them with my application...

I don't know if 4.24 volts is fine, maximum is 4.20 according to the manual, just in case to test, add a diode to reduce it a little.

A few questions to rule things out:

1) Are you enabling them? (pin 5 active low)
2) Are you using a 1k resistor between the PIC and RX (pin 3)?

That's all right now, it's 6:30 in the morning and I'm going to bed... :)

ruijc
- 15th June 2009, 18:25
Hi danielhr77,

Followed your guide lines...



add a diode to reduce it a little.

Done...result is the same



1) Are you enabling them? (pin 5 active low)

Yes...i'm using pin5 low



2) Are you using a 1k resistor between the PIC and RX (pin 3)?

I wasnt...but i just tested this also and the result is the same :(

Also, i programmed on both modules the channel like:


DEBUG $af, $20


If you remember any other pointer for me to check i will be gratefull

My best regards

DanPBP
- 16th June 2009, 09:44
Hmm... Do you have the correct baudrate? There's nothing else I can think of, maybe Tony has more ideas...

ruijc
- 16th June 2009, 12:18
Yes...19200 on both

I'm too without ideas. :(

If someone has any suggestions i would be gratefull.

Archangel
- 16th June 2009, 18:40
Also, i programmed on both modules the channel like:


DEBUG $af, $20



Did you Pull pin 8 low before sending data and return it to High after? And did the module respond the way the Almost_A_Data sheet said ?

ruijc
- 16th June 2009, 21:25
Hi Joe S. and thanks for your help,

Yes i did...I have a led connected to each one. The modules ( after sending the channel number ) light up the leds for a second confirming the channel change.

Archangel
- 17th June 2009, 01:46
Are you using a max232 or similar between the transceiver and the PC or between the other transceiver and the PIC ? The PIC operates in the 8N1 True mode and should have a pull up resistor on it's line, whereas the PC operates in the 8N1 Inverted mode and requires a level shifter to make it true.

ruijc
- 17th June 2009, 09:10
Hi Joe S.,

the modules are connected directly to the pics.

One thing i noticed and i found it weird is that when turning the power on the receiver ( and always the RX - never happened to the TX ) sometimes does not start receiving ( although the TX is transmitting ).

My workaround is to turn power off for a couple of seconds and reconnect power ( and sometimes i have to do this 2 or 3 times ).

I changed modules, experiment board, etc and this only happens on the RX side.

Should it be any startup procedure sequence for the RX ?

Archangel
- 17th June 2009, 19:42
I changed modules, experiment board, etc and this only happens on the RX side.

Should it be any startup procedure sequence for the RX ?
Not sure if you mean the PIC or the transceiver. The PIC RX using HSERIN <font color=red>REQUIRES a pullup to VDD </font color>or you will get an intermittent (if at all) PIC boot. If this causes problems with the radio, you can use something to buffer the link, Tristate buffer ? I discovered this a long time back with my serial LCD project. You could "buffer" it with a simple transistor, but would then be dealing with inverted serial data.

ruijc
- 17th June 2009, 19:55
I mean the transceiver.
I have a LED connected to BUSY output of the transceiver on both ( RX and TX modules ).
The RX transceiver blinks the LED everytime the TX sends data. But this doens not mean the PIC shows the correct DATA on LCD ( sometimes no DATA at all ).

And sometimes when powerup, the RX transceiver does not blink ( pic and LCD working OK ).

I'm using DEBUG/DEBUGIN instructions to avoid issues with Hserin/Hserout.

Archangel
- 17th June 2009, 20:14
OK then maybe you need more hysteresis to your power up cycle, which is to say the rate the voltage ascends from zero to operating voltage. Many MCU do not like slow power up, which is why PIC has PWRTE in the configs, it allows power to stabilize before PIC boots, or there may be RF running in on the power causing headaches, you did bypass the power leads with .01 &micro;F caps yes? A ferrite bead there wouldn't hurt either.

And sometimes when powerup, the RX transceiver does not blink ( pic and LCD working OK ).

I'm using DEBUG/DEBUGIN instructions to avoid issues with Hserin/Hserout. Be mindful of the Port Idle state, whether using hserin or debugin, True is supposed to Idle high and Inverted is supposed to idle low. So use the state which agrees with your receiver's requirements.

ruijc
- 17th June 2009, 22:07
Hi Joe,

I'm using the same power supply for both.

I'm using a 7805 with 220uF cap and 2 diodes to lower the VCC to the transceivers.

About the port idle state...good call :)

i've set the port pins high at the beginning of the code for both ( TX and RX pics ) but the result is still the same :(

Archangel
- 18th June 2009, 00:11
Hi Joe,

I'm using the same power supply for both.

I'm using a 7805 with 220uF cap and 2 diodes to lower the VCC to the transceivers.

About the port idle state...good call :)

i've set the port pins high at the beginning of the code for both ( TX and RX pics ) but the result is still the same :(
Setting them high is not enough, use pullup or pulldown resistors, depending on what state is required.

ruijc
- 18th June 2009, 11:22
Hi Joe,

I've placed 0.1uF caps on each transceiver VDD and GND pins.

Also placed a resistor on the receiver side as a pullup for the RX pin.

Still i get intermittent and incomplete data :(

Archangel
- 18th June 2009, 20:01
Hi Joe,

I've placed 0.1uF caps on each transceiver VDD and GND pins.

Also placed a resistor on the receiver side as a pullup for the RX pin.

Still i get intermittent and incomplete data :(OK, so then you are getting, some data. That's good. Does the receiver still fail to boot sometimes? If so, have you swapped the Tx/Rx modules to see if they both react that way? (SURE Electronics ) Seem like pretty easy to deal with vendors. Just in case there is hardware problems. If all of the above is TRUE, then I think you will need to reevaluate how you are sending data. You may need to add some character pacing scheme and or send data X # of times to insure reception.
Are you using Tony's code exactly as published here? If not may we see what you ARE using?
EDIT: I just loaded Tony's code . . . the half that he posted into MCS for examination . . . I hope you ARE using more than that, on account of there is no place in this where data gets loaded or stored . . . so let us see your code, please.

ruijc
- 18th June 2009, 21:33
Hi Joe,



Does the receiver still fail to boot sometimes?

No, so far so good ;)



You may need to add some character pacing scheme and or send data X # of times to insure reception.

Did that...well...sort of...

Here's the RX code


'************************************************* ***************
'* Name : RXDemo.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 01-06-2009 *
'* Version : 1.0 *
'* Notes : Demo for SureElectronics RF modules *
'* : 16F88 *
'************************************************* ***************

CCP1CON = %00000000 ' Disable CCP
SSPCON.5 = 0 ' Disable SSP Module
ANSEL = %00000000 ' Set analog ports to digital mode
CMCON = %00000111 ' Turn off comparator


TRISA=%00100000
TRISB=%00000100

'************************************************* ****************************
'DEFINEs
'************************************************* ****************************

DEFINE OSC 4

@ DEVICE PROTECT_OFF
@ DEVICE CCPMX_OFF
@ DEVICE DEBUG_OFF
@ DEVICE WRT_OFF
@ DEVICE CPD_OFF
@ DEVICE LVP_OFF
@ DEVICE BOD_OFF
@ DEVICE MCLR_OFF
@ DEVICE PWRT_ON
@ DEVICE WDT_ON
@ DEVICE XT_OSC

'************************************************* ****************************
' DEFINE LCD pins

DEFINE LCD_DREG PORTA
DEFINE LCD_DBIT 0

DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 1

DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 0

DEFINE LCD_BITS 4

DEFINE LCD_LINES 4 ' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines)
DEFINE LCD_COMMANDUS 2000 'lcd delay us
DEFINE LCD_DATAUS 50 ' Data delay time in us

'************************************************* ****************************
'debug defines

INCLUDE "modedefs.bas"
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 3
DEFINE DEBUG_BAUD 19200
DEFINE DEBUG_MODE 1
define DEBUGIN_REG PORTB
define DEBUGIN_BIT 2
define DEBUGIN_BAUD 19200
define DEBUGIN_MODE 1
DEFINE DEBUG_PACING 10000

'************************************************* ****************************
'PINS

adc var PORTA.0 '
a1 var PORTA.1 '
lcd1 var porta.2 '
lcd2 var porta.3 '
freq var porta.4 'pin8 of transceiver
BUT1 var porta.5 'Button1
xtal1 var porta.6 '
xtal2 var porta.7 '
B0 var portb.0 '
B1 var portb.1 '
RX var PORTB.2 ' out
TX var PORTB.3 ' in
lcd4 var portb.4 'Data pin for LCD
lcd5 var portb.5 'Data pin for LCD
lcd6 var portb.6 'Data pin for LCD
lcd7 var portb.7 'Data pin for LCD

'************************************************* ****************************
'variables

maximo var WORD 'maximum value detected
minimo var WORD 'minimum value detected
media var WORD 'average
mediac var WORD 'total of records received - average count
km var WORD 'PowerOn counter
MA var WORD '
MI var WORD '
ps4 var WORD '
value var WORD 'value received
medres var WORD 'value sum for avg math
ADDR var word
ra var word
time var word
timex var word
MYDATA var word

'contants
Row1 CON 128 'constant for LCD line1
Row2 CON 192 'constant for LCD line2
Row3 CON 148 'comstant for LCD line3
Row4 CON 212 'constant for LCD line4
cl con 254 'constant for LCD clear line


clear
'************************************************* ****************************

INCLUDE "lcdbarIN.bas"
DEFINE LCD4X20 1

'************************************************* **********
INIT:
high tx
high rx
pause 400
lcdout $fe,1," RX demo "
lcdout $fe,$c0," ... "
pause 1500
if but1=1 then
goto chann
endif

man:
lcdout cl,row1," adc ", dec value
lcdout cl,row2," media ", dec media

rec:
debugin [wait ("ok"),dec MYDATA]
lcdout cl,row4, "received - ",dec MYDATA," "

goto REC

chann:
low freq
pause 50
while but1=1
debug $af, $20
wend
goto man

'
end


and the TX code


'************************************************* ***************
'* Name : TXDemo.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 01-06-2009 *
'* Version : 1.0 *
'* Notes : Demo for SureElectronics RF modules *
'* : 16F88 *
'************************************************* ***************

CCP1CON = %00000000 ' Disable CCP
SSPCON.5 = 0 ' Disable SSP Module
CMCON = %00000111 ' Turn off comparator

TRISA=%00100001
TRISB=%00000100

'************************************************* ****************************
'DEFINEs
'************************************************* ****************************

@ DEVICE PIC16F88, HS_OSC
@ DEVICE PIC16F88, MCLR_OFF
@ DEVICE PIC16F88, PROTECT_OFF

DEFINE OSC 10

@ DEVICE PIC16F88, CPD_OFF
@ DEVICE PIC16F88, LVP_OFF
@ DEVICE PIC16F88, BOD_OFF
@ DEVICE PIC16F88, PWRT_OFF
@ DEVICE PIC16F88, WDT_OFF
@ DEVICE PIC16F88, CCPMX_OFF

'************************************************* ****************************
'ADC

DEFINE ADC_BITS 10 ' Set number of bits in result ( 8 or 10 bits )
DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS

'************************************************* ****************************

ANSEL=%00000001
ADCON1=%10000000 'no Vref - Right Justify
ADCON0=%11000001

'************************************************* ****************************
' DEFINE LCD pins

DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4

DEFINE LCD_RSREG PORTA
DEFINE LCD_RSBIT 3

DEFINE LCD_EREG PORTA
DEFINE LCD_EBIT 2

DEFINE LCD_BITS 4

DEFINE LCD_LINES 4 ' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines)
DEFINE LCD_COMMANDUS 2000 'lcd delay us
DEFINE LCD_DATAUS 50 ' Data delay time in us
'************************************************* ****************************
'debug defines

INCLUDE "modedefs.bas"
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 3
DEFINE DEBUG_BAUD 19200
DEFINE DEBUG_MODE 1
DEFINE DEBUGIN_REG PORTB
DEFINE DEBUGIN_BIT 2
DEFINE DEBUGIN_BAUD 19200
DEFINE DEBUGIN_MODE 1
DEFINE DEBUG_PACING 10000

'************************************************* ****************************
'PINS

adc var PORTA.0 'analog input
A1 var PORTA.1 '
lcd1 var porta.2 '
lcd2 var porta.3 '
freq var porta.4 'pin8 from transceiver
BUT1 var porta.5 'But1
Xtal1 var porta.6 'Xtal
Xtal2 var porta.7 'Xtal
B0 var portb.0 '
B1 var portb.1 '
RX var PORTB.2 ' in
TX var PORTB.3 ' out
lcd3 var portb.4 'Data pin for LCD
lcd4 var portb.5 'Data pin for LCD
lcd5 var portb.6 'Data pin for LCD
lcd6 var portb.7 'Data pin for LCD

'************************************************* ****************************
'variables

maximo var WORD 'maximum value detected
minimo var WORD 'minimum value detected
media var WORD 'average
mediac var WORD 'total of records received - average count
km var WORD 'PowerOn counter
MA var WORD '
MI var WORD '
ME var WORD '
ps4 var WORD '
value var WORD 'value received
medres var WORD 'value sum for avg math
ADDR var word
ra var word
time var word
timex var word
MYDATA var word

'contants
p1a con $10
p1b con $e20
ctw CON $A0
Row1 CON 128 'constant for LCD line1
Row2 CON 192 'constant for LCD line2
Row3 CON 148 'comstant for LCD line3
Row4 CON 212 'constant for LCD line4
cl con 254 'constant for LCD clear line


clear
'************************************************* ****************************

INCLUDE "lcdbarIN.bas"
DEFINE LCD4X20 1

'************************************************* **********
INIT:
high rx
high tx
pause 400
lcdout $fe,1," TX demo "
lcdout $fe,$c0," ... "
pause 1500
debug $55
if but1=1 then
goto chann
endif

man:
high freq
me=0
for ra=0 to 15
adcin adc,value
pause 50
me=me+value
next ra
me=me/16
media=me
media=(media*/5000)>>2
lcdout cl,row1," adc ", dec value
lcdout cl,row2," media ", dec media


transmit:
lcdout cl,row4,"transmiting - ",dec value ," "
debug $55,"ok", dec value dig 3, dec value dig 2, dec value dig 1, dec value dig 0

goto man

chann:
low freq
pause 50
while but1=1
debug $af, $20
wend
goto man

end

ruijc
- 18th June 2009, 22:30
Thanks to Joe the problem has been solved.

The problem was related with the Mode ( debug defines ) settings.

I changed from MODE 1 to MODE 0 and it started to receive all data 100%.

Thanks Joe.:)

idrenth
- 17th October 2009, 16:47
Hello

can maybe sombody give a circuit so I can test it.

I have the CY2196R module but I didn't get it running also.

I hope for respons.

regards idrenth

JulianDichiara
- 16th March 2010, 01:06
I was looking for things to do with my GP-GC010. I came across this forum.
I got my GP-GC010 working well. At first I was having the same problems as
ruijc was having. I got mine to work with a debug window and an example
program displaying this string "On The Air!". I'm using a 3.3 volt regulator.
I reset it and it started working (I don't really know why!).:)

tonyfelloni
- 17th March 2010, 10:34
Ah, call it the joy of electronics!

silentwol
- 26th June 2010, 17:42
Firstly, apologies for dragging up this post yet again!

I too am having trouble with this module. I've tried everything I can think of, but I can't get anything to be received. Is anyone who has got this working prepared to help me out? There are so many contradictions and instances of vague language in the 'data sheet' that it seems amazing anyone has got this working!

I am using a PIC16F88 USART to transmit to one module and I'm reading the other with an arduino. When I send serial data to either module, the busy LED lights. Everything looks good. Pins 7 and 8 are pulled high, 5 and 2 are grounded and everything is running on 3.3V. I'm definitely running at 19200 baud rate and I'm using true rs232 (i.e. normaly high, when data sent goes low). However, I've been trying for almost a solid day now and the busy LED of the other module has never flashed in response to receiving transmission from another module.

I've tried setting the transmission frequency but the data sheet is so vague that frankly I could have been doing anything.

Any ideas? Thanks!