rogerdahl / stm32-tm1637

Simple library for writing to TM1637 4-digit 7-segment displays from STM32 MCUs
MIT License
39 stars 15 forks source link

PIN mode Open Drain might not work, but PushPull will #1

Closed r-ryabyy closed 6 years ago

r-ryabyy commented 6 years ago

I think this is only for FYI For some reason for my 4 digit led display it working only in Push Pull mode, instead of Open Drain

rogerdahl commented 6 years ago

I think you've found a bug, and that the clock should be push-pull.

The data pin is both input and output, as the display sends back ACK's for the commands, so needs to be open-drain. Setting it to push-pull will cause conflicts that could end up damaging the display and/or MCU.

If you can't get things to work with data set to open-drain, you may need an external pull-up resistor.

r-ryabyy commented 6 years ago

I get it working with GPIO_SPEED_FREQ_LOW speed for both pins in OD mode, with external pull up 1k (10k is not enough) resistor to data pin. BTW, there is no difference now in with or without internal pullup for both pins (actually for data pin it's clear - external pullup resistor connected) Thank you for commenting, might be helpful for other folks PS: the board is STM32F446RE