SPI communication with DAC (MCP4912)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI communication with DAC (MCP4912)

Jump to solution
2,130 Views
laonia
Contributor I

Hi,

I am having some trouble using the SPI module on my FRDM-KEA128. I am trying to change voltage output on a MCP4912. I compared my SPI signals to an example on the datasheet. They seem correct to me, but I'm still not detecting any voltage change. Is there anything I am missing?

The following image is me trying to send two bytes: 0xFA and 0xAA. I tied LDAC pin to ground, so voltage should be updated when a 16bits message is received. 

My SPI SignalMy SPI SignalExample on DatasheetExample on Datasheet

0 Kudos
Reply
1 Solution
2,119 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

The image uploaded of the oscilloscope shows the 0xFA and 0xAA, the SPI seems right, from KEA128, this can be an issue with the MPC, you need to consult the datasheet from the MCP or contact the vendor of that device. I suggest reviewing the velocity of the MCP has support.

View solution in original post

0 Kudos
Reply
3 Replies
2,120 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

The image uploaded of the oscilloscope shows the 0xFA and 0xAA, the SPI seems right, from KEA128, this can be an issue with the MPC, you need to consult the datasheet from the MCP or contact the vendor of that device. I suggest reviewing the velocity of the MCP has support.

0 Kudos
Reply
2,104 Views
laonia
Contributor I
Hi Pavel, Thanks! That was the issue. I was sending my SPI too fast. This kind of brings up another question. I am currently using a PIT Timer at 1kHz to call a send SPI message function, but I am thinking whether there is a quicker way to just grab the current clock tick from some registers without setting up the timer handler?
0 Kudos
Reply
2,098 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, there are many ways to get an internal trigger but all need setting to guarantee the time. the other way with the minimum setting is to use the SysTick_Handler, but I suggest the use of the PIT or RTC.

0 Kudos
Reply