User Tools

Site Tools


din_dout_pintable

This is an old revision of the document!


MIOS DIN/DOUT Pin Numbers

Sometimes the pin numbers of special DINs or DOUTs can be specified in the main.asm or setup_*.asm file of a MIOS application.

Examples:

#define DEFAULT_MIDI_RX_LED 0x40        ; DOUT SR#9, pin D0
#define DEFAULT_MIDI_TX_LED 0x41        ; DOUT SR#9, pin D1

or

#define DEFAULT_DIN_MENU_EXEC         7       ; menu exec button assigned to DIN pin #7
#define DEFAULT_DIN_MENU_SNAPSHOT     6       ; menu snapshot button assigned to DIN pin #4
#define DEFAULT_DIN_MENU_RIGHT        5       ; NOT USED - overlayed by datawheel
#define DEFAULT_DIN_MENU_LEFT         4       ; NOT USED - overlayed by datawheel

or

       ;;        SR  Pin  Mode
        ENC_ENTRY  5,  0,  MIOS_ENC_MODE_NON_DETENTED   ; V-Pot 1
        ENC_ENTRY  5,  2,  MIOS_ENC_MODE_NON_DETENTED   ; V-Pot 2
        ENC_ENTRY  5,  4,  MIOS_ENC_MODE_NON_DETENTED   ; V-Pot 3
        ENC_ENTRY  5,  6,  MIOS_ENC_MODE_NON_DETENTED   ; V-Pot 4

The following table should give you a quick overview over the numbers. Please bear in mind that we are sometimes counting from 0, and sometimes from 1.

Means: sometimes the first pin or shiftregister has number 0, sometimes it has number 1 - thats always an issue, because programmer mostly prefer to count from 0, users want to count from 1 - it's a bit of a mess! Forgive me! ;-)

In the meantime I've tried to make the setup more consistent. Shiftregisters are always counted from 1, and pins are always counted from 0


Important Note: for DIN shift registers, hardware pins will be reflected on software- level in reversed order for each shift register:

D7 (hardware level) of the first shift register will be pin-number 0 (software level), not 7!
D0 (hardware level) of the second shift register will be pin-number 15 (sorware level), not 8!
The first shift register is for both DIN and DOUT the one that is closest to the core on hardware level.

In the datasheets of the shift-register IC's, D0 is often labled A / QA, D7 is labled H / QH.

Note that this applies only for DIN's, NOT for DOUT's. For DOUT's D0 / A (hardware) will be the lowest pin number in software.

DIN chain hardware-level: CORE → R1::qH → R1::H → R1 → R1::G ….. R2::qH → R2::H etc.
DOUT chain hardware-level: CORE → R1::SER → R1::A → R1::B → R1::C ….. R2::SER → R2::A etc.

If you want to read more about this, refer this forum discussion:
http://www.midibox.org/forum/index.php/topic,12379.0.html

See also the following table to get a clearer picture. The shift registers have the same order on hardware than on software level.

MIOS_DOUT_SRSet / MIOS_DOUT_SRGet / MIOS_DIN_SRSet / MIOS_DIN_SRGet: LSB always reflects the lowest pin number, MSB the highest pin number.




Ok, here the table:

