C Library for mbedWSE project based single board computer for hardware peripherals

Fork of mbedWSEsbc by Joseph Bradshaw

Revision:
15:2564f54c89df
Parent:
14:321d6fdc40e6
--- a/mbedWSEsbc.h	Tue Oct 11 17:11:12 2016 +0000
+++ b/mbedWSEsbc.h	Tue Oct 11 17:13:09 2016 +0000
@@ -5,6 +5,8 @@
     Added comments in Init function, encoder functions
  20150210 J Bradshaw - Initialized DigitalOuts with pre-defined logic
    levels (CS's high, etc)
+ 20161011 J Bradshaw - Changed MAX1270 ADC SCLK to 5MHz and format(12, 0)
+   for conversion mode to match datasheet (200ns SCLK max PW high and low)
 */
 
 
@@ -70,7 +72,7 @@
 int read_max1270(int chan, int range, int bipol){
     int cword=0x80;     //set the start bit
     
-    spi_max1270.frequency(5000000); //10MHz
+    spi_max1270.frequency(5000000); //5MHz Max
     spi_max1270.format(8, 0);   // 8 data bits, CPOL0, and CPHA0 (datasheet Digital Interface)
         
     cword |= (chan << 4);   //shift channel
@@ -80,8 +82,7 @@
     max1270_cs = 0;
            
     spi_max1270.write(cword);
-    wait_us(15);    //15us
-    //spi_max1270.format(12, 3);
+    wait_us(15);    //15us    
     spi_max1270.format(12, 0);
     
     int result = spi_max1270.write(0);