Drake1
Newbie level 1
- Joined
- Jul 11, 2014
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 8
Hello,
I am trying to use an LPC11C24 microcontroller to send digital values to a DAC8718 (https://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:
What am I doing wrong and what should I do to record output on the DAC?
Thanks, I appreciate this very much.
Drake
I am trying to use an LPC11C24 microcontroller to send digital values to a DAC8718 (https://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:
#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