Hello,
Is it possible to control the module parameters via I2C or by reading external potentiometers?
For example, you can use the DC source in the project but there is no way to control it.
Thank you!
Hello,
Is it possible to control the module parameters via I2C or by reading external potentiometers?
For example, you can use the DC source in the project but there is no way to control it.
Thank you!
3:56pm
Hi Tim,
Good question. It is indeed possible to control a source module in your layout with external GPIO pins. For an example, please see Source/ControlDriver.c and the GPIO_SourceSink.awd example layout in the STM32F407 BSP, available on our website's download page:https://dspconcepts.com/downloads
Basically you can set your code in ControlDriver.c to assign IO pins to Source modules by objectID, and then set the Source module with the value of the pin.
Let me know if you have any problems,
-Axel
4:12pm
Hi Axel,
I found the InitializeControlPeripheral function in the ControlDriver.c file which looks like where the CTRL_BUTTON1 and CTRL_LED6 are initialized. I also see in the .awd where the object IDs are set for the two modules. Are these ID numbers arbitrary? Where do they appear in the C code to associate them with the hardware? Are analog inputs initialized differently than binary ones?
Is there some official documentation on this showing how to get this working?
Thank you!
Tim
10:10am
The object IDs must be between 30000 and 32767, but are otherwise arbitrary. The same object ID must be used in the .awd and in the C code for each source/sink module. See ControlDriver.h for the definitions in the STM32F407 BSP.
I assume by analog inputs you mean that you'll be dealing with arrays instead of scalers? In this case, I would suggest using the Buffer Source module and then updating the ControlDriver.c code to handle the assignment of pModule->value to point to your array.
Hope this helps,
-Axel
5:44pm
Hi Axel,
I'm working on external control for STM32F407 board. I see the references to an example GPIO_SourceSink.awd, but I am unable to locate this project anywhere. I would be grateful to a pointer to this or other examples to show how I might use a pot to control filter gain or cutoff frequency, or a pushbutton to control a multiplexor, all standalone. Thank you!
Joyce
1:13pm
Hi Joyce,
This thread is quite old and the most modern BSPs on our website no longer have this GPIO example. I have attached the .awd to this ticket as a reference, but it may not be compatible with the most recent BSPs.
To accomplish what you are talking about, there are 2 methods possible with AWE Core. The first is shown in this GPIO example .awd, which has a corresponding file in the BSP source code called GPIO.c that interfaces with the GPIO module on the canvas and the interfaces on the ST hardware.
While the GPIO control method above is possible, we generally recommend the more flexible method of using our control interface APIs. By assigning custom objectID's to modules in your layout in Designer (right click module, ObjectIDs -> Assign) and generating a ControlInterface.h file from the 'Generate Target Files' menu, you can then write code using our control interface API's in the BSP to access and modify module variables with whatever IO devices you may have available on the hardware. I've included some links to helpful sections of our documentation that describes this in more detail.
ControlInterface.h file: https://documentation.dspconcepts.com/awe-designer/latest-version/awe-de...(8.D.2.3)AWEDesignerTools-GenerateTargetFiles
AWE Core Control Interface API's: https://w.dspconcepts.com/hubfs/Docs-AWECore/AWECore_API_Doc/index.html#...
AWE Core Control Interface Example: https://w.dspconcepts.com/hubfs/Docs-AWECore/AWECore_API_Doc/a00082.html
Hope this helps
-Axel