Jump to content

Recommended Posts

Posted

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.

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted

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.

Posted

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.

  • 4 weeks later...
Posted

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

Posted

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.

Posted (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 by wsimard
Posted

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.

  • 1 month later...
Posted

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

Posted

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.

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...