Hello,

thanks very much for your quick reply. 

   - *Concerning the Kernel:* If I enter the command uname -a I get the 
   following output: Linux beaglebone 4.4.9-ti-r25 #1 SMP Thu May 5 23:08:13 
   UTC 2016 armv7l GNU/Linux. Therefore I assume I am using Kernel 4.4.9
   - *Concerning the Code:*   Well there is no code yet. I assumed that the 
   PWM could be controlled over files, therefore just as I control GPIOS by 
   writing the desired outputs in the appropriate files. I tried to control 
   the PWM by writing the desired duty_cycle in the file. So I hoped that I 
   could access the PWM from my c++ code by simple file access. However as I 
   mentioned, writing the setting duty_cycle=5000, period=10000 and enable=1 
   in the files I described in my original post, I could not produce any 
   outputs.
   
   - I also tried to use a custom device tree overlay. I generated it using 
   this Website: 
   
http://kilobaser.com/blog/2014-07-28-beaglebone-black-devicetreeoverlay-generator#dtogenerator
   
   with the parameters: P8_36, fastslew, output, pulldown, mode2.
   This gave me the overlay code:
   
   /*
   * Copyright (C) 2013 CircuitCo
   À * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   *
   * This is a template-generated file from BoneScript
   */
   /dts-v1/;
   /plugin/;
   
   / {
   compatible = "ti,beaglebone", "ti,beaglebone-black";
   
   /* identification */
   part-number = "BS_PWM_P8_36_0x2";
   
   /* state the resources this cape uses */
   exclusive-use =
   /* the pin header uses */
   "P8.36",
   /* the hardware IP uses */
   "ehrpwm1A";
   
   fragment@0 {
   target = <&am33xx_pinmux>;
   __overlay__ {
   bs_pwm_P8_36_0x2: pinmux_bs_pwm_P8_36_0x2 {
   pinctrl-single,pins = <0x0c8 0x2>;
   };
   };
   };
   
   fragment@1 {
   target = <&ocp>;
   __overlay__ {
   bs_pwm_test_P8_36 {
   compatible = "pwm_test";
   pwms = <&ehrpwm1 0 500000 0>;
   pwm-names = "PWM_P8_36";
   
   pinctrl-names = "default";
   pinctrl-0 = <&bs_pwm_P8_36_0x2>;
   
   enabled = <1>;
   duty = <0>;
   status = "okay";
   };
   };
   };
   };
   
   which I copied in /lib/firmware/bspwm_P8_36_2-00A0.dts
   and compiled with dtc -O dtb -o /lib/firmware/bspwm_P8_36_2-00A0.dtbo -b 
   0 -@ /lib/firmware/bspwm_P8_36_2-00A0.dts
   After that I loaded the am33xx_pwm as well as the compiled overlay but 
   again I was unable to produce any output by writing the already mentioned 
   values into the files.
   Loading the overlay also generated read only files which I was unable to 
   write any values into, even after running chmod a+w and writing as root.
   

Therefore the Question remains: How can I use the PWM Outputs of the 
Beaglebone black with C++ code?

Thanks again for your help and best regards,
Phil
T

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/3be86866-0420-446e-abd3-c6b65131da24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to