2021-08-06 02:08 AM
I've a camera using lvds protocol, now using LVDS to LVTTL converter connect to stm32f730r8t6.
I want to decode lvds data and fifo it to USB.
But first problem is could stm32 decode 20Mhz lvttl clock?
I've tried to use tim input captuer clock and using signal generator test it, stm32 only can follow 100kHZ.
Should I use 800mhz mcu to do it? Or only FPGA can do this job.
TIM config.
100khz result. (yellow is from stm32, blue is from signal generator)100mhz result. (yellow is from stm32, blue is from signal generator)
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) {
if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1) {
GPIOC->ODR = 16384;
} else {
GPIOC->ODR = 0;
}
}
int main(void) {
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_TIM1_Init();
HAL_TIM_IC_Start_IT(&htim1, TIM_CHANNEL_1);
HAL_TIM_IC_Start_IT(&htim1, TIM_CHANNEL_2);
while (1) {
}
}
2021-08-06 02:42 AM
Your 100kHz result isnt right. Too your callback capture IF isnt ideal.
And for capture serial dat ais better SPI...
2021-08-06 03:04 AM
The freq. limiting factor in your code is the software, not the timer, especially when using HAL IRQ and the GPIOC access.
Anyway, I doubt that LVDS (camera link?) processing can be done in MCU software for any reasonable camera frame sizes and frame rates.
I would recommend looking into a LVDS deserializer chips interfacing to an STM32 MCU with a DCMI interface, or an FPGA solution.
2021-08-10 06:49 AM
thanks your reply, I'm looking for another solution.
2021-08-10 10:08 AM
How many bits involved?
Single bit with a clock, perhaps be an SPI slave.