TLC5510 + STM32F103C8T6

External hardware connected to the STM32 board
Post Reply
Posts: 7
Joined: Sun May 20, 2018 3:48 pm

TLC5510 + STM32F103C8T6

Post by rtek » Tue Feb 12, 2019 1:01 pm


I would like to try the ADC (20Msps) TLC5510 in conjunction with the STM32F103C8T6

The IC TLC5510 needs an external clock up to 20MHz, so I think the STM32F103C8T6 can generate a signal on the A8 pin.

I found some references, but I would like to know which constant I need to use (for Arduino IDE) to get the output clock (Maybe 19MHz?), without affecting the normal operation of the rest of the system.

Thank you.

STM32F103 Clock Out on Pin PA8

STM32 Internals (Clock Options)

Posts: 3053
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: TLC5510 + STM32F103C8T6

Post by stevestrong » Tue Feb 12, 2019 1:33 pm

The F103 chip can output the micro controller clock (MCO).
Options in RCC_CFGR:
MCO: Microcontroller clock output

0xx: No clock
100: System clock (SYSCLK)
101: HSI clock
110: HSE clock
111: PLL clock divided by 2

But this does not allow you to change to any frequency.
If SYSCLK == PLL clock = 72 MHz, and HSE=8MHz, and HSI=16MHz, you cannot have 19MHz.

Instead, I would suggest you to use TIM1_CH1 PWM output (also on PA8), which is then configurable.

Posts: 1321
Joined: Thu Jul 21, 2016 4:24 pm

Re: TLC5510 + STM32F103C8T6

Post by ag123 » Thu Feb 14, 2019 8:28 pm

actually i think there is actually a way, but for that you may need to run the cpu at 48 mhz but on HSE
that would mean messing with the PLL multiplier so as to get 48 mhz on the PLL clock
then PLL / 2 gives 24 mhz, i.e. overclock your ADC :lol:
(and you'd need to tweak the usb multiplier so that it uses the 48 mhz straight rather than taking 72 mhz / 1.5

the other way is to set the PLL multiplier to run at 40 mhz, then PLL / 2 give 20 mhz, but u'd lose USB for doing that

the other unknown thing would be that if the cpu runs at 48 mhz, would it still be able to catch up with 20 msps data rates?
it may have trouble with that. using a timer is probably a better approach and you could leave the cpu running at 72 mhz

another thing though TLC5510 is a 5v ADC i think, would that cause any problem interfacing with stm32?

Posts: 312
Joined: Sun Jul 16, 2017 9:57 pm

Re: TLC5510 + STM32F103C8T6

Post by ted » Sat Feb 23, 2019 4:23 am


Code: Select all

HardwareTimer pwmtimer1(1);
void setup()
 pinMode(PA8, PWM);// T1CH1
// pinMode(PA10, PWM); //T1CH3
  pwmtimer1.setPrescaleFactor(1);       // Timer input clock Prescaler = 1 (= 72MHz input)
  pwmtimer1.setOverflow(4);            // PWM  for18 MHz, 
  pwmtimer1.setCompare(TIMER_CH1, 2);  // PWM High Pulse width is 50% duty (1:1)
  void loop() 

Post Reply