Duggle Posted December 20, 2010 Report Share Posted December 20, 2010 Would it be possible to modify this project to add either another DIN or DOUT in order to achieve a 24 X 16 scan matrix? I am working on a 192 key velocity sensitive keyboard (axis-64 clone). Is it just a matter of changing these: // scan 16 rows #define MATRIX_NUM_ROWS 16 // maximum number of supported keys (rowsxcolumns = 16*16) #define KEYBOARD_NUM_PINS (16*16) I think the correct answer is "yes, it is possible..to achieve a 24 X16". I say this because if it turns out to be constrained by i/o speed, it is possible to substantially increase the SPI clock. I havn't closely analysed the code but I have the impression that there is plenty of spare CPU cycles, as well. Quote Link to comment Share on other sites More sharing options...
TAG Posted December 20, 2010 Report Share Posted December 20, 2010 Thorsten commented that the 16 x 16 matrix loaded the CPU by ~40% so I am assuming a 24 x 16 matrix would load the CPU by ~60%. I have a 32 bit core on order so I am going to give it a try when it comes in. It might not be necessary to change the SPI clock, but that will offer another lever to pull if I have issues with speed. Quote Link to comment Share on other sites More sharing options...
Duggle Posted December 20, 2010 Report Share Posted December 20, 2010 Indeed, and I think you may be being conservative, as there might be idle cycles while the transfers complete that could be used if needed, by increase SPI clk. Quote Link to comment Share on other sites More sharing options...
wsimard Posted January 18, 2011 Report Share Posted January 18, 2011 Hi ! I'm sorry, I don't want to hijack your thread, but I just want to be 100% I understand well. Since DIN and DOUT modules have both 32 parallels inputs or outputs, this mean that this keyboard matrix would use half of those I/O (16x16). This mean I could easily add, let's say, 16 push buttons and 16 LEDs without any additional shift registers or modifications. Could you confirm I'm right ? Thank you ! William Quote Link to comment Share on other sites More sharing options...
Duggle Posted January 18, 2011 Report Share Posted January 18, 2011 Since DIN and DOUT modules have both 32 parallels inputs or outputs, this mean that this keyboard matrix would use half of those I/O (16x16). This mean I could easily add, let's say, 16 push buttons and 16 LEDs without any additional shift registers or modifications. Correct, the spare hardware is spare for you to use. Quote Link to comment Share on other sites More sharing options...
wsimard Posted January 19, 2011 Report Share Posted January 19, 2011 (edited) Ok thanks... I'm currently scratching my head studying the Roland keybed matrix. Since I want to build the BEST 88 notes MIDI controller, I'm currently ordering a new Roland PHA III Ivory keybed (found in the V-Piano or RD700NX). The difference with Fatar (or maybe other keybeds) is that the 2 switches are not in the same position. The easiest way I can explain it is this: Fatar = 2 switches (1 switch = note up, 1 switch = note down) Roland = 2 switches (1 switch = note almost down, 1 switch = note down) This mean that the IC must be REALLY fast to calculate the velocity. Does anyone have a clue on this ? What's the fastest delta (time between the 2 switches) the STM32 can compute ? Will Edit: You know it's a bit confusing. I don't have access to a Fatar keybed, but by looking to some pictures on the web, it looks that there's also 2 switches on the Fatar in the same position. Maybe I'm misunderstanding something... Edited January 19, 2011 by wsimard Quote Link to comment Share on other sites More sharing options...
Duggle Posted January 20, 2011 Report Share Posted January 20, 2011 I'd suggest that the timing between switch closures will be of a similar order of magnitude. (Eg if they're half the distance of the Fatar, then it is straightforward to compensate ie double the scan rate and adjust the timer count to velocity calculation) There is some flexibility at the Core end to increase SRIO scan rate if necessary and the timer used is of high resolution. Quote Link to comment Share on other sites More sharing options...
TAG Posted March 10, 2011 Report Share Posted March 10, 2011 I have my 24 x 16 matrix working. It works pretty well as is, but I want to experiment with scanning faster. I have been poking around in the ST reference manual and the code trying to understand how to change the SPI clock. It looks like I need to change the APB low-speed prescaler (APB1) is this correct? Will other peripherals used by midibox be effected by changing this prescaler? Where is this set in the code? Thanks, TIm Quote Link to comment Share on other sites More sharing options...
TAG Posted March 11, 2011 Report Share Posted March 11, 2011 I see now: MIOS32_SPI_PRESCALER Quote Link to comment Share on other sites More sharing options...
Duggle Posted March 11, 2011 Report Share Posted March 11, 2011 I see now: MIOS32_SPI_PRESCALER Yes, and you can initiate SRIO scans more frequently than the MIOS32 tick rate. IIRC there is discussion and examples of this on these forums. Quote Link to comment Share on other sites More sharing options...
TAG Posted March 29, 2011 Report Share Posted March 29, 2011 Thanks for all the help, here is a link to my working project on the make blog: http://blog.makezine.com/archive/2011/03/diy-isomorphic-keyboard.html 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.