Implementing a MAX1385-Based C

2011-12-28 15:04:19来源: 互联网
Required Hardware
  • Maxim MAX1385EVKIT+
  • Maxim CMAXQUSB+ (includes USB A-B cable)
  • Windows 2000/XP PC with USB port
  • 5VDC at 100mA power supply
  • 10VDC at 1000mA power supply
  • DMM for measuring drain current
  • DMM for measuring drain voltage
  • DMM for measuring PGAOUT amplified current-sense voltage
  • Optional: oscilloscope for monitoring GATE1 voltage and PGAOUT1 drain current

Setup

Download and unzip the necessary executable and source code files (ZIP, 736kB).

Assemble the hardware according to Figure 1.
  • Plug the CMAXQUSB header P3 into the MAX1385EVKIT connector J1.
  • Connect the MAX1385EVKIT's DRAIN1 and DRAIN2 pins to the current meter (-).
  • Connect the current meter (+) to the power supply (+).
  • Connect the MAX1385EVKIT's SOURCE1 and SOURCE2 pins to the power supply (-).
  • Connect the voltage meter (+) to the MAX1385EVKIT's DRAIN1 pin.
  • Connect the voltage meter (-) to the MAX1385EVKIT's SOURCE1 pin.
  • Connect the MAX1385EVKIT's AVDD pin to the DVDD pin (or, optionally, connect to an external 5V DC supply).

More Detailed Image (PDF, 387kB)
Figure 1. MAX1385EVKIT hardware configuration.

Procedure

Set the CMAXQUSB's VDD Select jumper to the 5V position.

Connect the CMAXQUSB to the PC's USB port. If this is the first time a CMAXQUSB has been attached to the PC, the plug-and-play wizard will appear. Guide the GUI to the installed location of the device driver, in MAX1385_Appnote_src.zip\src\USB_driver.

Start the DEMO1385.EXE program. A console will appear on the screen. Enter the following series of commands at the console:

Command Action
C Connects to the CMAXQUSB module. Verify that the software reports: Board connected.
Got board banner: Maxim CMAXQUSB V01.04.32 >

Searching for MAX1385...
Found MAX1385 at 0x4e

  Note: when using MAX1385EVKIT with CMAXQUSB,
        connect 5V DVDD supply to AVDD.
T V P Test menu/verify power-up values
T S O FCT1 0300 Test menu/servo mode/output register/FineCalThru1 register, initial value 0x0300
T S I FF Test menu/servo mode/input register/FIFO register
T S A 2 Test menu/servo mode/ADC command/trigger channel 2 (current CS1)
T S T 0020 Test menu/servo mode/target value 0x0020
T S C 1 Test menu/servo mode/convergence step positive 1
T S H 1 Test menu/servo mode/hysteresis one step
T S M 60000 Test menu/servo mode/maximum loop duration set to 60 seconds
T S R Test menu/servo mode/run
T W FCT1 0300 Test menu/write register/FineCalThru1 register, value 0x0300

Monitor the regulation by watching the DMM.

The voltage on PGAOUT1 regulates between 20.8mV and 21.7mV, which is a variation of 0.45mV (2%) around an average of 21.25mV.

Source Code Walk-Through

The source code was developed with the free dev-cpp IDE, which uses the GNU gcc-3.4.2 C++ compiler.

Listing 1 shows a simplified version of the C++ code performed inside the regulation loop. Output statements and error handling have been removed for clarity.

Listing 1. Simplified C++ code.


Menu System

The complete source code implements the console menu system seen in Listing 2, which connects to the CMAXQUSB module.

Listing 2. Console menu system.
============================================================
CmodComm test program main menu when not connected
 A) adjust timing parameters
 L) CmodLog... functions
 C) connect
 D) Debug Messages
 X) exit

---------------------------------------------
C


Board connected.

Got board banner: Maxim CMAXQUSB V01.04.32 >

Searching for MAX1385...
Found MAX1385 at 0x4e

       Note: when using MAX1385EVKIT with CMAXQUSB,
             connect 5V DVDD supply to AVDD.


============================================================
CmodComm test program main menu after successful connect
 T) Test the device
 8) CmodP8Bus... functions
 A) adjust timing parameters
 L) CmodLog... functions
 P) CmodPin... functions
 S) CmodSpi... functions
 M) CmodSMBus... functions
 $) CmodCommStringWrite list of hex codes
 R) CmodBoardReset
 D) Disconnect


