MC56F8013 - spi communication to dac

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

MC56F8013 - spi communication to dac

ソリューションへジャンプ
3,327件の閲覧回数
Egal
Contributor I

I am a newbie when it comes to programming microcontrollers and I have a question on connecting the 56F8013 to a dac (digital analog converter) using the spi interface.

I want to connect the dsp to a "DAC121S101" 12-bit dac. The pin-connection is correct, I think:

DSP DAC
MOSI -> Din
SCLK -> SCLK
GPIOB4 -> SYNC (like SS)

The input shift register of the dac has sixteen bits. The first two bits are "don`t cares" and the following two bits determine the mode of operation.
The contents of the serial input register are transferred to the dac register on the sixteenth falling edge of SCLK.

It is a 12-bit dac with a 16-bit shift register. I am using CodeWarrior with Processor Expert to configure the dsp.
How do I have to configure it when I only have 12-bits but need to send 16 falling edges. I am confused.

Thanks.

ラベル(1)
  • DSC

タグ(2)
0 件の賞賛
返信
1 解決策
1,661件の閲覧回数
rocco
Senior Contributor II
Hi, Egal:

Talking to that DAC is pretty straight forward. You have it hooked up correctly. To load it, do the following:

1) Set SYNC (GPIOB4) low.
2) Write the high four bits of the twelve bit DAC value to the SPI (the four bits should be in the low nibble, and the high nibble should be zero for normal mode).
3) Write the low eight bits of the twelve bit DAC value to the SPI.
4) Wait for both bytes to finish transferring.
5) Set SYNC (GPIOB4) high.

Hope that helps.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,662件の閲覧回数
rocco
Senior Contributor II
Hi, Egal:

Talking to that DAC is pretty straight forward. You have it hooked up correctly. To load it, do the following:

1) Set SYNC (GPIOB4) low.
2) Write the high four bits of the twelve bit DAC value to the SPI (the four bits should be in the low nibble, and the high nibble should be zero for normal mode).
3) Write the low eight bits of the twelve bit DAC value to the SPI.
4) Wait for both bytes to finish transferring.
5) Set SYNC (GPIOB4) high.

Hope that helps.
0 件の賞賛
返信