Jump to content

MIOS8 CLOCKBOX TAP BUTTON


vodrha
 Share

Recommended Posts

Hi, i have some MBHP for MIOS8 and i will use like clockbox. But i missing TAP button for setting BPM. Im looking for solution. I have idea, for best measure accuracy between pushes, i will use pin 15 (RC0) with timer capture function. For clockbox is not necessary hardware and its free to use. But, i dont know, and i cant find, is that timer free to use in capture mode for calculating BPM? Im trying study C and ASM code and i cant find anything. I thing, is not used and i can use it, but. Please give me some advice first, if you have idea how to solve it clearly, or im on a good way to do it. Mabe is not necessary to use something like external interruption in pin 15. I will use standart DIN pin with 74HC595 just for start and stop measure of BPM. 

Link to comment
Share on other sites

  • 3 weeks later...

Hi Vodrha!

I just react cause I'm a real fan of the clockbox, but unfortunately I can't help you.

I've build a clockbox myself: THIS ONE  It works great but I wanted it to slave to another midiclock,. As you can read in THIS POST I tried to modify the code to get the slave function. I spent hours/days with it, but I'm no programmer at all and I got stuck. As you can read in my posts I tried to copy codes from an earlier version, with slave functionallity, into the new code, buit I didn't really know what I was doing....In the end I came quite far, I got it slaving, but with output BPM's 4 times as fast. But with the divisions I can get the right BPM's slaving. So working, but with some nasty workaround.....

I hope you manage to fulfill your needs, and.... maybe you can get it slaving the right way :)..Wich version are you using?

Goodluck and cheers!

Roel

Link to comment
Share on other sites

Hi,

@vodrha You're right you can use an input pin as timer capture input, depending on timer frequency you will get a a good accuracy but this not the easiest way...

Why not using SR_Service_Prepare(void) which is called every millisecond, check your input pin value, reset and start counting on first falling edge, stop and store counter value on second falling edge, you will get the duration per quarter note "D" in ms.
Then calculate your tempo  T= 60000/D
an finaly set your tempo using  MCLOCK_BPMSet(T);

Best regards
Bruno

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