Jump to content

Understanding DIN PIN/Shift register numbering


eufex

Recommended Posts

Looking at a single DIN handling buttons, the standard schematic has the 4 menu buttons on J3 (shift register 1). In 64E main.asm (64 is similar):

#define DEFAULT_DIN_SR_PIN_01_08 2

#define DEFAULT_DIN_SR_PIN_09_16 3

#define DEFAULT_DIN_SR_PIN_17_24 1

#define DEFAULT_DIN_SR_PIN_25_32 4

#define DEFAULT_DIN_SR_PIN_33_40 9

#define DEFAULT_DIN_SR_PIN_41_48 10

#define DEFAULT_DIN_SR_PIN_49_56 11

#define DEFAULT_DIN_SR_PIN_57_64 12

But

; DIN pin numbers of menu buttons

#if DEFAULT_ENC_DATAWHEEL == 0

  #define DEFAULT_DIN_MENU_EXEC 7 ; menu exec button

assigned to DIN pin #7

  #define DEFAULT_DIN_MENU_RIGHT 6 ; menu right button

assigned to DIN pin #6

  #define DEFAULT_DIN_MENU_LEFT 5 ; menu left button

assigned to DIN pin #5

  #define DEFAULT_DIN_MENU_SNAPSHOT 4

In the schematic the pins from shift register 2-4 are numbered 1-24 - i.e SR 2 - pins 1-8, SR 3 = pins 9-16, SR 4 = pins 17-24 and SR1 is unnumbered.

Going from that the first, second DEFAULT line matches and then it doesn't match. Then in the DEFAULT_DIN_MENU calls the pin numbering is different again because pins from SR 1 are numbered 4,5,6,7 as if counting 1 from the first pin on SR1.

Is there something in one of the other application files that will explain this, or can anyone explain this as I'm totally confused.

Link to comment
Share on other sites

Not to hijack Eufex's post, but a few of the newbie "stumbling blocks" I jotted down at Smash's request involve that same area. In fact, I'm looking at some of my illegible scribble now that says "Why are the D.IN register defaults in non-numeric order?". I guess Eufex is looking at the actual pin numbering, but it took me a bit to figure out which D.IN and D.OUT numbering assignments worked and ended up at the correct lights. I think I may even remember certain configurations not working at all or working even though the assigned reg. was not available (I'm only testing with 8 buttons and 16 lights). It may also need mentioning that their 1-8 numbering assignments are two different batches of 1-8, as they are both referred to as shift registers.

A couple of the other ones involved the general purpose section:

- Why are they assuming we have 16 of each?

- What happens on GP pages if these values are zero, if they exceed the number of available registers, if the defines are simply left out of the main file, or how would

   you go about turning the function off?  (for people on limited i/o circuits)

-  Do they cooperate in "sharing" assignments with the previous button/LED assignments?

Sorry Eufex. I guess one of them is 'sort of' the same though ;)

                           -George

PS- If TK's here- The first LCD default comment for 2x16 is listed as 4x20 or something in the main (the values are still 2x16) 

Link to comment
Share on other sites

http://www.ucapps.de/mios/mios_din_dout_pin_numbers.txtI know, it's a very abstract describtion, but no volunteer has been found yet, who wants to write application specific docs

I'll try to hustle on my stuff I wanted to send Smash. It won't span anywhere close to the din/dout level, but could maybe suggest some newbie MB64/MIOS tips.

-George

PS- I've had to go back to that pin# listing every so often and keep forgetting where it is. It should maybe be linked from their MBHP pages or something for convenience.

Link to comment
Share on other sites

Thanks for the link Thorsten - I've actually already seen that one - the pins are numbered sequentially from SR 1 onwards. But that is where the confusion is with:

#define DEFAULT_DIN_SR_PIN_01_08  2

#define DEFAULT_DIN_SR_PIN_09_16  3

#define DEFAULT_DIN_SR_PIN_17_24  1

#define DEFAULT_DIN_SR_PIN_25_32  4

#define DEFAULT_DIN_SR_PIN_33_40  9

#define DEFAULT_DIN_SR_PIN_41_48  10

#define DEFAULT_DIN_SR_PIN_49_56  11

#define DEFAULT_DIN_SR_PIN_57_64  12

Where pin 1-8 is defined as shift register 2 and 17-24 as shift register 1. I wondered why this was so and what would happened if I renumbered them as I'm putting 128 pin outs on this particular core. Can anyone else answer?

Link to comment
Share on other sites

This mapping exists due to compatible reasons with older MB64 hardwares. It maps the DIN shift registers to the entries of the midibox64.ini file. By default, the first shift register is assigned to position 17-24 (partly used for menu navigation), so that people are able to control the menu with only one 74HC165.

Without telling too much words which are not really relevant here: yes, you can use any mapping you want

(sometimes I build too much features into the application...)

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...