Multi-channel PWM Design using Macnica Helio.
This design demonstrates how to utilize the Macnica Helio SoC board to add multi-channel PWM (pluse width modulation) device.

27 Jun 2015 - 01:38 | Version 150 | | , | , , , ,

Board: Mpression Helio SoC Evaluation Kit by Macnica
Tools Version: 13.1
State: running
Members: NDRcoLTD



This design demonstrates how to utilize the Macnica Helio SoC board to add multi-channel PWM device. This system provides 10-channel PWM signal that consists of FPGA logic, device driver and sysfs user interface.

Block Diagram
Figure 1: Block diagram


This video demonstrates the creation of a sine wave using 10 cooling fan and table tennis balls. In the video, control boards are connected to the HSMC expansion connector for generating PWM signel.


The following items are reuired:

Hardware requirement

  • Macnica Helio Board rev.1.3
  • 2GB microSDHC flash card
  • Daughter board
    • DRB-THG board-HSMC version (terasic)
    • Tolerant Buffer board (Developed in NDR on universal board)
  • FAN I/F board (Developed in NDR on universal board)
  • FAN: 9GA0412P6H001 (Sanyo Denki)

Software requirement

  • Quartus2 64-bit Version 13.1.2 Build 173 01/15/2014 SJ Web Edition
  • Qsys 13.1 Build 173

Release Contents

File Description
helio-pwm-sdimage_v1.0.tar.gz SD Image
helio-pwm-sdimage_v1.0.tar.gz is a 2GB SD card image tar file contains all the require components for demo, including Preloader, U-boot, rootfs, kernel image and device tree blob. FPGA Configuration Data archive
  Daughter Board Schematic

Quick Start Guide

  1. Write helio-pwm-sdimage_v1.0.img
    $ sudo dd if=helio-pwm-sdimage_v1.0.img of=/dev/hdx bs=1M
 2. Write " helio_ghrd_fancon.jic" file in FPGA.
 3. boot Linux
 4. login as root
 5. change working directory
  # cd fan
 6. load the pwm driver
  # ./ load
 7. change the PWM
  # echo xxxx > /sys/class/pwm/pwmchip0/pwm?/duty_cycle
   xxxx:0~1999 (PWM duty value)
     ?:0~9 (FAN No.)
 8. start the sine wave application.
  # ./ start
   to stop the application for Ctrol-C


Development Environment

We developed custom pwm driver, sysfs interface and application.

  • Ubuntu Linux 14.02
  • GSRD v13.1 Yocto Source Package


   * Driver
     * linux/driver/pwm/core.c (update)
     * linux/driver/pwm/sysfs.c (update)
     * linux/driver/pwm/pwm-socfpga.c (new)
   * SYSFS
   -- pwmchip0/
      |-- export
      |-- npwm
      |-- pwm[0-9]/
      |   |-- duty_cycle      (duty width)
      |   |-- enable
      |   |-- fan_cycle       (rotation speed of the motor)
      |   |-- period          (period 4000 fixed)
      |   — polarity
      -- unexport

Give us your feedback

© 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Privacy.