Hello,
when use FTM PWM, i find when use uart to printf the log, the PWM doesn't work,
but when remove printf, then the pwm output the correct waveform.
could you help to check it what is the reason ?
i attached the project, please test it.
duty_cycle=0x0,pwm status=0x1
duty_cycle=0x2000,pwm status=0x1
duty_cycle=0x4000,pwm status=0x1
duty_cycle=0x6000,pwm status=0x1
duty_cycle=0x8000,pwm status=0x1
can anybody who help test and answer this question, thank you very much!
Hi Alice,
There is something wrong with the console lib, but we don't have the capacity to debug this SW.
Why don't you use the LPUART SDK driver directly?
The printf() uses LPUART_1 anyway.
Regards,
Daniel
do you have examples about printf ?
if use directly LPUART SDK driver, there some transfer when need print different variable
@danielmartynek i try it with this
void uart_printf(const char *ptr)
{
uint32_t bytesRemain;
size_t bytes=strlen(ptr);
// unsigned char ret_car[]={"\r"};
LPUART_DRV_SendData(INST_LPUART_1, (uint8_t *)ptr, bytes);
while(LPUART_DRV_GetTransmitStatus(INST_LPUART_1, &bytesRemain) != STATUS_SUCCESS);
// LPUART_DRV_SendData(INST_LPUART1, ret_car, 1);
// while(LPUART_DRV_GetTransmitStatus(INST_LPUART1, &bytesRemain) != STATUS_SUCCESS);
}
@danielmartynek any feedback , thanks!
Hi @alice_th,
Sorry for the delay, I could not get to the testing because of the overload.
Can you declare ftm_state_t ftmStateStruct as a global variable?
after set ftm_state_t ftmStateStruct as a global variable, now it works even with printf(the console lib) it still can work, why need set as a global variable ?
Hi @alice_th,
I'm glad it works now.
Because you are calling the APIs of the driver from different functions that must access the struct.
hello @danielmartynek
when i set with dead time, ch1 don't have waveform output, could you help to check it
look at ch1 with green line, no pwm output
Hello @alice_th,
This is not related to the topic of this thread.
Please create a new one.
Thank you