I am building Arduino Due based project called MiniEngine v2 (an open-source motion control software for timelapse photography).
The project is not very active anymore but there are still all the documentation at github. Project owner had webshop where he sold MiniEngine shields for arduino but they are not available anymore. There was gerber files available at project github page so I orderer PCB's form seeed.com.
Project's Github page is at: https://github.com/airiclenz/miniEngine2
Everything seems to work ok but one of the buttons is not working. There is only 2 buttons and one rotary encoder.
I think the reason why the button is not working is that the output voltage for button from 74HC14N (hex smith trigger) is too low (I am not very good at electronic so I might be totally wrong.
I tried to measure values with voltage meter and here is the result what I got for those two buttons:
Here are the values in written format ( I took measurement from SN74HC14N )
- btn_2 (pin9 input, pin8 output)
- btn_1 (pin11 input, pin10 output)
SETTINGS BUTTON (btn_2) -> this one works fine
- 1) button up - metering from input pin 11 => 3.26
- 2) button down -metering from input pin 11 => 0
- 3) button up - metering from output pin 10 => 0.6
- 4) button down - metering from output pin 10 => 2.38
START/BACK BUTTON (btn_1) -> this one does not work
- 1) button up - metering from input pin 9 => 3.26
- 2) button down - metering from input pin 9 => 0
- 3) button up - metering from output pin 8 => 1.43
- 4) button down - metering from output pin 8 => 1.53
Here is how the buttons are initialized:
void input_init() {
// set pin modes
pinMode(PIN_ROTARY_PRESS, INPUT);
pinMode(PIN_KEY_1, INPUT);
pinMode(PIN_KEY_2, INPUT);
// attach interrupts for the keys
attachInterrupt(PIN_ROTARY_PRESS, input_interrupt_keyRotary_press, RISING);
attachInterrupt(PIN_KEY_1, input_interrupt_key1, RISING);
attachInterrupt(PIN_KEY_2, input_interrupt_key2_press, RISING);
// attach interrupts to both encoder pins for every state change
attachInterrupt(PIN_ROTARY_A, input_interrupt_rotary, CHANGE);
attachInterrupt(PIN_ROTARY_B, input_interrupt_rotary, CHANGE);
// set the initial rotary values & configurations
rotary.setPosition(0);
rotary.setKeyMode(true);
rotary_old_pos = 0;
}
And here is function for btn_1 press that is never called (except once in powering the shield/arduino due)
void input_interrupt_key1() {
if ((key_1_time + DEF_INPUT_DEBOUNCE) < millis()) {
key_1_time = millis();
setBit(input_status, BIT_2);
}
}
I can only use 2 links in posts (I do not have 10 reputation) so you can find the code for inputs at Github (link above). (folder MiniEngine2/Software/miniEngine2/mE2_input.ino)
All code files are at Sotfware at folder: MiniEngine2/Software/miniEngine2
I have put Serial.println command in code and nothing is printed when btn_1 is pressed. When I plug power on then the btn_1 is triggered once...
Here is link to the the schematic for that shield ( it is quite big so that's why I did not embed the photo):
Schematic for shield is at Github folder : Hardware/miniE shield v2 revB BED board - schematic.pdf
Here is also link to the video where you can see how I took the measurements: https://youtu.be/wFR7P65qMGA
Please ask if I need to provide more information...