#define inter_Mega_A15 A15//pin 82 ATmega2560 PK7 PCINT23, PCIE2 pag97 NON Funziona #define inter_Mega_15 15//pin 63 ATmega2560 PJ0 PCINT9 Where can I find (on the ATmega2560 datasheet) the interrupt for "PJ0 (RXD3/PCINT9)" goes to the PCINT1 vector ( #11)? I append the source code, two weeks ago it was ok. Hello Johnwasser, bit state change interrupt on pin15 of Arduino Mega2560, now does not run. cli() // switch interrupts off while messing with their settings If (digitalRead(JoystickZM)=LOW) Ind_Joystick_Z=1 If (digitalRead(JoystickZP)=LOW) Ind_Joystick_Z=-1 If ((digitalRead(JoystickZP)=LOW) || (digitalRead(JoystickZM)=LOW) ) Serial.print(F("Ind_Joystick_Y=")) Serial.print(Ind_Joystick_Y) If (digitalRead(JoystickYM)=LOW) Ind_Joystick_Y=1 If (digitalRead(JoystickYP)=LOW) Ind_Joystick_Y=-1 If ((digitalRead(JoystickYP)=LOW) || (digitalRead(JoystickYM)=LOW) ) Serial.print(F("Ind_Joystick_X=")) //Serial.print(Ind_Joystick_X) If (digitalRead(JoystickXM)=LOW) Ind_Joystick_X=1 If (digitalRead(JoystickXP)=LOW) Ind_Joystick_X=-1 If ((digitalRead(JoystickXP)=LOW) || (digitalRead(JoystickXM)=LOW) ) if (digitalRead(Pin_FinecorsaX_F)=LOW) Serial.print(F("=>")) Serial.println("D4") PinMode(Pin_FinecorsaX_0, INPUT_PULLUP) // Pin_FinecorsaX_0 is input to which a switch is connectedĭigitalWrite(Pin_FinecorsaX_0, HIGH) // Configure internal pull-up resistorĬli() // switch interrupts off while messing with their settings Is there another mothod to associate an interrupt a these pins (pin state changes). To enable pin4, pin12 and pins A0-A5 interrupts on Arduino UNO, I have used the following method. I'll study and try your indications and information. So, hopefully this will save Marcello some time when he tries to use these things. You'll notice these pages match for the UNO board, but not for the Mega. The table below shows the available interrupt pins on various boards.īoard int.0 int.1 int.2 int.3 int.4 int.5 To get the "correct" info, where it says, So, without going through the entire other thread again, what you need to do is look at the following web page However, the other lines are where the big mess is, namelyģ PD 3 PWM T2B, Ext Int 1 PE 5 PWM T3C, INT5ġ8 PC 4 4 I2C SDA PD 3 USART1 TX, Ext Int 3ġ9 PC 5 5 I2C SCL PD 2 USART1 RX, Ext Int 2 They are referring to PCINT8, PCINT4, ie the pin change interrupts. Basically the Arduino "experts" don't seem to see the problems - or else they might actually fix them - but dumb coders like me get burned, and end up wasting an awful lot of time.įirst off, on the spreadsheet where it says I hate to say this, after the messy events of the past couple of days ,īut there are errors in that file for the Mega board, just as on the Mega board schematic and pinout diagrams.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |