Jump to content

Sub-millisecond SRIO? (for fast matrix scanning w/ velocity)


 Share

Recommended Posts

Hello,

I'm currently building the hardware & software around a Fatar TP/9S keyboard I got from a friend. It has 63 keys with velocity sensing. Its keys are connected together to form two separate 8x8 scan matrices, which I managed to handle by modifying the BLM module in MIOS. I can currently send the correct MIDI note on/off events, and I'm really happy about this.

My problem arises now that I want to implement velocity sensing. Since the BLM code scans the whole matrix in 8 SRIO cycles, it has a resolution of 7-8ms, which is too much as far as I see. I'd like a net resolution of 1ms, that means that MIOS should update its SRIOs every 125us, but MIOS_SRIO_UpdateFrqSet uses milliseconds as units. What is the better way to do?

- modify the MIOS code to let MIOS_SRIO_UpdateFrqSet use a smaller time unit?

- setup a user timer with a 125us period and force MIOS to update the SRIOs 7 out of 8 times?

- ...what else?

- surrender and live with that resolution? (not recommended :P)

Many thanks for any help!

RAZ

Link to comment
Share on other sites

the 7-8ms resolution is for the two matrices or for each one?

It's for both, because I'm using only one DOUT for two DINs.

it feels too slow?

I didn't do any "real" test yet (i.e. playing the piano) but I see that this resolution allows only to discriminate between two velocities, not more (an interval of 15-16ms or more means a really slow press).

it seems as if this problem could perhaps be solved with help of search. Try to search this forum for qbas and scanmatrix.

Thank you. I know about QBAS's code, but some time ago I preferred not use it because I didn't understand how to customize it with my hardware and decided to write the code by myself modifying the BLM module.

QBAS's code directly controls the shift registers without using the MIOS functions; therefore it can scan the matrix much faster than 1ms per row. Instead, BLM relies on the MIOS functions having an unchangeable 1ms update rate (changing it would bring too many side effects, I think). I have to find a solution for myself, either with the above ideas or by re-evaluating QBAS's code.

RAZ

Link to comment
Share on other sites

You are going to have to go to a lower level than MIOS control of the DIN and DOUT to achieve sub-millisecond scanning of a matrix. You either need to get comfortable with what QBAS has done or find TK's earlier sm_8x8 code that QBAS used as a basis for his project. As for using the QBAS code, can you not just ignore the boards you aren't using?

Link to comment
Share on other sites

The DIN and DOUT modules are connected serially to the PIC..

Scanning these takes time, and processing the results takes time as well.

It sounds like you're ready to leave MIOS and go straight into ASM code.

Choose a chip (maybe PIC, maybe something else) with enough pins so that

you can directly access every row and column without using DIN and DOUT

shift registers. The clock speed of the chip will set your capability.

If the only task is scanning your keyboard and sending MIDI, you will

have a great introduction to assembly language programming.

If the quality of your output depends on how fast you can scan the matrix,

then get off the shift registers and write your own code.

Well, that's one opinion, anyway. :-)

Have Fun,

LyleHaze

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

×
×
  • Create New...