4.6 KiB
4.6 KiB
SDFM
[TOC]
The ICSS %SDFM driver provides a well defined set of APIs to expose sigma delta interface.
The ICSS %SDFM example invokes these APIs to
- Set %SDFM channels
- Set ACC source, NC OSR, OC OSR, Clock source & Clock inversion
- Enable & disable threshold comparators
- Set high, low & zero cross threshold values
- configure sample trigger time (time for read sample)
- Inform firmware to enable %SDFM mode
- Configure GPIO pins for high, low & zero cross thresholds
Once these steps are executed
- ICSS %SDFM example waits for a interrupt (trigger by %SDFM firmware) to read sample data
- when interrupt occurs, example reads sample data from DMEM and again comes back to waiting loop
ICSS SDFM Example Implementation
Following section describes the Example implementation of ICSS %SDFM on ARM(R5F). \image html SDFM_EXAMPLE_FLOWCHART.png "ICSS SDFM Example"
Important files and directory structure
| Folder/Files | Description |
|---|---|
| ${SDK_INSTALL_PATH}/examples/motor_control/icss_sdfm | |
| app_sddf.c & sddf.c | ICSS %SDFM application |
| ${SDK_INSTALL_PATH}/source/current_sense/sdfm | |
| firmware/ | Folder containing %SDFM firmware sources |
| driver/ | ICSS %SDFM driver |
Supported Combinations
\cond SOC_AM64X
| Parameter | Value |
|---|---|
| CPU + OS | r5fss0-0 freertos |
| ICSSG | ICSSG0 |
| PRU | PRU0 |
| Toolchain | ti-arm-clang |
| Board | @VAR_BOARD_NAME_LOWER |
| Example folder | examples/motorcontrol/sddf |
\endcond
\cond SOC_AM243X
| Parameter | Value |
|---|---|
| CPU + OS | r5fss0-0 freertos |
| ICSSG | ICSSG0 |
| PRU | PRU0 |
| Toolchain | ti-arm-clang |
| Board | @VAR_BOARD_NAME_LOWER |
| Example folder | examples/motorcontrol/sddf |
\endcond
Steps to Run the Example
Hardware Prerequisites
Other than the basic EVM setup mentioned in \htmllink{@VAR_MCU_SDK_DOCS_PATH/EVM_SETUP_PAGE.html, EVM Setup}, below additional HW is required to run this demo
- TIDEP-01015 3 Axis board
- Interface card connecting EVM and TIDEP-01015 3 Axis board
- Signal generator
Hardware Setup
\image html SDFM_HwSetup_image.PNG "Hardware Setup SDFM"
Build, load and run
- When using CCS projects to build, import the CCS project and build it using the CCS project menu (see \htmllink{@VAR_MCU_SDK_DOCS_PATH/CCS_PROJECTS_PAGE.html, Using SDK with CCS Projects}).
- When using makefiles to build, note the required combination and build using make command (see \htmllink{@VAR_MCU_SDK_DOCS_PATH/MAKEFILE_BUILD_PAGE.html, Using SDK with Makefiles})
- Launch a CCS debug session and run the executable, see \htmllink{@VAR_MCU_SDK_DOCS_PATH/CCS_LAUNCH_PAGE.html, CCS Launch, Load and Run}
- Refer to UART terminal for user interface menu options.
Test Case Description
| Test detail | Steps | Pass/fail crieteria |
|---|---|---|
| To check raw data for 64 NC OSR | 1. Set NC OSR to 64 | Resolution of sampled data should be 13.9 bits |
| 2. Set data read time half of epwm cycle | ||
| 3. Set epwm output frequency 20Khz | ||
| 4. Draw graph for Raw data | \image html SDFM_sample_output.PNG "NC sample data" | |
| To check raw data for 32 NC OSR | 1. Set NC OSR to 32 | Resolution of sampled data should be 11.4 bits |
| 2. Set data read time half of epwm cycle | ||
| 3. Set epwm output frequency 20Khz | ||
| To check Threshold comparator | 1. Set High Threshold to 3500 and low threshold to 2500 | Logic analyzer capture for High & Low Thresholds |
| 2. Set Over current OSR to 32 | \image html SDFM_threshold_comparator_salea_capture.png "Logic analyzer Capture" | |
| 3. Probe Ch0 high, low threshold GPIO pins & input signal | ||
| 4. Capture signal in Logic analyzer |