SPI communication between two MCF51QE128

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SPI communication between two MCF51QE128

ソリューションへジャンプ
2,093件の閲覧回数
nlocatel
Contributor I

Hi everyone,

 

I'm facing a little trouble establishing a SPI communication between two MCF51QE128.

I used the CodeWarrior processor expert to make the appropriate beans for both, one is the master and the other is configured as a slave. The beans configurations are apparently correct, clock speed is valid, and electrical link between pins is verified.

 

But the slave is not executing the SPI Interruption Service Routine though clock and data are being sent from master to slave. The SPI interruption in the slave is, of course, enabled.

 

Can anyone help with this issue? I don't know what else to do.

 

You know what, it's solved! It was just the slave select timing, we had to pull it down much more in advance.

 

Thanks a lot.

Nicolas

 

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,571件の閲覧回数
armistej
Contributor III

Be sure to watch how fast you run your SPI interface.

 

There's a limit to how fast the slave device can accept data before it gets overrun.  In a hybrid mode where the first SPI RX byte in a message is received via interrupts, and the rest are accepted by polling, I couldn't get any faster than 1MHz SPI clock when using a 24 MHz external clock on an MCF51CN128 part.   Going to 2MHz and we got overruns occuring regularly.  I didn't try to go any faster than 1MHz because our master only had a fixed choice of clock frequencies at whole MHz values.

 

Bottom line - for CPU to CPU SPI, the slave's ability to remove data from the SPI RX buffer is the limiting factor.

 

And yes, as you've discovered, slave select timing is important too.  Choose your SPI mode carefully as they are not created equally.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,572件の閲覧回数
armistej
Contributor III

Be sure to watch how fast you run your SPI interface.

 

There's a limit to how fast the slave device can accept data before it gets overrun.  In a hybrid mode where the first SPI RX byte in a message is received via interrupts, and the rest are accepted by polling, I couldn't get any faster than 1MHz SPI clock when using a 24 MHz external clock on an MCF51CN128 part.   Going to 2MHz and we got overruns occuring regularly.  I didn't try to go any faster than 1MHz because our master only had a fixed choice of clock frequencies at whole MHz values.

 

Bottom line - for CPU to CPU SPI, the slave's ability to remove data from the SPI RX buffer is the limiting factor.

 

And yes, as you've discovered, slave select timing is important too.  Choose your SPI mode carefully as they are not created equally.

0 件の賞賛
返信
1,571件の閲覧回数
nlocatel
Contributor I

Thanks for your comments, they helped.

0 件の賞賛
返信