MC56F8013 - spi communication to dac

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MC56F8013 - spi communication to dac

跳至解决方案
3,157 次查看
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)
标记 (2)
0 项奖励
1 解答
1,491 次查看
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,492 次查看
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 项奖励