CN0540 and the SDP-K1

Equipment

Hardware Setup

It’s important to note that the Arduino headers on the CN0540 are surface mounted and as such the user should take care not to bend or break the headers.

Shown below is the CN0540 board mounted on the SDP-K1 board via the Arduino headers. The SDP-K1 only requires a single Standard-A to Mini-B USB cable to connect to the PC. Both the orange Connected LED and green SYS PWR should light on the SDP-K1 if connected correctly.

https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_sdp-k1.png

Software Setup

Importing the EVAL-CN0540-ARDZ MBED Example program

  1. If the user doesn’t have an mbed online account, create one at https://ide.mbed.com/.

  2. After having an account, open the Example program for EVAL-CN0540-ARDZ: https://os.mbed.com/teams/AnalogDevices/code/EVAL-CN0540-ARDZ

  3. Click the import button to import the example program to your online compiler.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_mbed.png https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_mbed_link_2.png
  4. Compile the code and load the extracted binary to the SDP-K1 by dragging and dropping it to the SDP-K1 directory.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_mbed_link_3.png

    Note

    You can refer to this video on how to import an mbed example program: https://youtu.be/3xbzuPLcmCk?t=189

Connecting to a serial terminal application

In order to communicate with the board using the SDP-K1 the user needs to install a serial terminal software on their PC. It is recommended to use PuTTY which is available for free download on the internet. The following steps were written with PuTTY in mind however any other serial terminal application should follow a similar procedure.

  1. Open Device Manager through the Windows control panel and plug the micro-controller board into the PC. When the board is detected it will appear in device manager, displaying as USB Serial Device. This also displays which port the board is connected to. (COM5 in this case)

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540devicemanager.png
  2. Right-click on the COM port in device manager to view and change the properties of the port, such as the transfer speed.

  3. Open the serial terminal application and enter the correct values to configure it to connect to the board. The serial line should be the COM port noted earlier and the speed should be set to 115200 to ensure data transfer works correctly. Also note the changes in the Terminal tab, this is required for the menu to display properly.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540putty.png https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540putty2.png
  4. Upon connection, the interface menu should appear. If not, press the reset button on the micro-controller board to call up the command menu.

    Note

    This does not work with the current version of the SDP-K1.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_putty.png
  5. Type the number corresponding to the desired choice and press ‘Enter’. Note that many choices will create sub-menus, prompting the user to make another choice.

Command Summary

The following table shows every command along with a brief description. Some commands have recommended settings to apply for optimal results for narrow bandwidth measurements of 32 kHz.

Command

Description

Set ADC power mode

Change the power mode of the AD7768-1. The available power modes are Low, Median and Fast, and are described in the datasheet. Low power mode is recommended.

Set ADC MCLK divider

Change the clock divide to: /16, /8, /4 or /2. /16 is recommended.

Set ADC filter type

Change the type of filter used. Also allows for the oversampling ratio to be changed. Recommended is the Low ripple FIR Filter, oversampled by 32.

Set ADC AIN and REF buffers

Adjust the buffers for both AIN and REF. It is recommended to turn on both AIN precharge buffers and precharge both REF buffers.

Set ADC to default config

Resets the ADC configuration to the default.

Set ADC VCM output

Choose the VCM output voltage, recommended is (AVDD1 – AVSS)/2.

Read desired ADC register

Read the ADC registers.

Read continuous ADC data

Reads voltages, codes and raw data from the ADC over a user-defined number of samples.

Reset ADC

Resets the ADC, either a soft reset over SPI or hard reset using the reset pin.

ADC Power-down

Put the ADC into sleep mode or wake it up.

Set ADC GPIOs

Control the ADC GPIOs by reading, writing or changing GPIO settings.

Read ADC master status

Shows faults in master status register, allowing the user to pinpoint the source of problems.

Set ADC Vref and MCLK

Change the values for Vref and MCLK.

Print ADC measured data

Prints previously read voltages, codes and raw data to the terminal. Logging the terminal will allow the user to extract this data. Requires the ‘Read data’ command to have been run.

Set ADC data output mode

Choose how data is output from the ADC.

Set ADC diagnostic mode

Change which diagnostic mode is used for the ADC.

Do the FFT

Does the FFT and prints useful information such as the Total Harmonic Distortion, Signal to Noise Ratio and Dynamic Range.

FFT settings

Change FFT settings such as sample count. Can also print FFT data to the terminal, which can be logged and plotted, requires command ‘Do the FFT’ to have been run.

Gains, Offsets

Set the gain and offset values.

Scratchpad check

Input an 8-bit number, if it is returned the ADC is interfacing with the software. This is a useful quick check for debugging and is good to run after setup.

Compensate Piezo sensor offset

Automatically compensates for voltage offsets in the sensor, giving more accurate data. The user should run this after connecting a new sensor.

Set DAC output

Choose what voltage and codes the LTC2606 DAC should output. This sets the Shift voltage and can be used to manually compensate for any voltage offset.

Important

After connecting a sensor to the board the user should be sure to run option 21 ‘Compensate Piezo sensor offset’ to ensure they get accurate results using their sensor.