|
Post by feijai on Nov 11, 2023 7:04:52 GMT
I have been porting projects to GRAINS and have found what I think is a bug.
If you set Pot 1 or 2 to "Man", then 0 is fully left and 1023 is fully right as expected.
But if you set either of them to "In 1" or "In 2", and feed in +5V from 4ATT-MIX, or from a clock source, then 0 is fully left, but 1023 (5V) is at about the **2 o'clock** position. Further right than that and it stays at 1023.
Can anyone verify this with their unit? I could provide some test code.
This has two repercussions. First, it means that using "In 1" or "In 2", the range of the dial is significantly decreased by 1/3. Second, I am concerned that what is happening is that underlying circuitry is actually multiplying the voltage above 5V. That would be really bad, as the Atmega328P ADC can only safely handle 0.5V above VCC. But it seems unlikely -- more likely, the circuitry is not linearly changing the voltage, and it then gets capped at 5V somehow?
|
|
|
Post by pt3r on Nov 11, 2023 10:21:11 GMT
Can you explain me how this is possible? According to the schematics of the module both potmeters are nothing but attenuators that can switched between their respective inputs and 5v.
So how can it be that when the pot is connected to 5v on the input pin or 5v internally its behaviour changes?
|
|
|
Post by feijai on Nov 11, 2023 10:27:11 GMT
I have no explanation. But I assure you, that is precisely what is happening on my unit. Try it!
My guess is that when "In 1" / "In 2", the pot circuitry attenuators are rising too fast, and hit 5V way too early.
|
|
|
Post by pt3r on Nov 11, 2023 11:02:05 GMT
But it is the same potmeter the 5v go through. The only thing that changes is whether the 5v originates from the pin or from the module. A potmeter can not change its curve by switch between to 5v sources, no?
|
|
|
Post by feijai on Nov 11, 2023 11:44:44 GMT
But it is the same potmeter the 5v go through. The only thing that changes is whether the 5v originates from the pin or from the module. A potmeter can not change its curve by switch between to 5v sources, no? Are you sure? We don't have the schematics, only a high level diagram of the basic concept. It could be boosting everything, but when on man it feeds in a 4v signal? Or is there some voltage drop due to amperage pull?
|
|
|
Post by feijai on Nov 11, 2023 15:11:16 GMT
I've done double-checking and it is exactly as I have described. The following arduino file will illustrate it:
void setup() { Serial.begin(9600); }
void loop() { Serial.println(analogRead(A2)); // Pot 1 } Download this into the GRAINS. Then attach +5V from 4ATT/MIX, or the bus directly, or the BRAEDBOARD into In 1 on the GRAINS. Or use a clock source with a long ON time, like a slow square LFO. Set Pot 1 to "In 1". Fire up the Arduino Serial Monitor. You'll see that 1023 is reached at almost exactly 75% of the potentiometer travel. Switch to "Man" and you'll see that this position is equal to about 765 on Man.
I would like someone to verify this on their GRAINS unit. I'm confident that it is a bug.
|
|
|
Post by MikMo on Nov 13, 2023 13:56:40 GMT
Try to measure the actual voltage on the "IN 1" and "IN 2" on the module, and compare with what the serial monitor says.
Also try to put a delay(100); or similar in the loop. The loop is running super fast, and sending data over serial is super slow.
I have messed up troubleshooting on Arduino several times by using Serial print to debug, because it messes with the timing of other parts of the program, because it is orders of magnitude slower than what your program is trying to do. It might not be the cause of the issue you see, but try it.
|
|
|
Post by feijai on Nov 13, 2023 22:46:00 GMT
Try to measure the actual voltage on the "IN 1" and "IN 2" on the module, and compare with what the serial monitor says. The actual voltage is +5V, straight from the Braedboard. I'm pretty certain this is a bug. Isn't there anyone with a GRAINS who can verify it?
|
|
|
Post by duddex on Nov 18, 2023 10:31:18 GMT
Yes. I can confirm this behaviour with both of my GRAINS modules
5V from MASTER I/O into IN1. Switch for P1 set to IN1. Turn P1 about 2/3 or 3/4 to the right until the value reaches 1023 Leave P1 in the same position and set switch for P1 to MAN: The value jumps to 760
|
|
|
Post by duddex on Nov 21, 2023 19:32:24 GMT
Sorry that it took me so long to realize this: but I discovered that you have to use 3.8V as reference. I tried to make a CV to MIDI module with GRAINS. And it turned out that the tracking was completely off until I used 3.8V as reference voltage. forum.aemodular.com/post/15849/threadSo 3.8V results in the value 1023. That means the value 1023 is reached at 3.8V and it stays at 1023 between 3.9V and 5V I guess the "MAN" setting uses 3.8V
|
|