Jump to content

DIN-Module not reacting to ENC


Saschaaa
 Share

Recommended Posts

Hey,

 

I'm trying to get the DIN-Module working with some of my Encoders, but it doesn't work.

I have 1 Encoder (EN11-VSM1BF20) connected to the 10th and 11th Pin (D0,D1) of the first SR. This Encoder is also connected to 2 10K resistors. The other Pins (D2,D3,D4,D5,D6,D7) are only connected to other 10k resistors.

I use the following code:

 

  int enc;
  for(enc=0; enc<NUM_ENCODERS; ++enc) {
    u8 pin_sr = enc >> 2; // each DIN SR has 4 encoders connected
    u8 pin_pos = (enc & 0x3) << 1; // Pin position of first ENC channel: either 0, 2, 4 or 6

    mios32_enc_config_t enc_config = MIOS32_ENC_ConfigGet(enc);
    enc_config.cfg.type = DETENTED2; // see mios32_enc.h for available types
    enc_config.cfg.sr = pin_sr;
    enc_config.cfg.pos = pin_pos;
    enc_config.cfg.speed = NORMAL;
    enc_config.cfg.speed_par = 0;
    MIOS32_ENC_ConfigSet(enc, enc_config);
  }

 

NUM_ENCODERS is 1.

 

And in the ENC_Notify_Change App it says:

 

 MIOS32_BOARD_LED_Set(0x0001, ~MIOS32_BOARD_LED_Get());

  // determine relative value: 64 +/- <incrementer>
  int value = 64 + incrementer;

  // ensure that value is in range of 0..127
  if( value < 0 )
    value = 0;
  else if( value > 127 )
    value = 127;

  // send event
  MIOS32_MIDI_SendCC(DEFAULT, Chn1, 0x10 + encoder, value);

 

 

But if I'm moving the Encoder, nothing happens.

If the other free pins aren't connected to their 10k resistors, the ENC_Notify_Change App is called randomly and sends random values over the DEFAULT Midi Port. Also the LED is blinking randomly....

 

I soldered the Module twice, changed all the components, tried different tutorials(14, 15) but yet it still doesn't work :(

 

 

Has anyone some tips ?

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Hi,

 

sorry, typing error:

they are connected at pin 11 and 12.

MIDIO128 sends no output if i turn the encoder.

And i think it's no format error like it the example above, because if it would be so, it would output anything.

At the moment there is no output.

Only If some of the unused pins aren't connected to their resistors, the Debug-Section outputs something like this:

 

Value:3

Encoder:1

Inkrementer:P

Value:3

Encoder:0

Inkrementer:P

Value:4

Encoder:0

Inkrementer:

Value:3

Encoder:1

Inkrementer:P

Value:4

Encoder:1

Inkrementer:

 

 

As a result of this in the ENC-Notify-App:

MIOS32_MIDI_SendDebugMessage("Encoder: %u", encoder);
MIOS32_MIDI_SendDebugMessage("Inkrementer: %s", incrementer);
MIOS32_MIDI_SendDebugMessage("Value: %u", value);

 

 

 

Any more tips ?

Link to comment
Share on other sites

Previously you wrote that NUM_ENCODERS is 1, now encoder == 1 will be print (means: the second encoder, because encoders are counted from 0)

 

However: remove (or disable) the encoder configuration and print debug messages from APP_DIN_NotifyToggle() instead - what happens?

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Sorry again, i have 2 Encoders connected: 1 to 11/12 the other to 13/14

The other 4 pins are connected to 10k resistors

 

If i disable the encoder configuration and write :

MIOS32_MIDI_SendDebugMessage("Pin: %u", pin);
MIOS32_MIDI_SendDebugMessage("Value: %u", pin_value);

in the DINN_Notify_Toggle App - nothing happens

 

However, the DebugSection sent once the following(but now not anymore, don't know why):

 

Pin:50

Value:0

Pin:50

Value:1

Pin:28

Value:0

Pin:28

Value:1

Pin:12

Value:0

Pin:12

Value:1

Pin:86

Value:0

Pin:86

Value:1

Pin:65

Value:0

Pin:65

Value:1

Pin:106

Value:0

Pin:106

Value:1

(it continued with the following pins:55,85,62,21)

Link to comment
Share on other sites

Hey, it's me again...

 

As the DIN-Module still isn't working, I tried to get the DOUT-Module connected.

I soldered the DOUTX4_R5 Schematic with only one IC (74HC595) and left the 9th pin open(don't know if that's correct) ?!

After that, I connected 2 LEDS to D0 and D1 and uploaded the DOUT-Tutorial (9)

Now I can see the LEDs in full color, but I can't toggle them as i should be, while playing a C2 for example...

 

Has anyone some suggestions ?

Link to comment
Share on other sites

Hey, i think the same... the problem is located at the core.

Therefore I used the LogicAnalyzer to visualize the Dataoutput of the 74HCT541, maybe you can see there something irregular.

 

In every picture i took, the first 6 signals show the following: D0 = FirstPin 74HCT541 (OE#), D1 = 19thPin 74HCT541(OE#), D2 = 11th Pin 74HCT541(Y7), D3 = 12th Pin 74HCT541 (Y6), D4 = 13th Pin 74HCT541(Y5), D5 14th Pin 74HCT541(Y4)

Pic 1 - 3 show additionaly on D6 = Second Pin(A0), D7 = Third Pin(A1)

Pic 4 - 6 show additionaly on D6 = 4th Pin(A2), D7 = 5th Pin(A3)

Pic 7, 8  show additionaly on D6 = 6th Pin(A4), D7 = 7th Pin(A5)

Pic 9 - 11 show additionaly on D6 = 8th Pin(A6), D7 = 9th Pin(A7)

 

On Pic 1,9,11 you can also see that I played a Note in MIOS-Studio (D2)

 

Link: http://workupload.com/file/1oKw0gde

 

 

best regards,

sascha

Edited by Saschaaa
Link to comment
Share on other sites

Hey,

 

i know the pics above may be a bit confusing so I took some new ones.

At the moment, i'm trying to get the DOUT-Module (not the DIN) working.

I measured the following on the 541:

 

PB12, Slave/Chip-Select signal       D0

PB13, SCK                                       D1

PB15, MOSI -> data                         D2

Y7                                                     D3

Y6                                                     D4

Y5                                                     D5

PB14 MISO                                       D6

 

Now connecting the core with the DOUT-Module results in an activated LED

 

In pic 1, i played a G-0, which toggled the LED off 

In pic 2, i played a C2, which resulted in nothing

 

The things I don't get are the following:

1) Why is a played G-0 such a long impuls ? That only happended at G-0. All other notes i played were just short impulses.

2) Powering the core results in an activated CORE-LED. Playing Midi-Notes toggles the CORE-LED off, but normaly, it should be the other way around, shouldn't it ?  If i restart the core with the black button, this doesn't change. If i load the code again on the core via the MIOS-Studio, the CORE-LED goes off and behaves, like it should be(incoming Midi-Message ->LED ON). However, the  DOUT-LED is still ON.

3) If only 1 595 is connected to the DOUT-Module, where should pin 9 (O8) go ?

4) Why has the signal of the SCK pin so much bytes ? Because you could control up to 128 LEDs with it ? So 128 Bits ? What if i just want to control 16 LEDs? Is that changable ?

 

 

http://www.pic-upload.de/view-26499121/print_17.jpg.html

 

http://www.pic-upload.de/view-26499159/print_18.jpg.html

 

 

I hope somebody can help me...

 

Best regards,

Sascha

Edited by Saschaaa
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...