Shift Register SR number Pin Number (sw) Pin Hex number (sw) Pin Name (DIN PCB / SR IC) Pin Name (DOUT PCB / SR IC)
first 1 0 0x00 D7 / H D0 / QA
first 1 1 0x00 D6 / G D1 / QB
first 1 2 0x00 D5 / F D2 / QC
first 1 3 0x00 D4 / E D3 / QD
first 1 4 0x00 D3 / D D4 / QE
first 1 5 0x00 D2 / C D5 / QF
first 1 6 0x00 D1 / B D6 / QG
first 1 7 0x00 D0 / A D7 / QH
second 2 8 0x08 D7 / H D0 / QA
second 2 9 0x09 D6 / G D1 / QB
second 2 10 0x0a D5 / F D2 / QC
second 2 11 0x0b D4 / E D3 / QD
second 2 12 0x0c D3 / D D4 / QE
second 2 13 0x0d D2 / C D5 / QF
second 2 14 0x0e D1 / B D6 / QG
second 2 15 0x0f D0 / A D7 / QH
third 3 16 0x10 D7 / H D0 / QA
third 3 17 0x11 D6 / G D1 / QB
third 3 18 0x12 D5 / F D2 / QC
third 3 19 0x13 D4 / E D3 / QD
third 3 20 0x14 D3 / D D4 / QE
third 3 21 0x15 D2 / C D5 / QF
third 3 22 0x16 D1 / B D6 / QG
third 3 23 0x17 D0 / A D7 / QH
fourth 4 24 0x18 D7 / H D0 / QA
fourth 4 25 0x19 D6 / G D1 / QB
fourth 4 26 0x1a D5 / F D2 / QC
fourth 4 27 0x1b D4 / E D3 / QD
fourth 4 28 0x1c D3 / D D4 / QE
fourth 4 29 0x1d D2 / C D5 / QF
fourth 4 30 0x1e D1 / B D6 / QG
fourth 4 31 0x1f D0 / A D7 / QH
fifth 5 32 0x20 D7 / H D0 / QA
fifth 5 33 0x21 D6 / G D1 / QB
fifth 5 34 0x22 D5 / F D2 / QC
fifth 5 35 0x23 D4 / E D3 / QD
fifth 5 36 0x24 D3 / D D4 / QE
fifth 5 37 0x25 D2 / C D5 / QF
fifth 5 38 0x26 D1 / B D6 / QG
fifth 5 39 0x27 D0 / A D7 / QH
sixth 6 40 0x28 D7 / H D0 / QA
sixth 6 41 0x29 D6 / G D1 / QB
sixth 6 42 0x2a D5 / F D2 / QC
sixth 6 43 0x2b D4 / E D3 / QD
sixth 6 44 0x2c D3 / D D4 / QE
sixth 6 45 0x2d D2 / C D5 / QF
sixth 6 46 0x2e D1 / B D6 / QG
sixth 6 47 0x2f D0 / A D7 / QH
seventh 7 48 0x30 D7 / H D0 / QA
seventh 7 49 0x31 D6 / G D1 / QB
seventh 7 50 0x32 D5 / F D2 / QC
seventh 7 51 0x33 D4 / E D3 / QD
seventh 7 52 0x34 D3 / D D4 / QE
seventh 7 53 0x35 D2 / C D5 / QF
seventh 7 54 0x36 D1 / B D6 / QG
seventh 7 55 0x37 D0 / A D7 / QH
eighth 8 56 0x38 D7 / H D0 / QA
eighth 8 57 0x39 D6 / G D1 / QB
eighth 8 58 0x3a D5 / F D2 / QC
eighth 8 59 0x3b D4 / E D3 / QD
eighth 8 60 0x3c D3 / D D4 / QE
eighth 8 61 0x3d D2 / C D5 / QF
eighth 8 62 0x3e D1 / B D6 / QG
eighth 8 63 0x3f D0 / A D7 / QH
ninth 9 64 0x40 D7 / H D0 / QA
ninth 9 65 0x41 D6 / G D1 / QB
ninth 9 66 0x42 D5 / F D2 / QC
ninth 9 67 0x43 D4 / E D3 / QD
ninth 9 68 0x44 D3 / D D4 / QE
ninth 9 69 0x45 D2 / C D5 / QF
ninth 9 70 0x46 D1 / B D6 / QG
ninth 9 71 0x47 D0 / A D7 / QH
tenth 10 72 0x48 D7 / H D0 / QA
tenth 10 73 0x49 D6 / G D1 / QB
tenth 10 74 0x4a D5 / F D2 / QC
tenth 10 75 0x4b D4 / E D3 / QD
tenth 10 76 0x4c D3 / D D4 / QE
tenth 10 77 0x4d D2 / C D5 / QF
tenth 10 78 0x4e D1 / B D6 / QG
tenth 10 79 0x4f D0 / A D7 / QH
eleventh 11 80 0x50 D7 / H D0 / QA
eleventh 11 81 0x51 D6 / G D1 / QB
eleventh 11 82 0x52 D5 / F D2 / QC
eleventh 11 83 0x53 D4 / E D3 / QD
eleventh 11 84 0x54 D3 / D D4 / QE
eleventh 11 85 0x55 D2 / C D5 / QF
eleventh 11 86 0x56 D1 / B D6 / QG
eleventh 11 87 0x57 D0 / A D7 / QH
twelfth 12 88 0x58 D7 / H D0 / QA
twelfth 12 89 0x59 D6 / G D1 / QB
twelfth 12 90 0x5a D5 / F D2 / QC
twelfth 12 91 0x5b D4 / E D3 / QD
twelfth 12 92 0x5c D3 / D D4 / QE
twelfth 12 93 0x5d D2 / C D5 / QF
twelfth 12 94 0x5e D1 / B D6 / QG
twelfth 12 95 0x5f D0 / A D7 / QH
thirteenth 13 96 0x60 D7 / H D0 / QA
thirteenth 13 97 0x61 D6 / G D1 / QB
thirteenth 13 98 0x62 D5 / F D2 / QC
thirteenth 13 99 0x63 D4 / E D3 / QD
thirteenth 13 100 0x64 D3 / D D4 / QE
thirteenth 13 101 0x65 D2 / C D5 / QF
thirteenth 13 102 0x66 D1 / B D6 / QG
thirteenth 13 103 0x67 D0 / A D7 / QH
fourteenth 14 104 0x68 D7 / H D0 / QA
fourteenth 14 105 0x69 D6 / G D1 / QB
fourteenth 14 106 0x6a D5 / F D2 / QC
fourteenth 14 107 0x6b D4 / E D3 / QD
fourteenth 14 108 0x6c D3 / D D4 / QE
fourteenth 14 109 0x6d D2 / C D5 / QF
fourteenth 14 110 0x6e D1 / B D6 / QG
fourteenth 14 111 0x6f D0 / A D7 / QH
fifteenth 15 112 0x70 D7 / H D0 / QA
fifteenth 15 113 0x71 D6 / G D1 / QB
fifteenth 15 114 0x72 D5 / F D2 / QC
fifteenth 15 115 0x73 D4 / E D3 / QD
fifteenth 15 116 0x74 D3 / D D4 / QE
fifteenth 15 117 0x75 D2 / C D5 / QF
fifteenth 15 118 0x76 D1 / B D6 / QG
fifteenth 15 119 0x77 D0 / A D7 / QH
sixteenth 16 120 0x78 D7 / H D0 / QA
sixteenth 16 121 0x79 D6 / G D1 / QB
sixteenth 16 122 0x7a D5 / F D2 / QC
sixteenth 16 123 0x7b D4 / E D3 / QD
sixteenth 16 124 0x7c D3 / D D4 / QE
sixteenth 16 125 0x7d D2 / C D5 / QF
sixteenth 16 126 0x7e D1 / B D6 / QG
sixteenth 16 127 0x7f D0 / A D7 / QH
din_dout_pintable.1227454554.txt.gz · Last modified: 2008/11/23 15:35 by this