PWM and 1Wire access

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sting
 
Posts: 173
Joined: Sun Jan 17, 2010 7:44 pm

PWM and 1Wire access

Post by sting »

I am trying to build a project on the beaglebone black that can use both a 1 wire DS18B20 temperature sensor and several PWM pins. I have the Rev C beaglebone black with the debian that was shipped on the device. I have an overlay that I can successfully use the 1 wire device but have been unsuccessful with the PWM pins unless I use the universaln overlay. The problem with the universaln overlay is that I can't create a hole for the 1 wire pin and I can't sort out how to use 1 wire device with the universaln overlay. And pointers would be helpful.

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: PWM and 1Wire access

Post by drewfustini »

Please post the overlay that you are using.

Which pins are you attempting to use for PWM?

User avatar
sting
 
Posts: 173
Joined: Sun Jan 17, 2010 7:44 pm

Re: PWM and 1Wire access

Post by sting »

I want to eventually use 4 independent pins but until I get it to work I an focusing on P8_13.

The overlay is:
/dts-v1/;
/plugin/;

/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";

/* identification */
part-number = "BREW_PWM_P8_13";

/* state the resources this cape uses */
exclusive-use =
/* the pin header uses */
"P8.13",
/* the hardware IP uses */
"ehrpwm2B";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
brew_pwm_P8_13: pinmux_brew_pwm_P8_13 {
pinctrl-single,pins = <0x024 0x24>;
};
};
};

fragment@1 {
target = <&ocp>;
__overlay__ {
brewery_pwm_P8_13 {
compatible = "pwm_brew";
pwms = <&ehrpwm2 1 500000 0>;
pwm-names = "PWM_P8_13";

pinctrl-names = "default";
pinctrl-0 = <&brew_pwm_P8_13>;

enabled = <1>;
duty = <0>;
status = "okay";
};
};
};
};

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: PWM and 1Wire access

Post by drewfustini »


User avatar
sting
 
Posts: 173
Joined: Sun Jan 17, 2010 7:44 pm

Re: PWM and 1Wire access

Post by sting »

Sorry it has taken me so long to get back at this.

I am using pin P9.22 and it is working fine.

When I compile the P8_13 overlay and run

echo PWM_P8_13 > /sys/devices/bone_capemgr.?/slots

the directory /sys/devices/ocp.3/brewery_pwm_P8_13.15 shows up.

and cat /sys/devices/bone_capemgr.?/slots shows the device PWM_P8_13 loaded

it has the following: modalias, power, subsystem, uevent
and I was expecting: duty, polarity, period, run to let me control the pwm.

I am clearly missing something, I appreciate any help.

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: PWM and 1Wire access

Post by drewfustini »

I'd like to know what system software is on your BeagleBone. Please paste the output of:

cat /etc/dogtag

uname -a

cat /etc/debian_version
sting wrote: I am using pin P9.22 and it is working fine.
1wire is working OK on that pin?
sting wrote: When I compile the P8_13 overlay and run
echo PWM_P8_13 > /sys/devices/bone_capemgr.?/slots
the directory /sys/devices/ocp.3/brewery_pwm_P8_13.15 shows up.
and cat /sys/devices/bone_capemgr.?/slots shows the device PWM_P8_13 loaded
it has the following: modalias, power, subsystem, uevent
and I was expecting: duty, polarity, period, run to let me control the pwm.
I'm not sure you need to specify PWM pins in a custom device tree overlay.

Please post the output of:

cat /sys/devices/bone_capemgr.?/slots

dmesg | tail -20

User avatar
sting
 
Posts: 173
Joined: Sun Jan 17, 2010 7:44 pm

Re: PWM and 1Wire access

Post by sting »

Here is the info you asked for

debian@SIG10142:~/Foo$ cat /etc/dogtag
BeagleBoard.org Debian Image 2015-03-01
debian@SIG10142:~/Foo$ uname -a
Linux SIG10142 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux
debian@SIG10142:~/Foo$ cat /etc/debian_version
7.9

The pin I am using for my one wire device is P9 22;

