Coder Social home page Coder Social logo

Can I act _as_ a TM1651? about tm16xx HOT 4 CLOSED

maxint-rd avatar maxint-rd commented on May 25, 2024
Can I act _as_ a TM1651?

from tm16xx.

Comments (4)

maxint-rd avatar maxint-rd commented on May 25, 2024

Hello Mike, interesting concept! I believe it should be possible to program the esp32 to emulate a TM1651, but unfortunately the TM16xx library is not implemented to do that. All it does is sending commands and data according the chip specific protocol and where possible it also reads button state.

You intend to do the reverse: receive commands and data and send the state of virtual buttons upon request. After receiving a command you want to interpret the data and act accordingly. To implement such feature you first need to make a state machine that detects activity on the DIO and CLK lines to receive the commands and data. Based on the received command it would change state to perform the requested action.

One of my ongoing side projects is to make an ATtiny13A as I2C slave to form an adressable bridge to other chips such as TM16xx chips. Due to limited features I resorted to bitbanging the I2C protocol, without interrupts. One of the challenges is to keep up with received data while performing appropriate actions.

Since the ESP32 is much more powerful (higher speed, more cores, more RAM, etc.) you might be succesful in using existing interfaces such as SPI or using interrupts. Perhaps you can use my library to to research the protocol and to send controlled data to test the ESP receiving that data. I strongly recommend you to also use a logical analyser to further examine the communication.

Hopefully these thoughts were helpful. Although I find your project interesting, unfortunately I don't have the means to provide support. Wish you all the best!

from tm16xx.

LordMike avatar LordMike commented on May 25, 2024

If I had to start somewhere, is there a protocol or a keyword I can search for to find if someone else has made a similar project?

I'm completely oblivious to the ins and outs of the binary protocols. Is SPI similar to TM16xx? Is I2C (I'm thinking not because it's adressable, right?) ?

Will the TM16xx send data unprompted, or will it only respond to commands? I'm also kinda baffled that (seemingly) noone has made a project like this before.. It must've happened that someone was on the same side as me of some device that communicated using this :P

from tm16xx.

maxint-rd avatar maxint-rd commented on May 25, 2024

Hello Mike, I'm not aware of anyone having done such a project yet. Most projects I've encountered involved using premade or homemade modules, using bare chips or reusing the display part of a used device. If you search for TM1651, you'll most likely find those kinds of projects, if any. Perhaps adding "simulate" or "emulate" as keywords will yield different results, but I don't expect many people having done such project.

In your case I would first complete the tracing, to confirm that the button is indeed connected to the K1 line of the TM1651 and to find out the connections of the buzzer. The button might also be connected directly to the MCU of your heater-panel, in which case simulating the TM1651 is limited to reading the displayed value. Unless you control the panel MCU, your ESP can only follow it's actions. Simulating button presses could be one way of controlling it, but it requires fine orchestration.

Perhaps you want to post pictures of your panel PCB here? You may find this TM1680 issue regarding display modules interesting reading too.

With regards to the TM1651 protocol: For full protocol information you need to read the datasheet. Titan Micro uses different protocols for specific chips. The protocol mostly depends on the number of interface wires. The two wire interfaces for the chips that support buttons have CLK and DIO lines. The TM1651 seems similar to TM1650 which is supported by my library. The protocol lacks addressing, so it looks more like SPI than I2C, but it does use a single line for data (like I2C). When using my logical analyser I set it to SPI and tweak the settings.

As far as I know, the TM16xx chips don't send unprompted data; they only respond to commands. The first byte is the command, which is followed by one or more data bytes. The chips I know don't have interrupt pins, so button state needs to be polled. In your case it's the panel MCU that sends unprompted data and when trying to take over the control that may give you both challenges and opportunities. Good luck with that...

from tm16xx.

maxint-rd avatar maxint-rd commented on May 25, 2024

It's a few months later and now someone did exactly that! In issue #45 you can find a good example of a TM1628 based dehumidifier made smart using an ESP32 emulating the TM1628 to read displayed values and to trigger the button switches remotely. It's a very nicely executed project which even includes a component to integrate with ESPhome.

from tm16xx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.