Jump to content

Please help me to understand how the NG app works internally


tago

Recommended Posts

Thank you very much @FantomXR

Are 8 SRs in use because the DIO module is configured as a matrix for keyboard scanning?

I don't properly understand what these parameters mean:

KEYBOARD n=1 rows=8  dout_sr1=1  dout_sr2=2  din_sr1=1  din_sr2=2

Looks like there are 4 SRs (2 in / 2 out) in use or is it only two? What does dout_sr1=1 mean? Is 1 an unique identifier?

Link to comment
Share on other sites

43 minutes ago, tago said:

Are 8 SRs in use because the DIO module is configured as a matrix for keyboard scanning?

I don't see the reason why TK choosed sr=9 as emulated shiftregister. But anyway: When working with emulated elements (same is valid for button- & LED-matrices f.e.) it's always good to use a value that is definitely not blocked by real hardware.

The keyboard blocks the first two digital input-SRs (usually HC165) and the first two digital output-SRs (usually HC595). 

dout_sr1=1 means the first HC595 in the digital chain. din_sr1=1 means the first HC165 in the chain. For a beginner this might be confusing. 

In NG you can set the total number of scanned shiftregisters with this command:

SRIO num_sr=2

Even though in this example I set num_sr=2 I can connect in total 4 shift registers. 2x HC165 and 2x HC595.

Edited by FantomXR
Link to comment
Share on other sites

As mentioned by Christian, there was no special reason why assigned DIN and DOUT SR #9 to the DIO function.

I thought this might be better in case you would like to add more physical SRs in future, no need to change the IDs again until you reach #9. If you don't like this, you could also use SR #3, but not SR #1 or SR #2, because these positions are already allocated by the scan matrix.

Btw.: the most simple way to find out the hw_ids is to enter "set debug on" in the MIOS terminal, then trigger the buttons and observe the debug messages in the terminal (doesn't work with LEDs of course, but if you know the button position, you can easily conclude on the LED position)

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...