Skip to content

Issues with PWM control via sysfs #1

@jerivas

Description

@jerivas

Hi, I've added PWM support via sysfs to my pcDuino 3 following these instructions: http://learn.linksprite.com/pcduino/arduino-ish-program/pwm/add-pwm-sysfs-support-for-pcduino-pcduino3/

Everything works fine... kind of. These are a few bugs I've found:

  1. It seems that whenever I enable pins, their max_levels change. Before enabling pins 5, 6, they report a max level of 255, after enabling them, they report 39. Before enabling pins 3, 9, 10, 11; they report a max level of 32. After enabling, they report a max level of 640.
  2. Pins 3, 9, 10, 11 are unable to maintain their assigned frequency if the CPU is busy with anything. I assigned a frequency of 50 Hz to them to drive some servos, but if I do pretty much anything with the pcDuino (like opening the web browser), the servos begin to stutter because of the jitter in the PWM signal. I guess these pins use software produce the PWM signal.
  3. To work around the stutter problem, I decided to drive the servos with pins 5 and 6, because in my tests they are jitter-free. The problem is they have a very limited range (because their max level is only 32), which translates in a servo resolution of 30º per step.

I would like to know if there is a way to solve any of these issues:

  1. Prevent the jitter in pins 3, 9, 10, 11
  2. Or, increase the max_level in pins 5 and 6 (because they are suppossed to be 8-bit PWM)

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions