Jump to content

Recommended Posts

Posted

All my pots use the AIN and I've decided to use 1 encoder as data wheel next to my LCD.

I looked at TK's clockbox example to see how he configured the application for an encoder and the only reference I found was this in main.c:

// set encoder speed mode of datawheel
MIOS_ENC_SpeedSet(0, DATAWHEEL_SPEED_MODE, DATAWHEEL_SPEED_DIVIDER);
Is this all I need? Setting the speed for the encoder (0)? Also, I'm using a lot of buttons and I'm halfway through my second DINX4. It looks like all I have to do is wire the encoder to 2 pins like shown in this schematic (http://www.ucapps.de/mbhp/mbhp_dinx4_16enc.pdf), and identify its enc enumeration like so:
|-----------------------------------|
|   .....   .....   .....   .oo..   |
|                                   |
|                                   |
|   .....   .....   .....   .....   |
|-----------------------------------|

On the second DINX4 this would be ENC 63 (the last one)?

P.S. My project is based on the C skeleton.

Posted

Hi

you also need to add this encoder in mios_tables.inc (in the mios_wrapper subdir)

_MIOS_ENC_PIN_TABLE
MIOS_ENC_PIN_TABLE
	;; encoders 1-16
	;;        SR  Pin  Mode
	ENC_ENTRY  8,  6,  MIOS_ENC_MODE_DETENTED2	; datawheel

Since you only have one encoder this encoder has number 0 (first entry in the table)

Did you define DATAWHEEL_SPEED_MODE and DATAWHEEL_SPEED_DIVIDER somewhere?

in the clockbox example these are defined in main.h but this file isn't included in the skeleton

Michaël

Posted

mess

This explains it perfectly, thanks.

I never considered these files to be editable... in fact, I never looked at them.

Did you define DATAWHEEL_SPEED_MODE and DATAWHEEL_SPEED_DIVIDER somewhere?

Yes. I saw that too and just didn't include it in my 1st post.

Posted
I never considered these files to be editable... in fact, I never looked at them.

When I first tried to use an encoder I made the same error  :)

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