質問

I have been working with Beaglebone lately and have a question.

I have worked with TI microcontrollers before, setting the registers as I needed to.

From what I understand, the Angstrom distro (the one that comes with the board) let to set the registers of the processor as you want (through the kernel and class folders from /sys). How can relate the files in Angstrom with the registers of the TI microprocessor?

Also, how can I set the clock/timer for the PWM signals? I want to do it through a program in C. I have found libraries and programs written in python but they do not help me to understand what is really been set.

I appreciate the help you could provide.

Thanks in advance.

gus

役に立ちましたか?

解決

I have recently started using the beaglebone and needed something similar. After figuring out the MUX tables in the System Reference Manual for the beaglebone I figured out what is required.

At /sys/kernel/debug/omap_mux/ there are all the files for multiplexing functionalities to each pin on the board. You need to write the mode number to the correct file to set the mode for the pwm port you want.

writing 1 to mcasp0_aclkx activates pwm ehrpwm.0:0 on pin 9_31.

writing 1 to mcasp0_fsx activates pwm ehrpwm.0:1 on pin 9_29.

writing 6 to gpmc_a2 activates pwm ehrpwm.1:0 - port 9-14.

writing 6 to gpmc_a3 activates pwm ehrpwm.1:1 - port 9-1.

writing 4 to gpmc_ad8 activates pwm ehrpwm.2:0 - port 8-19.

writing 4 to gpmc_ad9 activates pwm ehrpwm.2:1 - port 8-13.

writing 0 to ecap0_in_pwm0_out activates pwm ecap.0 - port 9-42.

writing 4 to mcasp0_ahclkr activates pwm ecap.2 - port 9-28

The corresponding pwm files are at /sys/class/pwm/

then you can follow the AM335x PWM Driver's Guide for which files to write to to activate the pwm signal.

他のヒント

Given that you have kernel support for the PWM (3.2.6+) use the /sys interface. see: AM335x PWM Driver's Guide

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top