STM32H733 TIM ETR reduces input clock level
Heyho,
and one more problem with my custom board with a STM32H733ZGT6 (LQFP-144, almost same as H723 on Nucleo).
I'm using TIM5 for input capture, with CH1 (GPIO A0) and ETR (A4) as external clock input.
The setup code is the same as on H723-Nucleo and H735-Disco, although I'm using another input capture channel, on these boards all is working fine.
Problem:
the 50 MHz input clock on ETR drops to < 2Vpp at the STM32 pin.
Clock signal comes from VCO with 3.3Vpp, has 33R at output, and the ETR pin also has a 33R serial resistor.
Voltage drops at each resistor.
The same clock signal is routed to other IOs, also via 33R, no voltage drop there.
All connections and resistor values checked and okay.
Here's the timer setup, same as on working ST boards:
void TimVcoSyncInit(void)
{
GPIO_InitTypeDef GPIO_InitStruct = { 0 };
/* set handle and pointer
* ### THIS depends on used TIMx ###
* eTAS8: TIM5
*/
__HAL_RCC_TIM5_CLK_ENABLE();
pTimVcoSync = TIM5;
hTim5.Instance = pTimVcoSync;
hTimVcoSync.Instance = pTimVcoSync;
/* register reset */
pTimVcoSync->CR1 = 0;
pTimVcoSync->CR2 = 0;
pTimVcoSync->SMCR = 0;
pTimVcoSync->CNT = 0;
pTimVcoSync->DIER = 0; /* no interrupts, DMA set later */
pTimVcoSync->SR = 0;
pTimVcoSync->PSC = 0; /* max = 1/2 CPU clock */
pTimVcoSync->ARR = 0xFFFFFFFF; /* auto-reload */
pTimVcoSync->EGR = 0;
pTimVcoSync->CCMR1 = 0;
pTimVcoSync->CCMR2 = 0;
pTimVcoSync->CCMR3 = 0;
pTimVcoSync->CCR1 = 0;
pTimVcoSync->CCR2 = 0;
pTimVcoSync->CCR3 = 0;
pTimVcoSync->CCR4 = 0;
pTimVcoSync->DCR = 0;
pTimVcoSync->DMAR = 0;
/* ECE external clock mode 2, divide by 2 if clock > 25.6 MHz
* external clock prescaler ETPS[1:0] depends on CPU clock / I2S clock:
* "External trigger signal ETRP frequency must be
* at most 1/4 of CK_INT frequency."
*/
pTimVcoSync->SMCR = TIM_SMCR_ECE;
/* sync clock frequency is 51.2 MHz -> divider ON */
pTimVcoSync->SMCR |= TIM_SMCR_ETPS_0;
/* input capture TIM5 channel 1
*/
pTimVcoSync->CCMR1 = TIM_CCMR1_CC1S_0; /* channel 1 input capture */
pTimVcoSync->CCER = TIM_CCER_CC1E; /* channel 1 capture enable */
/* Configure GPIO pins : Timer 5
* PA4 ----> ETR -> external clock -> VCO / audio clock
* PA0 ----> Ch1 -> input capture -> PTP PPS
*/
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Pin = TIM5_ETR_Pin;
GPIO_InitStruct.Alternate = GPIO_AF2_TIM5;
HAL_GPIO_Init(TIM5_ETR_GPIO_Port, &GPIO_InitStruct);
GPIO_InitStruct.Pin = TIM5_CH1_Pin;
GPIO_InitStruct.Alternate = GPIO_AF2_TIM5;
HAL_GPIO_Init(TIM5_CH1_GPIO_Port, &GPIO_InitStruct);
// timer & DMA enabled later with:
/* timer DMA request enable, counter reset */
pTimVcoSync->DIER = TIM_DIER_CC1DE;
pTimVcoSync->CNT = 0;
/* TimVcoSync enable */
pTimVcoSync->CR1 = TIM_CR1_ARPE | TIM_CR1_CEN;