============================================================
T Test menu
T ?                     Hunt for active devices
T R                     Read register
T W                     Write register
T S                     Servo loop
T VP                    Verify Power-On Register Values
T VM reg mask           Verify Register Memory Persistence, All Combinations ...
T VW reg mask           Verify Register Memory Persistence, Walking-One's test ...

============================================================
Write register:
T W AD                  Write ADCCON
T W AH                  Write ALMHCFG
T W AS                  Write ALMSCFG
T W FI1                 Write FINE1
T W FI2                 Write FINE2
T W FC1                 Write FINECAL1
T W FC2                 Write FINECAL2
T W FCT1                Write FINECALTHRU1
T W FCT2                Write FINECALTHRU2
T W FT1                 Write FINETHRU1
T W FT2                 Write FINETHRU2
T W HC                  Write HCFG
T W HT1                 Write THRUHI1
T W HT2                 Write THRUHI2
T W HW1                 Write HIWIPE1
T W HW2                 Write HIWIPE2
T W IH1                 Write IH1
T W IH2                 Write IH2
T W IL1                 Write IL1
T W IL2                 Write IL2
T W LD                  Write LDAC
T W LT1                 Write THRULO1
T W LT2                 Write THRULO2
T W LW1                 Write LOWIPE1
T W LW2                 Write LOWIPE2
T W P                   Write PGACAL
T W SC                  Write SCLR
T W SS                  Write SSHUT
T W TH1                 Write TH1
T W TH2                 Write TH2
T W TL1                 Write TL1
T W TL2                 Write TL2
T W X /hexRegAddr/      Write any register by its hexadecimal address

============================================================
Read register:
T R AH                  Read ALMHCFG
T R AS                  Read ALMSCFG
T R FF                  Read FIFO
T R FI1                 Read FINE1
T R FI2                 Read FINE2
T R FL                  Read FLAG
T R HC                  Read HCFG
T R HW1                 Read HIWIPE1
T R HW2                 Read HIWIPE2
T R IH1                 Read IH1
T R IH2                 Read IH2
T R IL1                         Read IL1
T R IL2                         Read IL2
T R LW1                 Read LOWIPE1
T R LW2                 Read LOWIPE2
T R TH1                 Read TH1
T R TH2                 Read TH2
T R TL1                 Read TL1
T R TL2                 Read TL2
T R X /hexRegAddr/      Read any register by its hexadecimal address

============================================================
T S Test Servo menu
T S O FCT1 0300 output register [wr_FINECALTHRU1, initial value 0x0300]
T S I FF        input register [rd_FIFO]
T S A 2         ADC input channel [ bit 2 = 0x0004 = ADCCON_CURRENT_CS1 ]
T S T 0020      target value [0x0020]
T S C 1         ConvergeStep [1]
T S H 1         hysteresis [1]
T S M 60000     max_loop_duration_msec [60000]
T S R           servo loop run

============================================================

Windows is a registered trademark of Microsoft Corp.

关键字:MAX1385  Based  C

编辑:神话 引用地址:http://www.eeworld.com.cn/mndz/2011/1228/article_13659.html
本网站转载的所有的文章、图片、音频视频文件等资料的版权归版权所有人所有,本站采用的非本站原创文章及图片等内容无法一一联系确认版权者。如果本网所选内容的文章作者及编辑认为其作品不宜公开自由传播,或不应无偿使用,请及时通过电子邮件或电话通知我们,以迅速采取适当措施,避免给双方造成不必要的经济损失。
论坛活动 E手掌握
微信扫一扫加关注
论坛活动 E手掌握
芯片资讯 锐利解读
微信扫一扫加关注
芯片资讯 锐利解读
推荐阅读
全部
MAX1385
Based
C

小广播

独家专题更多

富士通铁电随机存储器FRAM主题展馆
富士通铁电随机存储器FRAM主题展馆
馆内包含了 纵览FRAM、独立FRAM存储器专区、FRAM内置LSI专区三大部分内容。 
走,跟Molex一起去看《中国电子消费品趋势》!
走,跟Molex一起去看《中国电子消费品趋势》!
 
带你走进LED王国——Microchip LED应用专题
带你走进LED王国——Microchip LED应用专题
 
电子工程世界版权所有 京ICP证060456号 京ICP备10001474号 电信业务审批[2006]字第258号函 京公海网安备110108001534 Copyright © 2005-2016 EEWORLD.com.cn, Inc. All rights reserved