EmbeddedRelated.com
Forums

Problem of using LPC2138 to SPI interface with DAC LTC1451

Started by ntchien2013 June 6, 2013
> thank you for your code. I wonder to know if "spi.h" is important in the code that you posted.
> I tested my code with SPI Debugger and found that the LPC2138 only transfers 8 bit data eventhough I set to transfer 12 bit! If your code already work fine with the real device, I think this might the problem with the simulation software. Thank you very much for your help.


I NEVER use simulation. It isn't real hardware and my code ultimately has to run on hardware.

spi.h is unimportant, it simply defines the two functions:



Richard

An Engineer's Guide to the LPC2100 Series

> thank you for your code. I wonder to know if "spi.h" is important in the code that you posted.
> I tested my code with SPI Debugger and found that the LPC2138 only transfers 8 bit data eventhough I set to transfer 12 bit! If your code already work fine with the real device, I think this might the problem with the simulation software. Thank you very much for your help.

At this line:



Are you sure that the compiler issues an 16 bit write to the S0SPDR register?
> At this line:
>
> S0SPDR = value;
>
> Are you sure that the compiler issues an 16 bit write to the S0SPDR register?

I used the posted code to communicate with an ADC using 16 bit transfers. It certainly seemed to work. The code was written with Keil uVision4.

Richard