-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BeagleBone Blue PWM #313
Comments
Hello, I see that you are using pin P9_23 in fade.py. Where did you derive the "name to use in code" column from? |
@pdp7 Yes, using the pin name for the BeagleBone Blue does not work. As you can see in the table above I found all the pin names that work in code to address pins in code. Because I am using GPIO1_17 on the Beaglebone Blue, addressing that pin with the name P9_23 in code does work if I want to address that pin so set it as an input or as an output. |
@pdp7 I dont remember now where I got that pin name from since I made that table a long time ago, I think I found a pin map of the Blue in the BBIO source, and then wrote a program that cycled through pin names and sent a blink code to each pin name. If the pin name threw an error it moved on, if it worked I checked if an LED I had connected was blinking. If it was not blinking I told it to move on, if it was blinking I had found the pin name. I did this because I could not find proper documentation for what names to address pins by in code for the BeagleBone Blue. |
@ansarid , yeah we screwed up on the Blue pin naming, it's a cross between the Black's pin naming and a few addon's. By the time this became evident, boards where already shipping with the librobotcontrol library with original naming. This is why on the PocketBeagle, pin naming is so different, we just started it from scratch.. I'd like to clean up the Blue's naming, but there's too much to break now.. Regards, |
@jadonk do you know if PWM is working on the BeagleBone Blue in BoneScript? |
@RobertCNelson any idea what PWM channels map to the pins on the Blue? |
Here's the data when i looked at all the pins: Looks like pwm is on: GPS_3 (ZCZ ball A17) uart2_rxd
GPS_4 (ZCZ ball B17) uart2_txd
SPI1_4 (ZCZ ball B13) spi1_d0
SPI1_5 (ZCZ ball A13) spi1_sclk
S1.2_6 (ZCZ ball C18) spi1_cs1
PS, i should regenerate that with exporting the pin_name.timer* pins too, as that is now a generic pwm output in 4.14.x+ kernels too.. Regards, |
@pdp7 @RobertCNelson I was able to write a program to PWM four of the PWM pins and found that when I PWM UART2_TX(P9_21), It also sends the same PWM signal to SPI1_MISO(P9_29) even if I do not call it in code. Also if I send a PWM to SPI1_MISO(P9_29), a PWM signal will also go to UART2_TX(P9_21). This relationship is also seen between UART2_RX(P9_22) and SPI1_SCK(P9_31). UART2_TX == SPI1_MISO This means that 4 PWM pins instead behave as only 2. For my particular application, I need 4 individually addressable PWM pins. The program below should demonstrate the issue with some LED's connected.
|
@jadonk Does bonescript support PWM on the Blue? I am wondering if I could use bonescript as a reference. |
GPS.4 / P9.21 and SPI1.4 / P9.29 are two mux options for the same signal (ehrpwm0b), hence if you mux both of them to pwm, they will both output the same signal. Same goes for GPS.3 / P9.22 and SPI1.5 / P9.31, which are two mux options for ehrpwm0a. Here's an overview of all PWM resources on the AM335x and to which connector pin or on-board resource of the beaglebone blue they can be muxed:
|
(and of course in times of desperation, a PRU core could be used to generate additional PWM outputs.) |
@MarkAYoder fyi - if you have any students that might want to help with this issue |
Hey, I am trying to do the same thing. I have connected an LED to UART2_TXD and I am varying duty cycle. But I can't see the intensity of LED changing, it is always high. Any idea what can be done? |
Platform/operating system: BeagleBone Blue, bone-debian-9.5-iot-armhf-2018-10-07
Python version: Python 3.5.3 and Python 2.7.13
Error message you are receiving, including any Python exception traces:
Code:
fade.py
Run:
The text was updated successfully, but these errors were encountered: