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
- 105 Announcements & News
- 55 Product News - New Product/Product Change Notice/ End-of-life
- 186 Welcome Developers!
- 55 Unboxing & Project Sharing
- 50 Tech Updates
- 693 UP Products
- 11 UP 7000
- 1 UP Squared i12
- 10 UP Xtreme i12
- 11 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 19 UP Squared V2
- 59 UP 4000
- 24 UP Xtreme i11
- 35 UP Squared 6000
- 60 UP Squared Pro
- 143 UP Xtreme
- 837 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 222 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 216 Starter Kits & Peripheral