ArduinoAlphanumeric

Annotated README.txt

1:3743948571b3
2016-01-10 Paul Boddie Added shape definitions and data sampling support, producing hexadecimal representations of input signal lines.
paul@0 1
From the HT16K33 datasheet [1] and EF4058 schematic [2].
paul@0 2
paul@0 3
Addressing
paul@1 4
==========
paul@0 5
paul@0 6
                            RAM addresses
paul@0 7
                            ROW0..7     ROW8..15
paul@0 8
COM0 -> digit 1, tube 1     00          01
paul@0 9
COM1 -> digit 2, tube 1     02          03
paul@0 10
COM2 -> digit 1, tube 2     04          05
paul@0 11
COM3 -> digit 2, tube 2     06          07
paul@0 12
paul@0 13
ROW0/A2  |-> connected to both tubes
paul@0 14
ROW1/A1  |
paul@0 15
ROW2/A0  |
paul@0 16
ROW3..14 |
paul@0 17
paul@0 18
Tube and Digit Layout
paul@1 19
=====================
paul@0 20
paul@0 21
By observing the behaviour, the tubes and digits have the following layout:
paul@0 22
paul@0 23
tubes
paul@0 24
2       1
paul@0 25
digits
paul@0 26
1   2   1   2
paul@0 27
paul@0 28
Communications
paul@1 29
==============
paul@0 30
paul@0 31
I2C commands:
paul@0 32
paul@0 33
       D15 D14 D13 D12 D11 D10  D9  D8
paul@0 34
setup    0   0   1   0   X   X   X   S  S=0 => standby; S=1 => operational
paul@0 35
ROW/INT  1   0   1   0   X   X   A   I  I=0 => ROW driver output;
paul@0 36
                                        I=1 => INT output
paul@0 37
                                               A=0 => active low
paul@0 38
                                               A=1 => active high
paul@0 39
display  1   0   0   0   X  B1  B0   D  D=0 => display off; D=1 => display on
paul@0 40
                                        B1..B0 = 0 => blinking off
paul@0 41
                                        B1..B0 = 2 - log2 (blinking frequency)
paul@0 42
                                                 (1 => 2Hz; 2 => 1Hz; 3 => 0.5Hz)
paul@0 43
address  0   0   0   0  A3  A2  A1  A0  A3..A0 => set row address pointer
paul@0 44
dimming  1   1   1   0  P3  P2  P1  P0  P3..P0 = 16 * pulse_width - 1
paul@0 45
                                                 (0 => 1/16; 15 => 1)
paul@0 46
paul@0 47
I2C data format:
paul@0 48
paul@0 49
        D7  D6  D5  D4  D3  D2  D1  D0
paul@0 50
ROW      7   6   5   4   3   2   1   0
paul@0 51
ROW     15  14  13  12  11  10   9   8
paul@0 52
paul@0 53
When converting values to the I2C format, the most significant byte is sent
paul@0 54
after the least significant byte. For example, the following hexadecimal
paul@0 55
representation is converted as follows:
paul@0 56
paul@0 57
   8000400020001000
paul@0 58
-> 80 00 40 00 20 00 10 00 (bytes in MSB, LSB order)
paul@0 59
-> 00 80 00 40 00 20 00 10 (bytes in LSB, MSB order)
paul@0 60
paul@0 61
LED Digit Layout
paul@1 62
================
paul@0 63
paul@0 64
The digits each have the following layout:
paul@0 65
paul@0 66
LED     ROWx    data value  remark
paul@0 67
paul@0 68
---     ROW0    1           upper horizontal
paul@0 69
paul@0 70
paul@0 71
paul@0 72
  |     ROW1    2           upper-right vertical
paul@0 73
paul@0 74
paul@0 75
paul@0 76
        ROW2    4           lower-right vertical
paul@0 77
paul@0 78
  |
paul@0 79
paul@0 80
        ROW3    8           lower horizontal
paul@0 81
paul@0 82
---
paul@0 83
paul@0 84
        ROW4    10          lower-left vertical
paul@0 85
paul@0 86
|
paul@0 87
paul@0 88
|       ROW5    20          upper-left vertical
paul@0 89
paul@0 90
paul@0 91
paul@0 92
        ROW6    40          left-middle horizontal
paul@0 93
-
paul@0 94
paul@0 95
paul@0 96
        ROW7    80          right-middle horizontal
paul@0 97
  -
paul@0 98
paul@0 99
paul@0 100
\       ROW8    100         top-left diagonal
paul@0 101
paul@0 102
paul@0 103
paul@0 104
 |      ROW9    200         upper-middle vertical
paul@0 105
paul@0 106
paul@0 107
paul@0 108
  /     ROW10   400         top-right diagonal
paul@0 109
paul@0 110
paul@0 111
paul@0 112
        ROW11   800         lower-right diagonal
paul@0 113
paul@0 114
  \
paul@0 115
paul@0 116
        ROW12   1000        lower-middle vertical
paul@0 117
paul@0 118
 |
paul@0 119
paul@0 120
        ROW13   2000        lower-left diagonal
paul@0 121
paul@0 122
/
paul@0 123
paul@0 124
        ROW14   4000        decimal point
paul@0 125
paul@0 126
   .
paul@0 127
paul@0 128
        ROW15   8000        (not connected)
paul@0 129
paul@0 130
paul@0 131
paul@1 132
See the shapes.h file for convenient definitions of the different elements.
paul@1 133
paul@1 134
Interfacing
paul@1 135
===========
paul@1 136
paul@1 137
It could be useful to interface the display with circuits and to have an
paul@1 138
Arduino sample inputs and update the display to reflect the state of those
paul@1 139
inputs. In order to represent 16 different signals with 4 hexadecimal digits,
paul@1 140
the following circuit could be employed.
paul@1 141
paul@1 142
Inputs  74HC157 74HC157 Arduino Display
paul@1 143
------  ------- ------- ------- -------
paul@1 144
                        A4/SDA  SDA
paul@1 145
                        A5/SCL  SCL
paul@1 146
                        5V      VCC
paul@1 147
        E#      E#      GND     GND
paul@1 148
        S       S       3
paul@1 149
D0      1I0
paul@1 150
D1      2I0
paul@1 151
D2      3I0
paul@1 152
D3      4I0
paul@1 153
D4              1I0
paul@1 154
D5              2I0
paul@1 155
D6              3I0
paul@1 156
D7              4I0
paul@1 157
D8      1I1
paul@1 158
D9      2I1
paul@1 159
D10     3I1
paul@1 160
D11     4I1
paul@1 161
D12             1I1
paul@1 162
D13             2I1
paul@1 163
D14             3I1
paul@1 164
D15             4I1
paul@1 165
        1Y              4
paul@1 166
        2Y              5
paul@1 167
        3Y              6
paul@1 168
        4Y              7
paul@1 169
                1Y      8
paul@1 170
                2Y      9
paul@1 171
                3Y      10
paul@1 172
                4Y      11
paul@1 173
paul@1 174
By switching between the two multiplexers, the data signals could be sampled
paul@1 175
by the Arduino and appropriate representation values written to the display
paul@1 176
module memory.
paul@1 177
paul@0 178
References
paul@1 179
==========
paul@0 180
paul@0 181
[1] EF4058-OCTOPUS_Alphanumeric_V1.0_SCH.pdf
paul@0 182
[2] EF4058-ht16K33v110.pdf