LPC11C24 MCU to control DAC8718

Discussion in 'Embedded Systems and Microcontrollers' started by Drake6, Jul 11, 2014.

  1. Drake6

    Thread Starter New Member

    Jul 11, 2014
    1
    0
    Hello,

    I am trying to use an LPC11C24 microcontroller to send digital values to a DAC8718 (http://www.ti.com.cn/cn/lit/ds/symlink/dac8718.pdf) to convert to an analog voltage value. I am attempting to communicate via SPI and I am using mbed.h with the SPI.h capability to send an arbitrary stream of bits to the DAC. However I am not seeing any output on the DAC output. I am communicating via a PCAN-USB dongle. Here is my code:

    Code ( (Unknown Language)):
    1. #include "mbed.h"
    2.  
    3. CAN can(NC, NC);
    4. DigitalOut chipsel(P2_0);
    5.  
    6.  
    7. int main() {
    8. // Init CAN
    9. can.frequency(125000);
    10. // Main loop
    11. SPI device(P2_3, P2_2, P2_1);
    12. device.frequency(1000000);
    13. device.format(16,2); // 16 bits
    14. chipsel = 0;
    15. chipsel = 1;
    16. float response;
    17.  
    18. while(1) {
    19. response = device.write(0xFFFF);
    20. }
    21.  
    22. }
    What am I doing wrong and what should I do to record output on the DAC?

    Thanks, I appreciate this very much.

    Drake
     
Loading...