HOME
  • GM-3568JHF
  • M4-R1
  • M5-R1
  • SC-3568HA
  • M-K1HSE
  • CF-NRS1
  • CF-CRA2
  • 1684XB-32T
  • 1684X-416T
  • C-3568BQ
  • C-3588LQ
  • GC-3568JBAF
  • C-K1BA
Shop
  • English
  • 简体中文
HOME
  • GM-3568JHF
  • M4-R1
  • M5-R1
  • SC-3568HA
  • M-K1HSE
  • CF-NRS1
  • CF-CRA2
  • 1684XB-32T
  • 1684X-416T
  • C-3568BQ
  • C-3588LQ
  • GC-3568JBAF
  • C-K1BA
Shop
  • English
  • 简体中文
  • GM-3568JHF

    • 1. Introduction

      • GM-3568JHF Introduction
    • 2. Quick Start

      • 01 Environment Construction
      • 02 Compilation Instructions
      • 03 Burning Guide
      • 04 Debugging Tools
      • 05 Software Update
      • 06 View information
      • 07 Test Command
      • 08 Application Compilation
      • 09 Source code acquisition
    • 3. Peripherals and Interfaces

      • USB
      • Display and touch
      • Ethernet
      • WIFI
      • Bluetooth
      • TF-Card
      • Audio
      • Serial Port
      • CAN
      • RTC
    • 4. Application Development

      • 01 UART read and write case
      • 02 Key detection case
      • 03 LED light flashing case
      • 04 MIPI screen detection case
      • 05 Read USB device information example
      • 06 FAN Detection Case
      • 07 FPGA FSPI Communication Case
      • 08 FPGA DMA read and write case
      • 09 GPS debugging case
      • 10 Ethernet Test Cases
      • 11 RS485 reading and writing examples
      • 12 FPGA IIC read and write examples
      • 13 PN532 NFC card reader case
      • 14 TF card reading and writing case
    • 5. QT Development

      • 01 ARM64 cross compiler environment construction
      • 02 QT program added automatic startup service
    • 6. Others

      • 01 Modification of the root directory file system
      • 02 System auto-start service

06 FAN Detection Case

1 Case Introduction

This case aims to introduce how to test the fan interface on the development board to control the fan start, stop and speed regulation functions.

2 FAN Interface Introduction

The FAN interface on the development board is a 4P interface, but only three ports are functional, namely 12V, PWM, and GND. The fan is debugged through PWM signal control.

3 Operation process

Open the terminal and copy the executable program smdt_fan_demo in the bin directory of this case (05-Development Materials\Software Development Materials\linux_demo\smdt_fan_demo\bin) to the development board file system (the source code can be viewed in the src path).

Optional operation: Because the development board is equipped with a wireless network card, if the terminal keeps displaying the log information generated by the wireless network card driver, you can modify the display level of the Linux kernel log by using the following code.

#修改 Linux 内核日志的显示级别,内核的日志级别被设置为只显示紧急或更高级别的消息
echo 1 4 1 7 > /proc/sys/kernel/printk

First check if the PWM device is exported. If it is not exported, we need to export the PWM device. Here we select the device pwmchip0 to export the first channel (pwm0)

#检查 /sys/class/pwm/pwmchip0 目录中是否有 pwm0
ls /sys/class/pwm/pwmchip0

#若没有,则导出 PWM 设备
echo 0 > /sys/class/pwm/pwmchip0/export

#再次检查是否成功导出 PWM 设备
ls /sys/class/pwm/pwmchip0

Execute the following command in the terminal to switch to the directory where the smdt_fan_demo executable program is located

#切换到 smdt_fan_demo 可执行程序所在目录
cd ‘可执行文件所在目录’

#查看 smdt_fan_demo 是否在该目录下
ls

If the executable file smdt_fan_demo is in the current directory, modify the permissions of the executable file

#修改文件权限
chmod 777 smdt_fan_demo

#查询是否修改成功
ls -ld smdt_fan_demo

After confirming that the file modification permission is successful, execute ./smdt_fan_demo -h to view the help information of the program. The default parameters of some settings in this test script are as follows: period: 200000, that is, the PWM waveform period is 200ms polarity: normal In this mode, duty_cycle represents the duration of the high level in one cycle.

#查看帮助信息
./smdt_fan_demo -h

The execution result is as follows:

FAN_1

Enter the following command to test the start, stop and speed regulation of the fan.

#查看帮助信息
#风扇启动
./smdt_fan_demo -s

#风扇调速
./smdt_fan_demo -p 50		#50%占空比

#风扇停止
./smdt_fan_demo -k

Fan startup execution result:

FAN_2

The fan is set to 50% duty cycle execution result:

FAN_3

Fan stop execution result:

FAN_4
Edit this page on GitHub
Last Updated:
Contributors: zsl, zwhuang
Prev
05 Read USB device information example
Next
07 FPGA FSPI Communication Case