Jump to content

Only getting encoder events in one direction


 Share

Recommended Posts

Hi all,

I'm at the beginning of writing a C application on MIOS8. The hardware is composed of a Core '452, a DIN and two voti.nl encoders attached to it (http://www.voti.nl/shop/catalog.html?SW-ROT-01). I'm using input pins 0/1 and 2/3.

I'm using the skeleton application as a starting point (sdcc_skeleton_v1_1). MIOS on the chip is upgraded to version 1.9h.

If I don't configure any encoders, I can see button events coming through DIN_NotifyToggle:

[16083.144] Button: 00 pressed
[16083.153] Button: 01 pressed
[16083.162] Button: 00 depressed
[16083.171] Button: 01 depressed
[16083.239] Button: 00 pressed
[16083.248] Button: 01 pressed

... and so on. But if I add an encoder table for a single encoder, like

#include <cmios.h>
#include <pic18fregs.h>
#include <debug_msg.h>

MIOS_ENC_TABLE {
  MIOS_ENC_ENTRY(1, 0, MIOS_ENC_MODE_DETENTED2),
  MIOS_ENC_EOT 
};

, I receive encoder events only for clockwise rotations (negative increments).

If i change the encoder type to DETENTED/3/4/5, i get no events at all.

Same exact thing happens with the other encoder, and even if I enable both (MIOS_ENC_ENTRY(1, 2, MIOS_ENC_MODE_DETENTED2)).

I don't think there's a hardware problem because it seems to me that the input pins are working fine. Also, using different pins or using a second DIN didn't help.

What did go wrong?...

 

Thanks!

Best regards,

Enrico

 

Edited by ris8_allo_zen0
fix title
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...