Class for AD7390, a 12 bit SPI driven external DAC from Analog Devices.

Dependencies:   mbed

Datasheet - http://www.analog.com/static/imported-files/data_sheets/AD7390_7391.pdf

Committer:
cassar10
Date:
Sun Apr 13 19:45:35 2014 +0000
Revision:
5:1ce3ec1e5f8b
Parent:
4:0c327b37ddc1
Set SPI Frequency during initialization. Test program includes for loop to ramp up to reference voltage.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cassar10 0:82cd70f9fc3f 1 #include "mbed.h"
cassar10 2:8633e348822f 2 #include "AD7390.h"
cassar10 0:82cd70f9fc3f 3
cassar10 3:37ec9ea72264 4 SPI spi(p5,p6,p7);
cassar10 3:37ec9ea72264 5 AD7390 Test(spi,p10,p11);
cassar10 0:82cd70f9fc3f 6
cassar10 2:8633e348822f 7 int main(){
cassar10 5:1ce3ec1e5f8b 8 Test.Init(10000000);
cassar10 4:0c327b37ddc1 9 while (true){
cassar10 4:0c327b37ddc1 10 Test.Reset();
cassar10 5:1ce3ec1e5f8b 11 for (float V = 0; V !=3.3; V=V+0.005){
cassar10 5:1ce3ec1e5f8b 12 Test.WriteL(V,3.3);
cassar10 5:1ce3ec1e5f8b 13 wait(0.02);
cassar10 5:1ce3ec1e5f8b 14 }
cassar10 3:37ec9ea72264 15
cassar10 2:8633e348822f 16 }
cassar10 2:8633e348822f 17 }
cassar10 0:82cd70f9fc3f 18