Tags:
view all tags
---+ 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. <img alt="tm1637_timing.png" src="%ATTACHURL%/tm1637_timing.png" title="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 [[https://www.mcielectronics.cl/website_MCI/static/documents/Datasheet_TM1637.pdf][TM1637 data ]]sheet. -- %USERSIG{UliRaich - 2021-01-22}% ---++ Comments %COMMENT%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
png
tm1637_timing.png
r1
manage
34.6 K
2021-01-22 - 13:49
UliRaich
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2021-01-22
-
UliRaich
Home
Site map
AFNOG web
Embedded_Systems web
IoT_Course_English web
IoT_Course_French web
Main web
Sandbox web
TWiki web
IoT_Course_English Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
Edit
Attach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback