PWM0 Example Not Working in Ubuntu 16.04
I'm trying to get PWM0 working on my Up2 board, following the example here:
https://wiki.up-community.org/Pinout_UP2
I have Ubuntu 16.04.5 installed, and otherwise followed the instructions here:
https://wiki.up-community.org/Ubuntu
The GPIO works on that pin (Linux pin number 468), but when I run the PWM example commands, nothing happens.
Any suggestions? Thanks.
Comments
-
Hi @skcolb ,
The best and easy way is to check how the pin level is changing:
$ echo 0 > /sys/class/pwm/pwmchip0/export
$ echo 3413333 > /sys/class/pwm/pwmchip0/pwm0/period
$ echo 1706667 > /sys/class/pwm/pwmchip0/pwm0/duty_cycleBefore active the pin: cat /sys/class/pwm/pwmchip0/pwm0/enable
$ echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
After ative the pin: cat /sys/class/pwm/pwmchip0/pwm0/enableThen, you should see how the pin is off and on when you want.
Also, you could try to conenct a logic analyser in your pin to see something like in the attached pic.
Cheers!
Categories
- All Categories
- 63 Announcements & News
- 58 Product News - New Product/Product Change Notice/ End-of-life
- 99 Welcome Developers!
- 46 Unboxing & Project Sharing
- 114 Tech Updates
- 3.4K UP Products
- 14 UP 7000
- 1 UP Squared i12
- 12 UP Xtreme i12
- 13 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 23 UP Squared V2
- 63 UP 4000
- 23 UP Xtreme i11
- 34 UP Squared 6000
- 57 UP Squared Pro
- 135 UP Xtreme
- 820 UP Squared
- 1.4K UP Board
- 74 UP Core Plus
- 217 UP Core
- 3 UP Xtreme Lite
- 40 UP AI Edge
- 265 Starter Kits & Peripheral