tpm_config_t tpmInfo;CLOCK_SetTpmClock(1U);TPM_GetDefaultConfig(&tpmInfo);tpmInfo.prescale = kTPM_Prescale_Divide_128;
/* Initialize TPM module */
TPM_Init(TPM1, &tpmInfo);
//SR: set up quadrature decoder for encoder
const tpm_phase_params_t phaseParams = {
.phaseFilterVal = 15,
.phasePolarity = kTPM_QuadPhaseNormal,
};TPM_SetupInputCapture(TPM1, kTPM_Chnl_0, kTPM_RiseAndFallEdge);
TPM_SetupInputCapture(TPM1, kTPM_Chnl_1, kTPM_RiseAndFallEdge);
TPM_SetupQuadDecode(TPM1, &phaseParams, &phaseParams, ENCODER_TPM_QUADMODE);
PORT_SetPinMux(ENC_1_PORT, ENC_1_PIN, ENC_1_A);
PORT_SetPinMux(ENC_2_PORT, ENC_2_PIN, ENC_2_A);
TPM1->MOD = 0xFFFF;
TPM_StartTimer(TPM1, kTPM_SystemClock);
I make de deinit for this row:
TPM_StopTimer(TPM1);
TPM_Deinit(TPM1);
for ble i set only the clock:
CLOCK_SetTpmClock(2);
thank you
Marco
Hello, i SOLVED!
after the TPM_StopTimer(TPM1); i need to clear the TPM1->QDCTRL register. Successively i need to use TPM_Deinit(TPM1);
thakns anyway
Marco
i've forget to say that when i do the riconfiguration of TPM for BLE, i use teh TPM_GetDefaultConfig(); and TPM_Init() for reconfigure the TPM with default settings.
Now i'm trying to remove a single instructions and i discovered that TPM_SetupQuadDecode() create annoy.
Hi Marco,
The KW41 provides 2 Channels of TPMs.
In this code, i've a status machine and i need to create a new status for ble using,
Where did you create this new status?
Is the Bluetooth LE stack working in your application?
I am confused when you mention remoe the TPM1 configuration and you do not need an encoder.
Regards,
Mario