Seed: Two-wire serial connection to TM1637

Hey there, I’m a total n00b with programming effects, and this platform is proving very impressive and capable. I am wanting to use a 4 digit 7-segment display that’s being driven by the TM1637, and I’m having some trouble connecting it via serial. It’s a two-wire connection, clocked high, and I’m unsure if I’ve got it set up correctly and would appreciate any help.

The unit is powering on, and I’ve got the TM1637’s CLK pin connected to physical pin 9 and the DIO pin connected to physical pin 11. Here’s my setup code:

    // Set up for the SPI
    spi_conf.periph = SpiHandle::Config::Peripheral::SPI_1;
    spi_conf.mode = SpiHandle::Config::Mode::MASTER;
    spi_conf.direction = SpiHandle::Config::Direction::ONE_LINE;
    spi_conf.nss = SpiHandle::Config::NSS::SOFT;
    spi_conf.clock_polarity = SpiHandle::Config::ClockPolarity::HIGH;
    spi_conf.clock_phase = SpiHandle::Config::ClockPhase::TWO_EDGE;
    spi_conf.pin_config.sclk = seed::D8;
    spi_conf.pin_config.miso = Pin();  // We are not using this
    spi_conf.pin_config.mosi = seed::D10;
    spi_conf.pin_config.nss = Pin(); // We are not using this
    
    // Initialize the handle using our configuration
    spi_handle.Init(spi_conf);

    ...
    
    uint8_t buffer[4] = {0, 1, 2, 3};
    spi_handle.BlockingTransmit(buffer, 4);

There’s nothing being displayed on the unit, feels like SOMEthing should be working. Don’t know if it’s my software or the hardware, or something else I should check.

Daisy rox.

Would appreciate any help and welcome critique!

TM1637 is not an SPI device.

Well I guess that would explain why it doesn’t work! I wondered why there were at least a few custom arduino libraries for it. So the question is then, do I try to adapt one of those libraries, or do I abandon and go with and actual SPI device? I’m leaning toward the latter.

Has anyone worked with an actual SPI driver for multi-digit LEDs? Any recommendations? Should I just use an actual dot matrix display of some kind? Just trying to keep the cost down while keeping things simple.

Thanks for the reply! Always learning!

It’s a simple device, writing or adapting a bitbanger for it should be a simple,fun,informative exercise.