Show Posts
Pages: [1]
1  Using Arduino / Microcontrollers / Re: Interrupt 2 did't work on ATMEGA644 on: February 05, 2013, 10:02:01 am
I finally found there already got solution. It worked after changing  WInterrupts.c  &   wiring_private.h

Issue 879:   detachInterrupt() support missing for INT2, INT2 missing for ATmega644

http://code.google.com/p/arduino/issues/detail?id=879
2  Using Arduino / Microcontrollers / Interrupt 2 did't work on ATMEGA644 on: February 05, 2013, 06:57:32 am
 is there anybody make Interrupt 2 working on ATMEGA644?  my following code can't work, I am using  sanguino V1.0
Code:
#include <avr/sleep.h>
#include <avr/power.h>

int counter=0;
static volatile int interrupt_0=0;
static volatile int interrupt_1=0;
static volatile int interrupt_2=0;

/***************************************************/
void pin0Interrupt(void)
{
  interrupt_0=1;
}

void pin1Interrupt(void)
{
  interrupt_1=1;
}

void pin2Interrupt(void)
{
  interrupt_2=1;
}

void setup()
{
  Serial.begin(9600);
  //pinMode(2, INPUT);
   
  attachInterrupt(0, pin0Interrupt, CHANGE); 
  attachInterrupt(1, pin1Interrupt, CHANGE);
  attachInterrupt(2, pin2Interrupt, CHANGE);

   
  Serial.println("Waiting for Interrupt 0,1,2");
}

void loop()
{
  delay(1000);
  /*
  if ((counter %5 )==0)
  {
    Serial.print(digitalRead(0));
    Serial.print(",");
    Serial.print(digitalRead(1));
    Serial.print(",");
    Serial.println(digitalRead(2));
  }
  */
  if (interrupt_0)
  {
    interrupt_0=0;
     Serial.println("interrupt_0...");
  }
   if (interrupt_1)
  {
    interrupt_1=0;
     Serial.println("interrupt_1...");
  }
   if (interrupt_2)
  {
    interrupt_2=0;
     Serial.println("interrupt_2...");
  }
  counter++;
}
3  Using Arduino / Programming Questions / Re: ATMEGA644 Serial1 can't work on: December 28, 2012, 08:37:02 pm
thanks for your help. I am using ATMEGA644 even the signature is the same as ATMEGA644A,  after changing to using ATMEGA644P, It worked.
4  Using Arduino / Programming Questions / Re: ATMEGA644 Serial1 can't work on: December 27, 2012, 08:20:31 pm
it should not be programming issue, The same codes run well on ATMEGA2560.  There should be a bug with arduino  ATMEGA644 SDK
5  Using Arduino / Programming Questions / Re: ATMEGA644 Serial1 can't work on: December 27, 2012, 12:40:31 am
we got same result no matter serial1  pin (RXD1,TXD1) were empty  or connected to RS232 driver.
6  Using Arduino / Programming Questions / ATMEGA644 Serial1 can't work on: December 27, 2012, 12:07:39 am
Hi All,
I am using atmega644 with  sanguino 1.01 , we met a problem when testing serial1. atmega644  would halt  after calling  "Serial1.println" several times  and  there also did't have anything output on USART1.  anyone can help us?

Code:

// the setup routine runs once when you press reset:
void setup() {                
  Serial.begin(9600);
  Serial.println("Starting...");
  Serial1.begin(9600);
  Serial1.println("Serial1 Starting...");
 
  
}

void loop() {

   Serial.println("loop");
   Serial1.println("loop1");
   delay(1000);
}
7  Using Arduino / Programming Questions / ATMEGA644 Serial1 can't work on: December 27, 2012, 12:05:40 am
Hi All,
I am using atmega644 with  sanguino 1.01 , we met a problem when testing serial1. atmega644  would halt  after calling  "Serial1.println" several times  and  there also did't have anything output on USART1.  anyone can help us?

Code:

// the setup routine runs once when you press reset:
void setup() {                
  Serial.begin(9600);
  Serial.println("Starting...");
  Serial1.begin(9600);
  Serial1.println("Serial1 Starting...");
 
  
}

void loop() {

   Serial.println("loop");
   Serial1.println("loop1");
   delay(1000);
}
Pages: [1]