Go Down

Topic: ATMEGA644 Serial1 can't work (Read 1 time) previous topic - next topic

catchup

Dec 27, 2012, 06:05 am Last Edit: Dec 27, 2012, 07:18 am by catchup Reason: 1
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: [Select]

// 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);
}


catchup

#2
Dec 27, 2012, 06:07 am Last Edit: Dec 27, 2012, 07:19 am by catchup Reason: 1
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: [Select]

// 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);
}

Nick Gammon

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

Read this before posting a programming question


Please edit your post, select the code, and put it between [code] ... [/code] tags.

You can do that by hitting the # button above the posting area.


- Moderator

catchup

we got same result no matter serial1  pin (RXD1,TXD1) were empty  or connected to RS232 driver.

Nick Gammon

Did we? But you decided not to follow my advice about the code tags did you?

PaulS

Quote
we got same result no matter serial1  pin (RXD1,TXD1) were empty

Well, now, there's a surprise.

Quote
or connected to RS232 driver.

So, it must be a programming issue? Not hardly.

catchup

it should not be programming issue, The same codes run well on ATMEGA2560.  There should be a bug with arduino  ATMEGA644 SDK

westfw

If you have a real atmega644, and not a 644a or 644p, then I think that in fact it only has one UART!

Tom Carpenter

Yup, only the larger AtMega1284 from that series has two UARTs.
~Tom~

retrolefty


Yup, only the larger AtMega1284 from that series has two UARTs.

No the 644p does have two serial ports, the 644 just one.

Lefty


Tom Carpenter


No the 644p does have two serial ports, the 644 just one.

I was counting the 'p' ones as a seperate series, but yeah the 644p has two.

catchup, do you have the Atmega644p or the atmega644?
(note that the 'p' is not the same as 'pu', for example there are AtMega644P-PU and AtMega644-PU).
~Tom~

catchup

thanks for your help. I am using ATMEGA644 even the signature is the same as ATMEGA644A,  after changing to using ATMEGA644P, It worked.

westfw

Yes, I consider the fact that the 644 (one uart) and 644a (two uarts) have the same device signature to be a pretty big mistake on Atmel's part...   Grr.

dd4da

Take a look to the mapping if the ISR for the serial Port you wanna use. I have did some fixes in Arduino103 environment for m644,644p , 1284p to use the the serial port. The #defines of the
supportet ATMega variants are not complete in all purposes. Just extend them and add your MPU model to the right register definition.
Take a look to the compilers mapping file and compare the IRQ Vectors he mapped with the datasheet of the MPU you use.




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: [Select]

// 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);
}


Go Up