the other information you wanted to see.
I do not have the one wire overlay loaded as I am trying to just get the pwm working.

root@SIG10142:/home/debian# echo PWM_P8_13 > /sys/devices/bone_capemgr.?/slots
root@SIG10142:/home/debian# cat /sys/devices/bone_capemgr.?/slots
0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
7: ff:P-O-L Override Board Name,00A0,Override Manuf,PWM_P8_13

root@SIG10142:/home/debian# dmesg | tail -20
[ 17.974609] hub 2-0:1.0: TT requires at most 8 FS bit times (666 ns)
[ 17.974618] hub 2-0:1.0: power on to power good time: 10ms
[ 17.974641] hub 2-0:1.0: local power source is good
[ 17.974724] hub 2-0:1.0: enabling power on all ports
[ 18.075334] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0000
[ 18.075393] hub 2-0:1.0: hub_suspend
[ 18.075421] usb usb2: bus auto-suspend, wakeup 1
[ 18.792080] tilcdc 4830e000.fb: timeout waiting for framedone
[ 20.486288] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[ 35.209619] postgres (1251): /proc/1251/oom_adj is deprecated, please use /proc/1251/oom_score_adj instead.
[ 44.301298] tilcdc 4830e000.fb: timeout waiting for framedone
[ 60.805411] bone-capemgr bone_capemgr.9: part_number 'PWM_P8_13', version 'N/A'
[ 60.814618] bone-capemgr bone_capemgr.9: slot #7: generic override
[ 60.814682] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 7
[ 60.814731] bone-capemgr bone_capemgr.9: slot #7: 'Override Board Name,00A0,Override Manuf,PWM_P8_13'
[ 60.815041] bone-capemgr bone_capemgr.9: slot #7: Requesting part number/version based 'PWM_P8_13-00A0.dtbo
[ 60.815089] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware 'PWM_P8_13-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 61.263262] bone-capemgr bone_capemgr.9: slot #7: dtbo 'PWM_P8_13-00A0.dtbo' loaded; converting to live tree
[ 61.264004] bone-capemgr bone_capemgr.9: slot #7: #2 overlays
[ 61.271562] bone-capemgr bone_capemgr.9: slot #7: Applied #2 overlays.

User avatar
sting
 
Posts: 173
Joined: Sun Jan 17, 2010 7:44 pm

Re: PWM and 1Wire access

Post by sting »

@ drewfustini

I thank you for your help. I worked all weekend trying to resolve this issue and finally decided that the kernel that shipped with the board should be upgraded. I moved to the Debian 8.4 2016-05-13 lxqt image.

I will know more when I

1) figure out what bloatware I can remove to make the board reasonable performance.
2) determine how to remote deploy QT applications

Then I can get back to the pwm and ds18b20 functionality

Thank you.

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: PWM and 1Wire access

Post by drewfustini »

For smaller image, you might want try either the IoT image:
http://elinux.org/Beagleboard:BeagleBon ... apshot_iot

Or the even smaller, console image:
http://elinux.org/Beagleboard:BeagleBon ... ot_console

User avatar
sting
 
Posts: 173
Joined: Sun Jan 17, 2010 7:44 pm

Re: PWM and 1Wire access

Post by sting »

Thanks,

I am going to build a brewery and I need some UI. I have built Qt applications in the past and figured this would be fairly straight forward. The problem is that X + the Qt runtime just to support dmlight are so big that it is cumbersome to use.

I am will look at the iot image, but will need to find a light weight UI, I know it is probably unavailable. But I have to look.

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: PWM and 1Wire access

Post by drewfustini »

Here's a couple looks that might be of interest:

BoneBrews: Home Brewing with BeagleBone Black

PeteLawler/BeagleBrew
A Beaglebone fork of a Raspberry Pi Temperature Controller for homebrewing and sous vide cooking

I know that Qt app can be built to run on the BeagleBone without X Windows by using the Linux framebuffer. Here's some related links:

Qt with Embedded Linux on the Beaglebone

Qt on the BeagleBoard
Procedure for Qt Embedded (without X11)

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”