Hi guys,
I am working on a product for which the hardware layout and pin-out does not allow me to use my PWM assigned ports. For this reason I am trying to generate one via SW using a Digital Output port.
This is working fine, but I would like to have the Timer do the work for me since I see in the manual that I can generate a Timer for a PWM signal by setting a period and a match value. However, when I do this, my routine is not called by any interrupt source. The code is spread apart, but the config is the following:
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_PWM);
TimerControlEvent(TIMER0_BASE, TIMER_B, TIMER_EVENT_BOTH_EDGES);
TimerLoadSet(TIMER0_BASE, TIMER_B, 50000);
TimerMatchSet(TIMER0_BASE, TIMER_B, 40000); IntEnable(INT_TIMER0B);
TimerEnable(TIMER0_BASE, TIMER_B);
TimerIntEnable(TIMER0_BASE, TIMER_TIMB_TIMEOUT | TIMER_CAPB_MATCH);
I know, that TIMER_CAPB_MATCH might not be the right source, but... the question is... can I really do this? What should be the interrupts to expect and look for? Or is the PWM Timer only useful for a real PWM output?
Thanks in advance for any help!