Data exchange problem


I have the situation like on the image I Added.

I have 5 FEZ Cobra’s which read data from five CAN-Devices. I use five FEZs because of the processing time. I would like to send the processed data to one ChipworkX processor and then send it over the ethernet to an PC.

The problem is that I would like to have a solution in the form of an BUS structure between the FEZs and the ChipworkX. Does anyone have an solution?

Kind Regards.

RS485 communication?
ChipworkX is your Master.
Cobra are slave.
Each Cobra have own address.

Then your ChipworkX request data from each Cobra…

You can use CAN or USB

GUS ChipworkX doesn’t have CAN.

Sure but add CAN over SPI and write RLP driver. It would run perfectly fine.


Thank you for the fast replies.

I only have 3 COM-ports on the ChipworkX and have 5 FEZs. The quickest is then RS-232 and all of these components are placed on one PCB. So I will use RS-232 without lineconverts.

I can use SPI for CAN on ChipworkX, but I want to read data from 5 Devices and all of these devices have the same address. So I cannot link the different CAN devices to one interface, because I can’t see from which device i’m receiving data.

Other solution? Use outputcompare on the FEZ, but how can I receive the data on the ChipworkX. I think that polling data from the Master is to slow. I would like to send data from the slave, at any time if possible, and then let the master wait and watch five connections. But how?

Outputcompare is not made for this

What about sending data over LAN?
Why you can’t save unique address(MAC, serial or something other) to device?
If you can save unique address to each cobra you have different options. you can use CAN as GUS recommend or you can use:
chipworkX and on it connect TTL To RS485 converter and same do on each Cobra. Then you with normal Serial port class request(request include their unique serial) data from each Cobra…

Without addressing or seperate phisical connection to each device you will not know which data is from which device.

I understand that I can connect every FEZ to the ChipworkX using COM-ports. But I have 5 FEZs and only 3 COM-ports on the ChipworkX…

And I don’t know a way to make software based UART working on the ChipworkX.

I hope that attached shematic will help you understand what Im think…

On chipworkX you connect TTL to RS485 converter to UART2(or some other UART) and open it as normal Serial Port(Read starting guide for .NETMF) on Cobra’s you do same thing. On cobra datareceived event you only respond if address equal address of Cobra…


Thank you all for the quick responses!

We would like to know how the RS-485 bussystem basiclly works. We will be going to use RS-485 transceivers instead of RS-232 transceivers. But what happens if two slaves send data at the same time?

Will this be handled by the transceivers and what will take care of addressing? Do we need to this our code in the FEZ or…?

Kind Regards.

Use google how RS485 work and for protocols which you can use(MODBUS…) or make own one…
RS485 doesn’t know anything about addressing because is only electrical specification. Your cobras must respond only if address bit include their ID so it can’t happen that two device respond on same time except if two device use same ID. You can also make some global ID on which all devices respond(can be used for reboot or some other command).

Just found this module on my hardware store…

Sorry it’s french but it’s an Ethernet / CAN module. I’ll see if I can find some English info’s on the thing…

I checked the Cobra and it has two CAN ports. I assume you use one to read and process your data. So you could use the other one to distribute the processed data via Ethernet either to the CWX or directly to the Computer where you want to use it.

Update: Well I found this link for an English description but I’d guess you’d still have to do a bit of direct arm programming to use it for your purpose… so I’m not sure it would be all that helpful in the end.

Update2: There is also a code example on this site for using RS485 on the Cobra using RLP and it’s using the onboard COM port for this. Maybe that might help you as well…

You can normaly use one CAN port for READ/WRITE. Cobra have two that you can connect to two different CAN networks…


We are trying to setup an CAN-bus between one CWX and two FEZs. At the moment we can send data over the bus between FEZ_a and FEZ_b. We’ve implemented the CAN_RLP from tinyclr wiki on the CWX. We had some problems loading the RLP. After the first load we needed to reset and reload the firmware of the CWX.

We needed to make some adjustments to the sources to get it to run on CWX. The modified parts in RLP.h are:

[quote]// !!! The user must set these settings according to the used platform !!!
// ChipworkX
#define RLP_ADDRESS 0xA0000000
#define RLP_SIZE 0x001FB3FC

#define RLP_EXT_MAGIC 0x73DE1BEA
#define RLPext (*((RLPext_T**)(RLP_ADDRESS + RLP_SIZE)))
#define RLP_MAGIC_SIZE (sizeof(RLPext_T))[/quote]

We also needed to make some adjustments in the makefile, but that does not see to be relevant. After these changes we could load the RLP on the CWX without reloading the firmware everytime.

At the moment we connected an oscilloscope on the SPI lines between the MicroChip Daugtherboard and the CWX, but don’t see any data coming by. So we have some questions:

  • Is there a way to check if the RLP is running ok?
  • Did we made a mistake in connecting the Daugtheboard to the CWX?
  • Is there an newer version of the RLP_CAN project and can this work with the newest framework?
  • Any other hints or suggestions are most welcome!

Kind Regards.


We found out that SPI is not working on the CWX. Is there an unknown problem that we don’t know about? SPI on FEZ is working, because we tried sending data over the Microchip PicTail Daughter board. We can’t receive data over the Daughter board, but this is another problem.

Kind Regards.

SPI should be fine. Please connect a scope and give us more details on what you see not working.

Hello Gus,

We used exact the some code on the FEZ as we use on the CWX. Only thing whats different are the pins we use.

When I connect the scope to the FEZ I see an Clock coming by and in the same period also an chip select. On the CWX I only see this sometimes…

We already tried SPI1 and SPI2, but both are not working. Keep in mind that we use the same piece of code!!

Is your connected SPI slave 3.3V or 5V?

ChipworkX is not 5V tolerant.

Hello Gus,

Our SPI slave is 5V.