I had a need for additional functionality with TM1637 library (read key/buttons, 2 values on 1 display, remap digits etc... ) so I made a new include based on existing.
During testing some problems, I noticed an anomaly on the DIO where TM & Micro were fighting for about half CLK . It occurs at the start of ACK & only when the last data bit is a 1 (as is with C0 address command). This does not stop communication but better to fix it. I am testing with 12F683 device.
TM asserts the pin(ACK) when the 8th clock is set low so DIO need to be released by micro asap.
If someone can test this on some other micro would be good.
It is an easy fix, just move the 'dir TM1637_DIO in' before the delay from 'set TM1637_CLK off'
In 'TM1637 Ack issue.png' the issue is shown between cursors.
From:
'wait for ACKsetTM1637_CLKoffwait50usdirTM1637_DIOinsetTM1637_CLKonwait50usifTM1637_DIO=0thendirTM1637_DIOoutendifsetTM1637_CLKoffTo:
'wait for ACKsetTM1637_CLKoffdirTM1637_DIOinwait50ussetTM1637_CLKonwait50usifTM1637_DIO=0thendirTM1637_DIOoutendifsetTM1637_CLKoff
Ack code from my driver... I also add the end delay to better define the Stop sequence.
SubTM1637_Ack'Ack sequence for TM1637 (just another bit clk)' Ack_ok = 0SetTM1637_CLK0'< TM assert DIO hereDirTM1637_DIOinWaitTM_DlyusSetTM1637_CLK1WaitTM_Dlyus' If TM1637_DIO = 0 then Ack_ok = 1DirTM1637_DIOoutSetTM1637_CLK0'< TM release DIO hereWaitTM_DlyusEndSub
I had a need for additional functionality with TM1637 library (read key/buttons, 2 values on 1 display, remap digits etc... ) so I made a new include based on existing.
During testing some problems, I noticed an anomaly on the DIO where TM & Micro were fighting for about half CLK . It occurs at the start of ACK & only when the last data bit is a 1 (as is with C0 address command). This does not stop communication but better to fix it. I am testing with 12F683 device.
TM asserts the pin(ACK) when the 8th clock is set low so DIO need to be released by micro asap.
If someone can test this on some other micro would be good.
It is an easy fix, just move the 'dir TM1637_DIO in' before the delay from 'set TM1637_CLK off'
In 'TM1637 Ack issue.png' the issue is shown between cursors.
Ack code from my driver... I also add the end delay to better define the Stop sequence.
Last edit: ToniG 2022-05-22