SPI rutine

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
798件の閲覧回数
Alek
Contributor I

Hi all, I am new in code warrior, I need help. I am using a QG8 and I need a rutine for SPI, I need to connect the qg8 at other device for SI, and I dont know how to made this rutine.

 

Thanks

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

you are asking a lot

 

first figure out the message packaging that you need - - - number of bytes,  start character, termination character

and method for packet reset so if something gets lost, the packet can recover and be looking for starting byte.

 

setup the SPI on both micro's - - - such that clock rates are within spec's of both devices - - typically have to be 1/4 of buss clock speed. for the receiver/slave. 

 

Read the SPI document for the micro.

 

Realize that each time you send a byte you receive a byte. And many times what you receive is garbage - - -

in code give time for the receiver to receive each byte and respond - - - -

 

a write to the SPI data register triggers the SPI byte transfer - - one byte out and one byte in.

great for high speed micro to micro

but also great for all of the one chip interface chips - - - A/D, D/A etc.

 

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
553件の閲覧回数
Jim_P
Contributor III

you are asking a lot

 

first figure out the message packaging that you need - - - number of bytes,  start character, termination character

and method for packet reset so if something gets lost, the packet can recover and be looking for starting byte.

 

setup the SPI on both micro's - - - such that clock rates are within spec's of both devices - - typically have to be 1/4 of buss clock speed. for the receiver/slave. 

 

Read the SPI document for the micro.

 

Realize that each time you send a byte you receive a byte. And many times what you receive is garbage - - -

in code give time for the receiver to receive each byte and respond - - - -

 

a write to the SPI data register triggers the SPI byte transfer - - one byte out and one byte in.

great for high speed micro to micro

but also great for all of the one chip interface chips - - - A/D, D/A etc.

 

0 件の賞賛
返信