Solutions to exercise 13: Seven Segment display and Keypad

Exercise 1:

Writing a bit banging driver is a non-trivial task. Not only must you correctly set the signal levels but you also must get the timing of the signals right. All this must be done by programming GPIO pins. But how can you make sure the signals have the shape they should have as described in the chip's data sheet? The best way of course is to observe the signals on an oscilloscope. If you don't have a scope at hand then you can try to log the signals and their timing To files.

This is the strategy I opted for: Each time I set a signal to either the dio or the clk pin I write this event into a log file. as long as I wait, I copy the current signals levels onto the log file.

Before starting to write the actual driver I only try to transfer a byte, making sure the chip answers with the expected acknowledge signal, and plot the log file for control.

tm1637_timing.png

You can clearly the see sequence:

  • first the start sequence: dio going from high to low while clk is high
  • then the 8 data bits (here I send the value 0x55)
  • reading the acknowledge signal on the nineth clock cycle
  • and finally the stop sequence: dio going from low to high while clk is high
Please compare this plot with the timing diagrams from the TM1637 data sheet.

-- Uli Raich - 2021-01-22

Comments

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng tm1637_timing.png r1 manage 34.6 K 2021-01-22 - 13:49 UliRaich  
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2021-01-22 - UliRaich
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback