Hydra and 2 SPI

Hello,
With a HYDRA + card I have a module Enc28 (socket 3) and a MaxO (socket 4)
Under NetMf 4.3 I have an execution error:
SPI bus 0 is already reserved, cannot instantiatevit again.
I understand the problem but how to get around it.

Thank you in advance for your help
Alan

Thank you for the answer.

I will try in NetMf but the example in the SPI documentation shows a functioning one or the other but not both simultaneously.
Bye.

“simultaneous” is a strange concept when you’re talking about a single application running on a processor that only has one execution context at any time. And as @ cyberh0me says, it’s a shared bus.

In code, you simply have two devices defined at the same time. You send data to them as you need, and you have to alternate between them. You can’t interrupt sending data to the MaxO to send data to the ENC28, you have to let each finish and then swap to the other device and then send.

When the 2 devices work at the output, there is no problem.
On the other hand, when they receive data asynchronously it is less obvious to be able to operate in the alternate mode.
At each reception of an information (perhaps by an interruption) it will be necessary to find the context and to swap the configuation on the good device. Possible but I think that one risks to use intensively a small processor.

In any case I thank you for your advice and remarks. I think I will abandon the MaxO and do the processing on the I2C bus (unused in my application) with a component type MCP23017 for example.
Bye
Alan

1 Like

yeah, there becomes more complexity in all scenarios. And if you can get around it (second SPI or alternate tool) that’s often a good simplification step so great idea if you can !