FantomXR Posted September 15, 2019 Report Share Posted September 15, 2019 (edited) In your code you had assigned SR1 to both the keyboard and the DIO (J5A) module. This is invalid. You have to use a SR number that it not in use. And the last pin on the 8th SR is Pin 64 (8x8). So the first pin on the 9th is 65. Edited September 15, 2019 by FantomXR Quote Link to comment Share on other sites More sharing options...
tago Posted September 15, 2019 Author Report Share Posted September 15, 2019 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? Quote Link to comment Share on other sites More sharing options...
FantomXR Posted September 15, 2019 Report Share Posted September 15, 2019 (edited) 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 September 15, 2019 by FantomXR Quote Link to comment Share on other sites More sharing options...
TK. Posted September 15, 2019 Report Share Posted September 15, 2019 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.