Hello! I am trying to use eCAP module for generate PWM. But when i try to
ran code in PRU0 i have error "-bash: Invalid argument". That's my code
#include <stdint.h>
#include <string.h>
#include <pru_cfg.h>
#include <pru_ecap.h>
int main(void) {
CT_CFG.SYSCFG_bit.STANDBY_INIT = 0;
СT_ECAP.ECCTL2 = 0x0200; // PWM mode
СT_ECAP.CAP1 = 0x001000; // Period
СT_ECAP.CAP2 = 0x000500; // Duty cycle
СT_ECAP.TSCTR = 0; // Reset the counter
СT_ECAP.CTRPHS = 0;
СT_ECAP.ECEINT = 0x0040; // Counter reset interrupt enable
СT_ECAP.ECCTL1 = 0x0000; // do not reset on capture
СT_ECAP.ECCTL2 |= 0x10; // Start
while (1) {
while ((СT_ECAP.ECFLG & 0x40) == 0); // Wait for timer to
reset
СT_ECAP.CAP2 = 0x500;
СT_ECAP.ECCLR = 0xff; // Clear the condition
}
}
I configurated pin P9_42 like
config-pin P9_42 pru_ecap
Maybe I need to allow the use of eCAP PRU somewhere in the linux system?
--
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/face9652-961e-46d3-9c6c-8dc8af4e7a53%40googlegroups.com.