Jump to content

MIOS: Encoders/Buttons & user fun


Guest pkstone
 Share

Recommended Posts

Guest pkstone

Hi all (and Thorsten, especially),

I'm studying MIOS to figure out how I'm going to do the Axe-Thing rebuild (see my other post under "MIOS programming" explaining about this), and it's slowly becoming clearer (thanks for the great introduction to MIOS on the Concepts part of the main page, Thorsten).

It looks like - correct me if I'm wrong - that encoders and buttons can be mixed together in the DIN chain (you just have to set encoder locations in a table).  Does this mean that header J6 on the Core is no longer needed for encoders with MIOS?

Since I'm going to use non-multiplexed Analog input, can I use the 'RC0-4' port lines on the 18F452 for my own nefarious purposes? :)  If so, can my own scanning subroutines be worked into the main loop via a user function hook?  (If that doesn't make any sense, I'll try to explain it better in another message).

I have more questions, but this is a good start! :)

Thanks,

  Phil

Link to comment
Share on other sites

Hi Phil,

yes, thats correct. Rotary encoders are now handled like buttons and have to be connected to the J9 DIN chain. Once the DIN pins have been assigned to an encoder, USER_DIN_NotifyToggle will not be called for these pins anymore. USER_ENC_NotifyChange will be called instead.

So far as you don't use the AIN multiplexers, a graphical LCD or a SID module, RC0-5 are free.

My suggestion is to add the scanning routine to USER_SR_Service_Finish, this routine is called on every update cycle for the DIN/DOUT chain (update period can be lowered to 1 ms). It guarantees that no event get lost. The timer hook could be used for higher sampling periods.

Best Regards, Thorsten.

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