CN0540 and the STM Discovery Kit

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 32F746GDISCOVERY board via the Arduino headers. The 32F746GDISCOVERY board only requires a Standard-A to Mini-B USB cable to connect to the PC. If properly connected the large red LED LD7 should light as well as the red LED LD2.

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

Software Setup

Porting the MBED Example program to DISCO-F746NG

  1. Import the EVAL-CN0540-ARDZ example program into your online compiler by following the instructions in CN0540 and the SDP-K1.

  2. Click the “Platform Selection” section of your online IDE.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_stm1.png
  3. Select the “Add Board” option.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_stm2.png
  4. Search for the DISCO-F746NG board on the available platforms.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_stm3.png
  5. Add the DISCO-F746NG board to your online compiler.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_stm4.png
  6. The DISCO-F746NG board will now be available in your platforms. Select it and recompile the code.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_stm5.png
  7. Load the extracted binary to the DISCO-F746NG board by dragging and dropping the binary file to the DISCO-F746NG directory.

    Note

    Refer to this video for an example on how to load a program: https://youtu.be/3xbzuPLcmCk?t=233

Installing the 32F746 Discovery Board driver

  1. Download the ST-LINK/V2 driver and run the .exe file. Follow the instructions on the window that appears to install the driver.

    Note

    This requires a free account for my.st.com.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/f746gdisco_download.png
  2. Plug the USB cables from the PC into the 32F746G Discovery board. If installation was successful a new device named DIS_F746NG should appear under ‘This PC’ in Windows File Explorer.

    https://media.githubusercontent.com/media/analogdevicesinc/documentation/main/docs/solutions/reference-designs/eval-cn0540-ardz/images/cn0540_f746gdiscopc.png
  3. Copy and paste or drag and drop the compiled .bin file (from the MBED project compiled earlier) into the DIS_F746NG device/folder. This will load the firmware onto the board.

  4. If the download fails, a FAIL.TXT file will appear on the DIS_F746NG device.

  5. If the download is successful the .bin file will disappear from the DIS_F746NG device and there will be no FAIL.TXT file.

  6. Unplug the 32F746G Discovery board from the PC and plug it back in to hard reset the board and finalize installation.

Designing a User Interface using the 32F746NG Discovery board

One of the major features of the 32F746G Discovery board is the on-board touchscreen, which can be used by the CN0540 board. Users can design their own User Interface (UI) by adding the DISCOF746NG Board Support Package (BSP). Using the DISCOF746NG BSP, a custom UI can be done as shown in the images below.

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