Pages: [1]   Go Down
Author Topic: ATMEGA644 Serial1 can't work  (Read 1095 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
}
« Last Edit: December 27, 2012, 01:18:54 am by catchup » Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what is serial 1 connected to?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
}
« Last Edit: December 27, 2012, 01:19:27 am by catchup » Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19367
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19367
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 654
Posts: 50949
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6806
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1730
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

~Tom~

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17308
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yup, only the larger AtMega1284 from that series has two UARTs.
No the 644p does have two serial ports, the 644 just one.

Lefty

Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1730
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

~Tom~

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6806
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

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

Logged

Pages: [1]   Go Up
Jump to: