Skip to main content
17 events
when toggle format what by license comment
Apr 24, 2023 at 7:07 vote accept Good York
Apr 22, 2023 at 13:31 comment added st2000 @GoodYork, I understand you have not done any of this with real hardware. That the question is based on an emulation only? You should have said so in the question. Please go back end edit your question stating clearly that the question is based only on am emulation. (If you are wondering why an emulation does not reflect the real world ... perhaps we should start by saying that companies like Atmel (now Microchip) are very unlikely to disclose everything about their processor's design.)
Apr 21, 2023 at 21:59 answer added KIIV timeline score: 2
Apr 21, 2023 at 21:05 comment added KIIV Notice the slight difference between your attachPCINT and in the example. There is extra digitalPinToPCINT, basically you are probably catching radio on some other pin.
Apr 21, 2023 at 16:14 comment added Good York is it possible to do button click tracking via Pin Change Interrupts?
Apr 21, 2023 at 15:50 comment added DrG Sorry, but I can't interpret your task for you. Here is another good reference that may help. gammon.com.au/interrupts You will figure it out.
Apr 21, 2023 at 14:57 comment added Good York I guess I need to do through Pin Change Interrupts, something like this: void setup() { pinMode(buttonPin, INPUT_PULLUP); PCMSK0 |= (1 << PCINT3); PCIFR |= (1 << PCIE0); attachInterrupt(digitalPinToInterrupt(buttonPin), buttonISR, RISING); Serial.begin(9600); } but it doesn't work
Apr 21, 2023 at 14:14 comment added Good York I am using arduino uno, the task is as follows: The button must be connected to the corresponding pin interrupt PCINT3.Does the task mean which pins trigger the PCINT3 interrupt, then it would be possible to connect to 3 or 2 pins
Apr 21, 2023 at 13:47 comment added DrG Which board are you using? Here is a nice simple example of doing something similar - it may help roboticsbackend.com/arduino-interrupts (I should have added at least one more board to that list).
Apr 21, 2023 at 13:42 comment added Good York But pin 11 is the PCINT3 interrupt?
Apr 21, 2023 at 13:33 comment added DrG See reference.arduino.cc/reference/en/language/functions/… Note that GPIO 11 does NOT appear in the column of the table listing pins that can be used to generate interrupts (except for nano 33 IOT, Zero and the 101) - suggest you use 2 or 3. If you want an interrupt on the RISING edge, use a PULL DOWN resistor. seeedstudio.com/blog/2020/02/21/… that way pressing the button, rather than releasing the button produces the int. Finally, acknowledge that the button will bounce.
Apr 21, 2023 at 12:20 comment added Good York I tried attachInterrupt(digitalPinToInterrupt(buttonPin), buttonISR, FALLING) also does not work
Apr 21, 2023 at 12:13 comment added Abel Have you tried attachInterrupt instead? reference.arduino.cc/reference/en/language/functions/… note the use of digitalPinToInterrupt and that only certain pins on each model can be used as such. If it works, likely a bug in your PinChangeInterrupt.h or what it ties to.
Apr 21, 2023 at 12:05 comment added Good York Removed the oscilloscope from pin 11, still does not work
Apr 21, 2023 at 11:57 comment added st2000 The termination on the oscilloscope may be enough to pull down Pin 11. Consider removing the oscilloscope from Pin 11 and repeating the test. If that works, I'll create an answer with more details and things to try.
S Apr 21, 2023 at 9:44 review First questions
Apr 21, 2023 at 15:55
S Apr 21, 2023 at 9:44 history asked Good York CC BY-SA 4.0