You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all thank you so much for this detailed project! It was actually the inspiration for me to get started with MicroControllers and I am working now on my first project. My overall aim is to build a custom MidiController to control FL Studio. This also involves a set of rotary encoders that I would like to use for that.
Unfortunately I encounter a problem with the MPX_74165 board that I want to use. I tried to summarize my issue in this discussion and hope it is the right place to adress this topic. :)
Aim:
I would like to use 2 daisy chained MPX_74165 boards to connect 16 rotary encoder with my Teensy 4.1. (Currently I only work with one board for the PoC).
Problem:
When rotating the encoder no value change is registered.
Observations:
Without the 3 long bus resistors (I assume based on the Schematics that it is for the pull-down?) there is input registered by the Teensy however it is random and probably due to the interferences at the wires.
Adding the resistors will lead to no input registration at all. Nothing does happen when I rotate the encoder.
Tests:
I tested the encoder with the Single Polled Encoder from your library and it works perfectly there. Therefore I assume that it is no mechanical issue.
I also checked the connectivity of all parts and did a check of the soldering and the electrical paths working correctly.
I tried all CountModes.
Setup:
Teensy 4.1 connected via USB to PC.
Pins:
QH_A = 10
QH_B = 11
pinLD = 2
pinCLK = 7
VCC = 3,3V
QH_S unused! (This is the kable not plugged in you might see on the pictures.
Code:
#include"EncoderTool.h"#include<Encoder.h>#include"Arduino.h"
constexpr size_tbufSize=10;
EncoderencoderA(30, 31);
EncoderTool::PolledEncoderencoderB;
constexpr unsignedencoderCount=2; // number of attached (daisy chain shift regesters for more than 8)
constexpr unsignedQH_A=10; // output pin QH of shift register B
constexpr unsignedQH_B=11; // output pin QH of shift register A
constexpr unsignedpinLD=2; // load pin for all shift registers)
constexpr unsignedpinCLK=7; // clock pin for all shift registers// 74165 datasheet: http://www.ti.com/product/SN74HC165EncoderTool::EncPlex74165encoders(encoderCount, pinLD, pinCLK, QH_A, QH_B);
voidonAnyEncoder(uint8_tchannel, intvalue, intdelta)
{
Serial.print("Encoder: ");
Serial.print(channel);
Serial.print(" value: ");
Serial.print(value);
Serial.print(" delta: ");
Serial.print(delta);
Serial.println();
}
voidonFirstEncoder(intvalue, intdelta)
{
Serial.print("Encoder 0 (standalone callback): ");
Serial.println();
}
voidsetup()
{
Serial.begin(115200);
Serial.setTimeout(1);
encoderB.begin(28, 29);
encoderB.setCountMode(EncoderTool::CountMode::full);
encoders.begin(EncoderTool::CountMode::halfAlt);
encoders[0].attachCallback(onFirstEncoder);
encoders.attachCallback(onAnyEncoder);
Serial.println("Setup complete");
}
constunsigned longeventInterval=1000;
voidloop()
{
encoderB.tick();
encoders.tick();
unsigned longcurrentTime=millis();
staticunsigned longuiLastRefresh=millis();
if (currentTime-uiLastRefresh >= eventInterval)
{
uiLastRefresh=currentTime;
Serial.println("Alive!");
/*int valueA = encoderA.read(); Serial.print("EncoderA value: "); Serial.println(valueA); int valueB = encoderB.getValue(); Serial.print("EncoderB value: "); Serial.println(valueB);*//*for (unsigned i = 0; i < encoderCount; i++) { if (encoders[i].valueChanged()) { Serial.print("Encoder:"); Serial.print(i); Serial.print(" value:"); Serial.println(encoders[i].getValue()); } else { Serial.print("Encoder:"); Serial.print(i); Serial.println(" unchanged."); } }*/
}
}
Ideas:
Could it be that the resistors are to weak or strong and therefore not letting any signal through?
Could there be a specific configuration of the Pins required when this Multiplexer is used with Teensy 4.1?
Final words:
Any help is highly appreciated I really hope that there is a way to make it work! :)
I hope the information I provided does help in any way to give you an overview about the setup.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello Luni,
first of all thank you so much for this detailed project! It was actually the inspiration for me to get started with MicroControllers and I am working now on my first project. My overall aim is to build a custom MidiController to control FL Studio. This also involves a set of rotary encoders that I would like to use for that.
Unfortunately I encounter a problem with the MPX_74165 board that I want to use. I tried to summarize my issue in this discussion and hope it is the right place to adress this topic. :)
Aim:
I would like to use 2 daisy chained MPX_74165 boards to connect 16 rotary encoder with my Teensy 4.1. (Currently I only work with one board for the PoC).
Problem:
When rotating the encoder no value change is registered.
Observations:
Without the 3 long bus resistors (I assume based on the Schematics that it is for the pull-down?) there is input registered by the Teensy however it is random and probably due to the interferences at the wires.
Adding the resistors will lead to no input registration at all. Nothing does happen when I rotate the encoder.
Tests:
I tested the encoder with the Single Polled Encoder from your library and it works perfectly there. Therefore I assume that it is no mechanical issue.
I also checked the connectivity of all parts and did a check of the soldering and the electrical paths working correctly.
I tried all CountModes.
Setup:
Teensy 4.1 connected via USB to PC.
Pins:
QH_A = 10
QH_B = 11
pinLD = 2
pinCLK = 7
VCC = 3,3V
QH_S unused! (This is the kable not plugged in you might see on the pictures.
Code:
Parts (BOM):
Ideas:
Could it be that the resistors are to weak or strong and therefore not letting any signal through?
Could there be a specific configuration of the Pins required when this Multiplexer is used with Teensy 4.1?
Final words:
Any help is highly appreciated I really hope that there is a way to make it work! :)
I hope the information I provided does help in any way to give you an overview about the setup.
All the best to you!
Greetings from Berlin,
weitlos
Beta Was this translation helpful? Give feedback.
All reactions