Maxim Integrated MAX5719 20-bit, 0.05nV-sec DAC Test program running on MAX32625MBED.

Dependencies:   MAX5719

Committer:
whismanoid
Date:
Sun Jan 03 04:54:10 2021 +0000
Revision:
26:f71e4817e8c6
Initial Commit Hello MAX5719BOB_20bit_DAC

Who changed what in which revision?

UserRevisionLine numberNew contents of line
whismanoid 26:f71e4817e8c6 1 // /*******************************************************************************
whismanoid 26:f71e4817e8c6 2 // * Copyright (C) 2021 Maxim Integrated Products, Inc., All Rights Reserved.
whismanoid 26:f71e4817e8c6 3 // *
whismanoid 26:f71e4817e8c6 4 // * Permission is hereby granted, free of charge, to any person obtaining a
whismanoid 26:f71e4817e8c6 5 // * copy of this software and associated documentation files (the "Software"),
whismanoid 26:f71e4817e8c6 6 // * to deal in the Software without restriction, including without limitation
whismanoid 26:f71e4817e8c6 7 // * the rights to use, copy, modify, merge, publish, distribute, sublicense,
whismanoid 26:f71e4817e8c6 8 // * and/or sell copies of the Software, and to permit persons to whom the
whismanoid 26:f71e4817e8c6 9 // * Software is furnished to do so, subject to the following conditions:
whismanoid 26:f71e4817e8c6 10 // *
whismanoid 26:f71e4817e8c6 11 // * The above copyright notice and this permission notice shall be included
whismanoid 26:f71e4817e8c6 12 // * in all copies or substantial portions of the Software.
whismanoid 26:f71e4817e8c6 13 // *
whismanoid 26:f71e4817e8c6 14 // * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
whismanoid 26:f71e4817e8c6 15 // * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
whismanoid 26:f71e4817e8c6 16 // * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
whismanoid 26:f71e4817e8c6 17 // * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
whismanoid 26:f71e4817e8c6 18 // * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
whismanoid 26:f71e4817e8c6 19 // * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
whismanoid 26:f71e4817e8c6 20 // * OTHER DEALINGS IN THE SOFTWARE.
whismanoid 26:f71e4817e8c6 21 // *
whismanoid 26:f71e4817e8c6 22 // * Except as contained in this notice, the name of Maxim Integrated
whismanoid 26:f71e4817e8c6 23 // * Products, Inc. shall not be used except as stated in the Maxim Integrated
whismanoid 26:f71e4817e8c6 24 // * Products, Inc. Branding Policy.
whismanoid 26:f71e4817e8c6 25 // *
whismanoid 26:f71e4817e8c6 26 // * The mere transfer of this software does not imply any licenses
whismanoid 26:f71e4817e8c6 27 // * of trade secrets, proprietary technology, copyrights, patents,
whismanoid 26:f71e4817e8c6 28 // * trademarks, maskwork rights, or any other form of intellectual
whismanoid 26:f71e4817e8c6 29 // * property whatsoever. Maxim Integrated Products, Inc. retains all
whismanoid 26:f71e4817e8c6 30 // * ownership rights.
whismanoid 26:f71e4817e8c6 31 // *******************************************************************************
whismanoid 26:f71e4817e8c6 32 // */
whismanoid 26:f71e4817e8c6 33 // example code includes
whismanoid 26:f71e4817e8c6 34 // standard include for target platform -- Platform_Include_Boilerplate
whismanoid 26:f71e4817e8c6 35 #include "mbed.h"
whismanoid 26:f71e4817e8c6 36 // Platforms:
whismanoid 26:f71e4817e8c6 37 // - MAX32625MBED
whismanoid 26:f71e4817e8c6 38 // - supports mbed-os-5.11, requires USBDevice library
whismanoid 26:f71e4817e8c6 39 // - add https://developer.mbed.org/teams/MaximIntegrated/code/USBDevice/
whismanoid 26:f71e4817e8c6 40 // - remove max32630fthr library (if present)
whismanoid 26:f71e4817e8c6 41 // - remove MAX32620FTHR library (if present)
whismanoid 26:f71e4817e8c6 42 // - MAX32600MBED
whismanoid 26:f71e4817e8c6 43 // - Please note the last supported version is Mbed OS 6.3.
whismanoid 26:f71e4817e8c6 44 // - remove max32630fthr library (if present)
whismanoid 26:f71e4817e8c6 45 // - remove MAX32620FTHR library (if present)
whismanoid 26:f71e4817e8c6 46 // - Windows 10 note: Don't connect HDK until you are ready to load new firmware into the board.
whismanoid 26:f71e4817e8c6 47 // - NUCLEO_F446RE
whismanoid 26:f71e4817e8c6 48 // - remove USBDevice library
whismanoid 26:f71e4817e8c6 49 // - remove max32630fthr library (if present)
whismanoid 26:f71e4817e8c6 50 // - remove MAX32620FTHR library (if present)
whismanoid 26:f71e4817e8c6 51 // - NUCLEO_F401RE
whismanoid 26:f71e4817e8c6 52 // - remove USBDevice library
whismanoid 26:f71e4817e8c6 53 // - remove max32630fthr library (if present)
whismanoid 26:f71e4817e8c6 54 // - remove MAX32620FTHR library (if present)
whismanoid 26:f71e4817e8c6 55 // - MAX32630FTHR
whismanoid 26:f71e4817e8c6 56 // - #include "max32630fthr.h"
whismanoid 26:f71e4817e8c6 57 // - add http://developer.mbed.org/teams/MaximIntegrated/code/max32630fthr/
whismanoid 26:f71e4817e8c6 58 // - remove MAX32620FTHR library (if present)
whismanoid 26:f71e4817e8c6 59 // - MAX32620FTHR
whismanoid 26:f71e4817e8c6 60 // - #include "MAX32620FTHR.h"
whismanoid 26:f71e4817e8c6 61 // - remove max32630fthr library (if present)
whismanoid 26:f71e4817e8c6 62 // - add https://os.mbed.com/teams/MaximIntegrated/code/MAX32620FTHR/
whismanoid 26:f71e4817e8c6 63 // - not tested yet
whismanoid 26:f71e4817e8c6 64 // - MAX32625PICO
whismanoid 26:f71e4817e8c6 65 // - #include "max32625pico.h"
whismanoid 26:f71e4817e8c6 66 // - add https://os.mbed.com/users/switches/code/max32625pico/
whismanoid 26:f71e4817e8c6 67 // - remove max32630fthr library (if present)
whismanoid 26:f71e4817e8c6 68 // - remove MAX32620FTHR library (if present)
whismanoid 26:f71e4817e8c6 69 // - not tested yet
whismanoid 26:f71e4817e8c6 70 // - see https://os.mbed.com/users/switches/code/max32625pico/
whismanoid 26:f71e4817e8c6 71 // - see https://os.mbed.com/users/switches/code/PICO_board_demo/
whismanoid 26:f71e4817e8c6 72 // - see https://os.mbed.com/users/switches/code/PICO_USB_I2C_SPI/
whismanoid 26:f71e4817e8c6 73 // - see https://os.mbed.com/users/switches/code/SerialInterface/
whismanoid 26:f71e4817e8c6 74 // - Note: To load the MAX32625PICO firmware, hold the button while
whismanoid 26:f71e4817e8c6 75 // connecting the USB cable, then copy firmware bin file
whismanoid 26:f71e4817e8c6 76 // to the MAINTENANCE drive.
whismanoid 26:f71e4817e8c6 77 // - see https://os.mbed.com/platforms/MAX32625PICO/
whismanoid 26:f71e4817e8c6 78 // - see https://os.mbed.com/teams/MaximIntegrated/wiki/MAX32625PICO-Firmware-Updates
whismanoid 26:f71e4817e8c6 79 //
whismanoid 26:f71e4817e8c6 80 // end Platform_Include_Boilerplate
whismanoid 26:f71e4817e8c6 81 #include "MAX5719.h"
whismanoid 26:f71e4817e8c6 82
whismanoid 26:f71e4817e8c6 83 // example code board support
whismanoid 26:f71e4817e8c6 84 //MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
whismanoid 26:f71e4817e8c6 85 //DigitalOut rLED(LED1);
whismanoid 26:f71e4817e8c6 86 //DigitalOut gLED(LED2);
whismanoid 26:f71e4817e8c6 87 //DigitalOut bLED(LED3);
whismanoid 26:f71e4817e8c6 88 //
whismanoid 26:f71e4817e8c6 89 // Arduino "shield" connector port definitions (MAX32625MBED shown)
whismanoid 26:f71e4817e8c6 90 #if defined(TARGET_MAX32625MBED)
whismanoid 26:f71e4817e8c6 91 #define A0 AIN_0
whismanoid 26:f71e4817e8c6 92 #define A1 AIN_1
whismanoid 26:f71e4817e8c6 93 #define A2 AIN_2
whismanoid 26:f71e4817e8c6 94 #define A3 AIN_3
whismanoid 26:f71e4817e8c6 95 #define D0 P0_0
whismanoid 26:f71e4817e8c6 96 #define D1 P0_1
whismanoid 26:f71e4817e8c6 97 #define D2 P0_2
whismanoid 26:f71e4817e8c6 98 #define D3 P0_3
whismanoid 26:f71e4817e8c6 99 #define D4 P0_4
whismanoid 26:f71e4817e8c6 100 #define D5 P0_5
whismanoid 26:f71e4817e8c6 101 #define D6 P0_6
whismanoid 26:f71e4817e8c6 102 #define D7 P0_7
whismanoid 26:f71e4817e8c6 103 #define D8 P1_4
whismanoid 26:f71e4817e8c6 104 #define D9 P1_5
whismanoid 26:f71e4817e8c6 105 #define D10 P1_3
whismanoid 26:f71e4817e8c6 106 #define D11 P1_1
whismanoid 26:f71e4817e8c6 107 #define D12 P1_2
whismanoid 26:f71e4817e8c6 108 #define D13 P1_0
whismanoid 26:f71e4817e8c6 109 #elif defined(TARGET_MAX32625PICO)
whismanoid 26:f71e4817e8c6 110 #warning "TARGET_MAX32625PICO not previously tested; need to define pins..."
whismanoid 26:f71e4817e8c6 111 #define A0 AIN_1
whismanoid 26:f71e4817e8c6 112 #define A1 AIN_2
whismanoid 26:f71e4817e8c6 113 // #define A2 AIN_3
whismanoid 26:f71e4817e8c6 114 // #define A3 AIN_0
whismanoid 26:f71e4817e8c6 115 #define D0 P0_0
whismanoid 26:f71e4817e8c6 116 #define D1 P0_1
whismanoid 26:f71e4817e8c6 117 #define D2 P0_2
whismanoid 26:f71e4817e8c6 118 #define D3 P0_3
whismanoid 26:f71e4817e8c6 119 #define D4 P1_7
whismanoid 26:f71e4817e8c6 120 #define D5 P1_6
whismanoid 26:f71e4817e8c6 121 #define D6 P4_4
whismanoid 26:f71e4817e8c6 122 #define D7 P4_5
whismanoid 26:f71e4817e8c6 123 #define D8 P4_6
whismanoid 26:f71e4817e8c6 124 #define D9 P4_7
whismanoid 26:f71e4817e8c6 125 #define D10 P0_7
whismanoid 26:f71e4817e8c6 126 #define D11 P0_6
whismanoid 26:f71e4817e8c6 127 #define D12 P0_5
whismanoid 26:f71e4817e8c6 128 #define D13 P0_4
whismanoid 26:f71e4817e8c6 129 #endif
whismanoid 26:f71e4817e8c6 130
whismanoid 26:f71e4817e8c6 131 // example code declare SPI interface (GPIO controlled CS)
whismanoid 26:f71e4817e8c6 132 #if defined(TARGET_MAX32625MBED)
whismanoid 26:f71e4817e8c6 133 SPI spi(SPI1_MOSI, SPI1_MISO, SPI1_SCK); // mosi, miso, sclk spi1 TARGET_MAX32625MBED: P1_1 P1_2 P1_0 Arduino 10-pin header D11 D12 D13
whismanoid 26:f71e4817e8c6 134 DigitalOut spi_cs(SPI1_SS); // TARGET_MAX32625MBED: P1_3 Arduino 10-pin header D10
whismanoid 26:f71e4817e8c6 135 #elif defined(TARGET_MAX32625PICO)
whismanoid 26:f71e4817e8c6 136 #warning "TARGET_MAX32625PICO not previously tested; need to define pins..."
whismanoid 26:f71e4817e8c6 137 SPI spi(SPI0_MOSI, SPI0_MISO, SPI0_SCK); // mosi, miso, sclk spi1 TARGET_MAX32625PICO: pin P0_5 P0_6 P0_4
whismanoid 26:f71e4817e8c6 138 DigitalOut spi_cs(SPI0_SS); // TARGET_MAX32625PICO: pin P0_7
whismanoid 26:f71e4817e8c6 139 #elif defined(TARGET_MAX32600MBED)
whismanoid 26:f71e4817e8c6 140 SPI spi(SPI2_MOSI, SPI2_MISO, SPI2_SCK); // mosi, miso, sclk spi1 TARGET_MAX32600MBED: Arduino 10-pin header D11 D12 D13
whismanoid 26:f71e4817e8c6 141 DigitalOut spi_cs(SPI2_SS); // Generic: Arduino 10-pin header D10
whismanoid 26:f71e4817e8c6 142 #elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_NUCLEO_F401RE)
whismanoid 26:f71e4817e8c6 143 // TODO1: avoid resource conflict between P5_0, P5_1, P5_2 SPI and DigitalInOut
whismanoid 26:f71e4817e8c6 144 // void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel)
whismanoid 26:f71e4817e8c6 145 //
whismanoid 26:f71e4817e8c6 146 // TODO1: NUCLEO_F446RE SPI not working; CS and MOSI data looks OK but no SCLK clock pulses.
whismanoid 26:f71e4817e8c6 147 SPI spi(SPI_MOSI, SPI_MISO, SPI_SCK); // mosi, miso, sclk spi1 TARGET_NUCLEO_F446RE: Arduino 10-pin header D11 D12 D13
whismanoid 26:f71e4817e8c6 148 DigitalOut spi_cs(SPI_CS); // TARGET_NUCLEO_F446RE: PB_6 Arduino 10-pin header D10
whismanoid 26:f71e4817e8c6 149 //
whismanoid 26:f71e4817e8c6 150 #else
whismanoid 26:f71e4817e8c6 151 SPI spi(D11, D12, D13); // mosi, miso, sclk spi1 TARGET_MAX32600MBED: Arduino 10-pin header D11 D12 D13
whismanoid 26:f71e4817e8c6 152 DigitalOut spi_cs(D10); // Generic: Arduino 10-pin header D10
whismanoid 26:f71e4817e8c6 153 #endif
whismanoid 26:f71e4817e8c6 154
whismanoid 26:f71e4817e8c6 155 // example code declare GPIO interface pins
whismanoid 26:f71e4817e8c6 156 // AnalogOut RFB_pin(Px_x_PortName_To_Be_Determined); // Analog Input to MAX5719 device
whismanoid 26:f71e4817e8c6 157 // AnalogOut INV_pin(Px_x_PortName_To_Be_Determined); // Analog Input to MAX5719 device
whismanoid 26:f71e4817e8c6 158 DigitalOut LDACb_pin(D9); // Digital Trigger Input to MAX5719 device
whismanoid 26:f71e4817e8c6 159 // AnalogIn OUT_pin(A0); // Analog Output from MAX5719 device
whismanoid 26:f71e4817e8c6 160 // example code declare device instance
whismanoid 26:f71e4817e8c6 161 MAX5719 g_MAX5719_device(spi, spi_cs, LDACb_pin, MAX5719::MAX5719_IC);
whismanoid 26:f71e4817e8c6 162
whismanoid 26:f71e4817e8c6 163 // example code main function
whismanoid 26:f71e4817e8c6 164 int main()
whismanoid 26:f71e4817e8c6 165 {
whismanoid 26:f71e4817e8c6 166 // setup: put your setup code here, to run once
whismanoid 26:f71e4817e8c6 167
whismanoid 26:f71e4817e8c6 168 g_MAX5719_device.Init();
whismanoid 26:f71e4817e8c6 169
whismanoid 26:f71e4817e8c6 170 while (1)
whismanoid 26:f71e4817e8c6 171 {
whismanoid 26:f71e4817e8c6 172 // loop: put your main code here, to run repeatedly
whismanoid 26:f71e4817e8c6 173
whismanoid 26:f71e4817e8c6 174 uint32_t code;
whismanoid 26:f71e4817e8c6 175 //
whismanoid 26:f71e4817e8c6 176 // example #1
whismanoid 26:f71e4817e8c6 177 code = 0xfffff; // 100.0% of full scale REF(4.096V) = 4.096V
whismanoid 26:f71e4817e8c6 178 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 179 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 180 //
whismanoid 26:f71e4817e8c6 181 // example #2
whismanoid 26:f71e4817e8c6 182 code = 0xe6665; // 90.0% of full scale REF(4.096V) = 3.686V
whismanoid 26:f71e4817e8c6 183 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 184 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 185 //
whismanoid 26:f71e4817e8c6 186 // example #3
whismanoid 26:f71e4817e8c6 187 code = 0xccccc; // 80.0% of full scale REF(4.096V) = 3.277V
whismanoid 26:f71e4817e8c6 188 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 189 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 190 //
whismanoid 26:f71e4817e8c6 191 // example #4
whismanoid 26:f71e4817e8c6 192 code = 0xb3332; // 70.0% of full scale REF(4.096V) = 2.867V
whismanoid 26:f71e4817e8c6 193 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 194 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 195 //
whismanoid 26:f71e4817e8c6 196 // example #5
whismanoid 26:f71e4817e8c6 197 code = 0x99999; // 60.0% of full scale REF(4.096V) = 2.458V
whismanoid 26:f71e4817e8c6 198 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 199 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 200 //
whismanoid 26:f71e4817e8c6 201 // example #6
whismanoid 26:f71e4817e8c6 202 code = 0x7ffff; // 50.0% of full scale REF(4.096V) = 2.048V
whismanoid 26:f71e4817e8c6 203 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 204 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 205 //
whismanoid 26:f71e4817e8c6 206 // example #7
whismanoid 26:f71e4817e8c6 207 code = 0x66666; // 40.0% of full scale REF(4.096V) = 1.638V
whismanoid 26:f71e4817e8c6 208 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 209 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 210 //
whismanoid 26:f71e4817e8c6 211 // example #8
whismanoid 26:f71e4817e8c6 212 code = 0x4cccc; // 30.0% of full scale REF(4.096V) = 1.229V
whismanoid 26:f71e4817e8c6 213 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 214 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 215 //
whismanoid 26:f71e4817e8c6 216 // example #9
whismanoid 26:f71e4817e8c6 217 code = 0x33333; // 20.0% of full scale REF(4.096V) = 0.819V
whismanoid 26:f71e4817e8c6 218 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 219 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 220 //
whismanoid 26:f71e4817e8c6 221 // example #10
whismanoid 26:f71e4817e8c6 222 code = 0x19999; // 10.0% of full scale REF(4.096V) = 0.410V
whismanoid 26:f71e4817e8c6 223 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 224 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 225 //
whismanoid 26:f71e4817e8c6 226 // example #11
whismanoid 26:f71e4817e8c6 227 code = 0x0000; // 0.0% of full scale REF(4.096V) = 0.000V
whismanoid 26:f71e4817e8c6 228 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 229 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 230 //
whismanoid 26:f71e4817e8c6 231 // example #12
whismanoid 26:f71e4817e8c6 232 code = 0x0000; // 0.0% of full scale REF(4.096V) = 0.000V
whismanoid 26:f71e4817e8c6 233 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 234 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 235 //
whismanoid 26:f71e4817e8c6 236 // example #13
whismanoid 26:f71e4817e8c6 237 code = 0x19999; // 10.0% of full scale REF(4.096V) = 0.410V
whismanoid 26:f71e4817e8c6 238 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 239 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 240 //
whismanoid 26:f71e4817e8c6 241 // example #14
whismanoid 26:f71e4817e8c6 242 code = 0x33333; // 20.0% of full scale REF(4.096V) = 0.819V
whismanoid 26:f71e4817e8c6 243 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 244 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 245 //
whismanoid 26:f71e4817e8c6 246 // example #15
whismanoid 26:f71e4817e8c6 247 code = 0x4cccc; // 30.0% of full scale REF(4.096V) = 1.229V
whismanoid 26:f71e4817e8c6 248 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 249 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 250 //
whismanoid 26:f71e4817e8c6 251 // example #16
whismanoid 26:f71e4817e8c6 252 code = 0x66666; // 40.0% of full scale REF(4.096V) = 1.638V
whismanoid 26:f71e4817e8c6 253 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 254 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 255 //
whismanoid 26:f71e4817e8c6 256 // example #17
whismanoid 26:f71e4817e8c6 257 code = 0x7ffff; // 50.0% of full scale REF(4.096V) = 2.048V
whismanoid 26:f71e4817e8c6 258 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 259 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 260 //
whismanoid 26:f71e4817e8c6 261 // example #18
whismanoid 26:f71e4817e8c6 262 code = 0x99999; // 60.0% of full scale REF(4.096V) = 2.458V
whismanoid 26:f71e4817e8c6 263 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 264 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 265 //
whismanoid 26:f71e4817e8c6 266 // example #19
whismanoid 26:f71e4817e8c6 267 code = 0xb3332; // 70.0% of full scale REF(4.096V) = 2.867V
whismanoid 26:f71e4817e8c6 268 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 269 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 270 //
whismanoid 26:f71e4817e8c6 271 // example #20
whismanoid 26:f71e4817e8c6 272 code = 0xccccc; // 80.0% of full scale REF(4.096V) = 3.277V
whismanoid 26:f71e4817e8c6 273 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 274 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 275 //
whismanoid 26:f71e4817e8c6 276 // example #21
whismanoid 26:f71e4817e8c6 277 code = 0xe6665; // 90.0% of full scale REF(4.096V) = 3.686V
whismanoid 26:f71e4817e8c6 278 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 279 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 280 //
whismanoid 26:f71e4817e8c6 281 // example #22
whismanoid 26:f71e4817e8c6 282 code = 0xfffff; // 100.0% of full scale REF(4.096V) = 4.096V
whismanoid 26:f71e4817e8c6 283 g_MAX5719_device.CODE_LOAD(code);
whismanoid 26:f71e4817e8c6 284 wait_ms(3000); // wait_ms(unsigned long interval_msec)
whismanoid 26:f71e4817e8c6 285
whismanoid 26:f71e4817e8c6 286 // wait(3.0);
whismanoid 26:f71e4817e8c6 287 }
whismanoid 26:f71e4817e8c6 288 }
whismanoid 26:f71e4817e8c6 289