Hello,
I found other libs for this and started to use it, but can't still run PWM on the pin PTC1 (in the doc it uses TPM module 0 Channel 0). I use the next code:
tpm_general_config_t tpmCfg =
{
.isDBGMode = true,//0,
.isGlobalTimeBase = 0,
.isTriggerMode = 0,
.isStopCountOnOveflow = 0,
.isCountReloadOnTrig = true,//0,
.triggerSource = kTpmTrigSel8//kTpmTrigSel0,
};
tpm_pwm_param_t param =
{
.mode = kTpmEdgeAlignedPWM,
.edgeMode = kTpmHighTrue,
.uFrequencyHZ = 100000U,
.uDutyCyclePercent = 50U,
};
tpm_status_t status;
PORT_HAL_SetMuxMode(PORTC,1u,kPortMuxAlt2);
TPM_DRV_SetClock(TPM0_IDX, kTpmClockSourceExternalClk, kTpmDividedBy2 );
status = TPM_DRV_Init(TPM0_IDX, &tpmCfg);
status = TPM_DRV_PwmStart(TPM0_IDX, ¶m, 0);
...
What is wrong? I don't see any output on PTC1, all time 0 Volts.