Hi Rob. Thanks for the files. I found also the corresponding sites too.
Ioannis
Hi Rob. Thanks for the files. I found also the corresponding sites too.
Ioannis
Rob,
I now have my two XRF transceivers set up and functioning. However, I'm experiencing the same problem as you have reported ... unable to communicate rf from a PIC and PBP.
The hardware and wiring checks out good. Using a terminal program (TeraTerm) and a USART to USB Bridge cable (CP210x), the radio loop-back link works perfectly. Also, the AT command mode functions correctly for both devices.
The comms do not work when driving the radio from a PIC USART. Sample code:
I saw your latest post on the Ciseco forum. You are not getting much help there. Do you have any further test results?Code:'************************************************************************** '*Program to test XRF radio communications via loopback method * '*Uses a pushbutton switch on porta pin 4 * '*Target processor is PIC 12f1822 * '*321 program words, revised 05/05/2013 * '*Program by Dick Ivers * '*All rights reserved * '************************************************************************** 'set 12f1822 configurat1on #CONFIG __config _CONFIG1, _FOSC_INTOSC & _MCLRE_OFF & _CLKOUTEN_OFF & _WDTE_ON __config _CONFIG2, _PLLEN_OFF & _LVP_OFF #endconfig 'set registers OSCCON = %01101000 '4 mhz osc OSCTUNE = 0 'factory calibration ANSELA = 0 'all digital inputs OPTION_REG.7 = 0 'global pullups enabled WPUA = %010000 'porta pin 4 weak pullup enabled CM1CON0.7 = 0 'comparator disabled TRISA = %011110 'PORTA.0 & porta.5 are outputS, all others input while OSCSTAT.0 = 0 'wait for stable freq. wend define OSC 4 '4 mhz oscillator 'Define hserout parameters define HSER_RCSTA 90h define HSER_TXSTA 20h define HSER_BAUD 9600 define HSER_CLROERR 1 'clear overflow error APFCON.7 = 1 'rx on ra1 (12f1822) APFCON.2 = 1 'tx on pin ra0 (12f822) i var byte char var byte For i = 1 to 3 porta.5 = 0 'led on pause 333 porta.5 = 1 'led off pause 333 next asleep: nap 2 'delay 4 ms if porta.4 = 1 then asleep DT: hserout [dec 5] hserin 100,blink,[dec char] if char = 5 then porta.5 = 0 'led on goto halt endif blink: porta.5 = 0 'led pause 50 porta.5 = 1 'led off pause 50 if porta.4 =1 then asleep goto DT halt: stop
Dick
Last edited by Dick Ivers; - 5th May 2013 at 18:01.
@ tasmod:
You are using Serout with N9600 but I think the modules you are using need data be in true mode and not inversed. So use serout with T9600.
@ Dick:
I think for the 1822, you need to set TXSTA at $24. At $20 no 9600 is supported.
Look at page 299-300 of the data sheet.
Ioannis
Last edited by Ioannis; - 6th May 2013 at 19:53.
Ioannis,
Thanks, I will try your suggestion. Unfortunately, not right now ... my computer broke down over the weekend. I'm writing this from a borrowed laptop.
Dick
Hi Dick, Loannis,
I received the modules back on Friday just as I was leaving to have a few days away for the Holiday long weekend in UK.
They have been tested as OK but that doesn't relate as I couldn't measure any RF out when I sent them back. Never the less I believe Ciseco, so I'm continuing by etching two new pcbs with link pad outputs so I can link any pin to the module.
They should be complete today and populated. Then I will do more tests.
The speed issue came up so I'm running at 10MHz so 9600 should work reliably. As for True, well the Picaxe code sample seems to use N9600 but I seem to remember I didn't trust this. So I wrote a loop of serout/serin with all baud rates one after another for testing. I think I mentioned this earlier in the post. Ciseco claim any serial comms sent, will be echoed out. Their data sheet isn't any clearer.
I can use any pin/s so I will test HW serial and serout/in. Hopefully with some sort of result, as these are not my modules.
I do have access to a full professional RF spectrum test setup, however without serout/in comms working there is no point using it.
Rob
Last edited by tasmod; - 7th May 2013 at 10:19.
At last. Working.
Redesigned pcb's but not reconfigured. Just turned pic sideways for ease of removal and added pads for each pin to facilitate cross connection, although not finally needed.
After making up the boards I wrote the most simple TX/RX routines and connected the 3 pins needed with temporary jumpers. They immediately talked to each other. Replacing the jumpers with the modules and they talked !!!!
There was one change in code that needed to be added but later removal and they still talked although not quite 100%. That was the extra first characters "SSSSSSSSBOB" before the required string to match the serin string of "BOB"
Send code -------------
Code:Include "modedefs.bas" DEFINE OSC 10 TRISA = %00000000 CMCON=7 pause 2000 TEST: serout PortA.3, T9600,["SSSSSSSBOB"] PAUSE 500 GOTO TEST END
Receive code -----------------------------
Now I need to expand the code to do just what I want and to then add a decent antenna to get the range.Code:Include "modedefs.bas" DEFINE OSC 10 TRISA = %11111101 CMCON=7 relay var PortA.1 low relay pause 2000 TEST: low relay pause 100 serin PortA.2,T9600,["BOB"] high relay PAUSE 1000 GOTO TEST END
I'm considering a 'Moxon' Rectangle which gives 3dbd gain with excellent f/b ratio fitted directly to modules via short solid wire. It can be made up using UK twin earth cable wire. About 1.5mm copper. It's very small indeed at 123x46mm
Rob
Last edited by tasmod; - 7th May 2013 at 20:40.
You pause 500 after transmit, but pause 1000 after reception?
Robert
Bookmarks