Using two EB063 RF Modules in one programm

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
User avatar
AndreasR
Posts: 44
Joined: Tue Aug 02, 2011 9:27 am
Location: Germany
Has thanked: 5 times
Been thanked: 3 times

Using two EB063 RF Modules in one programm

Post by AndreasR »

For a special situation i need to use two RF modules in one Flowcode programm.
But i´m not able to insert two modules.
An Error occurs:
You can only insert one RF Module
Is there any chance to work with more than one module and how i have to implement this?
Andreas
often i ask myself:
why i´m not a gardener ?
=:-)

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Re: Using two EB063 RF Modules in one programm

Post by JohnCrow »

Hi

As for using 2 RF blocks on one programmer, it does'nt look like its possible, just tried it myself in flowcode, and I get the message only 1 board can be added.

I would imagine its because there are only one set of the data lines on a pic (i.e SDO & SDI etc), that the board uses.
I'm sure Benj will have a more in depth answer.

Not sure is it would be possible to use 2 pics and link them using I2C or something along thoses lines.
1 in 10 people understand binary, the other one doesn't !

User avatar
AndreasR
Posts: 44
Joined: Tue Aug 02, 2011 9:27 am
Location: Germany
Has thanked: 5 times
Been thanked: 3 times

Re: Using two EB063 RF Modules in one programm

Post by AndreasR »

Hi John,
on one side you are right, there is only one pair of SPI data lines.
But i´m not using hardware SPI.
The "Hardware coding" i use is the same as shown in the Documents of the EB063:

For Example Port A:
SCK on BIT3
SDI on Bit 4
SDO on Bit 5
CS on Bit 0
FSEL on Bit Bit 1

So i don´t understand why it is not possible to do the same procedure with another module for instance on Port B.

If i can do this, it may be possible to build a kind of frequeny transcoder, trancoding from 868MHZ to 433MHZ or other projects which use more than one module.

@ Benj from Matrix:
May i have a chance to implement this, because other modules can be inserted more than one time?

Andreas
often i ask myself:
why i´m not a gardener ?
=:-)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using two EB063 RF Modules in one programm

Post by Benj »

Hello,

There is a way to enable the component so you can add multiples however I think there could be some problems with the definitions clashing between the two components.

You can test this by opening the Component C file from the Components directory and changing the following line.

MultipleAllowed=0

to

MultipleAllowed=1

As I say the definitions will probably cause all kinds of compilation errors.

This has already been tackled for Flowcode v5 where every component define has a unique reference which in theory should allow you to add multiples of each and every component.

One workaround for the defines errors would be to do a search and replace on all of the defines in the C file and append the definition name with a value that will change eg the chip select pin.

for example

MX_RF_SPI_HW

would become

%g_MX_RF_SPI_HW

Hope this helps.

User avatar
AndreasR
Posts: 44
Joined: Tue Aug 02, 2011 9:27 am
Location: Germany
Has thanked: 5 times
Been thanked: 3 times

Re: Using two EB063 RF Modules in one programm

Post by AndreasR »

Alright Ben,
i will try it on weekend and post the results of my experiences.
often i ask myself:
why i´m not a gardener ?
=:-)

User avatar
AndreasR
Posts: 44
Joined: Tue Aug 02, 2011 9:27 am
Location: Germany
Has thanked: 5 times
Been thanked: 3 times

Re: Using two EB063 RF Modules in one programm

Post by AndreasR »

Ok,
the change of MultipleAllowed is the right way to input more than one Module but...
One workaround for the defines errors would be to do a search and replace on all of the defines in the C file and append the definition name with a value that will change eg the chip select pin.

for example

MX_RF_SPI_HW

would become

%g_MX_RF_SPI_HW
is not the only thing that i have to do.
All Macro Calls like RF(0) Send_Byte can´t be used beause i have no chance to tell what module i will use.
I will think over how to do this. :(
Every Idea will be welcome.
Andreas
often i ask myself:
why i´m not a gardener ?
=:-)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using two EB063 RF Modules in one programm

Post by Benj »

Hello Andreas,

Don't worry about the function calls Flowcode will sort these out for you without having to do anything. The only thing you have to worry about is the definition names. I need to give this code a tickle today so I will see if I can help with this too.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using two EB063 RF Modules in one programm

Post by Benj »

Hello,

Here is a C file which should fix the bug for the hardware SPI and allow multiple devices to be connected to a single system.

Let me know how you get on.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using two EB063 RF Modules in one programm

Post by Benj »

Sorry, Reintroduced a bug doing this. Here is the updated file with the bug removed.
Attachments
PIC_RF.c
(25.67 KiB) Downloaded 466 times

User avatar
AndreasR
Posts: 44
Joined: Tue Aug 02, 2011 9:27 am
Location: Germany
Has thanked: 5 times
Been thanked: 3 times

Re: Using two EB063 RF Modules in one programm

Post by AndreasR »

Hi Ben,
sorry for my late answer.
I´m fighting against great problems in constructing a special pcb board using pics, RF-Solutions Modules like Matrix uses on the EB063 MAX 3002 Level Shifter and other silicone.
So please be patient, i will test it and post the results.
Andreas
often i ask myself:
why i´m not a gardener ?
=:-)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using two EB063 RF Modules in one programm

Post by Benj »

For SPI you can do away with the level shifter and use potential dividers on the microcontroller outputs and then allow the inputs to connect directly.

See this diagram for an example.
Image

Or you could use the E-block...

User avatar
AndreasR
Posts: 44
Joined: Tue Aug 02, 2011 9:27 am
Location: Germany
Has thanked: 5 times
Been thanked: 3 times

Re: Using two EB063 RF Modules in one programm

Post by AndreasR »

Cool idea :idea:
I will test it tomorrow.
MAX3002 is very hard to handle in a single sided board. But if you have eyes like an eagle and a good smd solder iron it works.
This is a part of the problems i got with the TRX Modules from RF.
TRX use 3.3V
The separated Modules TX and RX use 5V. No one knows why.
My first idea was to use one TX and one RX to get a complete 5V environment.
Next idea was to implement parts of the E-Block in detail the TRX and the levelshifter.
The use of a complete Block is not possible because i have only a very smal case to put the whole system in.
When everything works i will post you the schematic and tell what i have done.
Again thanks for the great idea, sometimes i think i´m a bit stupid. :roll:
Andreas
often i ask myself:
why i´m not a gardener ?
=:-)

User avatar
AndreasR
Posts: 44
Joined: Tue Aug 02, 2011 9:27 am
Location: Germany
Has thanked: 5 times
Been thanked: 3 times

Re: Using two EB063 RF Modules in one programm

Post by AndreasR »

Dear Ben
thx for your great idea. It works without any problems. :D
The attached schematic shows a receiversystem which comunicates with sender units.
The sender units have a pic 16F88 aTRX module from RF Solutions like you use on the RF Boards and 4 buttons.
Everytime a button is pressed, the receiver shows a text message on the LCD and switches on one of the LEDS for about 2 minutes. The buzzer beeps for 10 seconds.
Hope it helps anyone other.
Andreas
Attachments
Receiversystem-PIC16F887.pdf
Receiver System with PIC16F887
(52.06 KiB) Downloaded 447 times
often i ask myself:
why i´m not a gardener ?
=:-)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using two EB063 RF Modules in one programm

Post by Benj »

Hi Andreas,

That's great glad its working for you and thanks for sharing your project :D

Post Reply