Other Parts Discussed in Thread: ALP, , USB2ANY
Is it possible for ALP to send a PWM signal to one of the GPIOs on the DS90UB947-Q1EVM (via scripting or otherwise?)
Specifically, I'd like to send out a 500Hz, 30% duty cycle PWM signal on GPIO3.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Is it possible for ALP to send a PWM signal to one of the GPIOs on the DS90UB947-Q1EVM (via scripting or otherwise?)
Specifically, I'd like to send out a 500Hz, 30% duty cycle PWM signal on GPIO3.
Would something like this work?
import time frequency = 500 # Hertz duty_cycle = 0.3 # 0 to 1 gpio_pin = 3 # 0,1,2,3 cycle_time = 1 / frequency on_interval = cycle_time * duty_cycle off_interval = cycle_time * (1 - duty_cycle) board.WriteReg(0x0F,3) # configure GPIO3 as forward channel output while(1): board.WriteGPIOPin(gpio_pin, 1) time.sleep(on_interval) board.WriteGPIOPin(gpio_pin, 0) time.sleep(off_interval)
Alternatively, could I somehow use one of the PWM pins on the built in USB2ANY and just connect that to the GPIO3 pin of the DS90UB947?
(I think that would work, but I am not sure how to configure the USB2Any pins to output PWM)
Hi Adam,
The following document may be able to help you with the configurations. Once thing to note is that 500 Hz might be too fast of a speed for ALP to configure/program and might create unstable PWM and cause jitter. I would recommend using a function generator to apply the signal to the EVM for the cleanest application.
API Reference for USB2ANY SDK 2.8.pdf
Best,
Shu
I read through it, though was unable to get the usb2any dll to respond as expected, at least from the ALP scripting interface. Here's what I tried:
Texas Instruments - Analog LaunchPAD © 2007-2021 Texas Instruments Inc. All Rights Reserved The variable "alpBoards" contains a list of ALP Board objects present on this machine. >from ctypes import * >usb2anydll = windll.LoadLibrary('C:\\Program Files (x86)\\Texas Instruments\\Analog LaunchPAD v1.57.0010\\Drivers\\i2c_controllers\\usb2any\\python\\USB2ANY.dll') > >usb2anydll.u2aOpen(0) -12 >u2ahandle = usb2anydll.u2aOpen(0) > >usb2anydll.u2aPWM_Control(u2ahandle,2,0,3,5000,4,1000,0) -24 >usb2anydll.u2aPWM_Control(u2ahandle,2,0,3,500000,4,100000,0) -24
I had a logic analyzer hooked up to the usb2any's PWM pins and did not see any output at all.
Hi Adam,
Unfortunately, my support is limited to FPD-Link devices and I recommend that you reach out to the USB2ANY team for the most effect assistance on this inquiry.
Best,
Shu
Hi Adam,
We do not have the functionality on the 947 EVM to generate a stable PWM output.
Best,
Shu