Page 1 of 1

Compilation error using 2 Interrupt driven blocks

Posted: Wed Feb 18, 2009 2:37 am
by MHuy
Hi Lubin,

I try to send some information by SPI with two “Interrupt driven” blocks (which work on the same spi).
The problem is that these blocks can't have different numbers of trame (otherwise it will cause a compilation error).

In the example, the instantiation looks like :
extern unsigned volatile int SPI1Buffer_Receive[2];
extern unsigned volatile int SPI1Buffer_Send[2];
extern unsigned volatile int SPI1InterruptIdx;
extern unsigned volatile int SPI1Buffer_Receive[1];
extern unsigned volatile int SPI1Buffer_Send[1];
…and there is thus an error in the compilation.

A solution would be to have all blocks with the same number of trame.
However, it will send “0U” for each unconnected signal and there will be a lost of performance.

Is there another solution?

Michael

Re: Compilation error using 2 Interrupt driven blocks

Posted: Mon Mar 23, 2009 10:56 pm
by LubinKerhuel
Hi Michael,

As far as I remember, It is not possible to place two interrupt driven SPI block. Even it compilation is Ok, the behaviour will not be Ok. You will not get the requested results.

It is difficult to imagine a solution with a possibility to have two SPI driven block. It may be possible on one SPI driven block to add an entry for each input to activate or inactivate this entry during the next time step. However, that would add complexity for using the block, and I am not sure of the benefits that it would provide.

You may try using non driven SPI blocks. The other solution would be to use the custom C function call and to add your own interrupt code.

If it is a show stopper, could you explain what is it for. It would help to think about one solution...

Lubin

Re: Compilation error using 2 Interrupt driven blocks

Posted: Mon Apr 06, 2009 10:55 am
by MHuy
I m now using the non driven SPI block and it works perfectly.

Thanks for your help!

Michael