Connect with us

LPC11C24 MCU to control DAC8718

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

Scroll to continue with content
  1. Drake


    Jul 10, 2014

    I am trying to use an LPC11C24 microcontroller to send digital values to a DAC8718 ( 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
    // Main loop
    SPI device(P2_3, P2_2, P2_1);
    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.

  2. shumifan50


    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:
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