Connect with us

LPC11C24 MCU to control DAC8718

Discussion in 'Microcontrollers, Programming and IoT' started by Drake, Jul 10, 2014.

  1. Drake

    Drake

    1
    0
    Jul 10, 2014
    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:

    #include "mbed.h"

    CAN can(NC, NC);
    DigitalOut chipsel(P2_0);


    int main() {
    // Init CAN
    can.frequency(125000);
    // Main loop
    SPI device(P2_3, P2_2, P2_1);
    device.frequency(1000000);
    device.format(16,2); // 16 bits
    chipsel = 0;
    chipsel = 1;
    float response;

    while(1) {
    response = device.write(0xFFFF);
    }

    }

    What am I doing wrong and what should I do to record output on the DAC?

    Thanks, I appreciate this very much.

    Drake
     
  2. shumifan50

    shumifan50

    548
    56
    Jan 16, 2014
    Start by looking at the SPI interface.
    I don't know the NXP microcontrollers, but sending 0xffff to see if data is being sent is not a good idea as it will just hold the data line high. It will be better to send something like 0xc134 that will send 0's and 1' causing the data line up and down on the scope.

    Do you see the clock signal? If not you are most likely not setting up correctly.

    Have a look at this very simple example:
    http://www.nxp.com/documents/application_note/AN10369.pdf
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-