Offline
Newbie
Karma: 0
Posts: 7
|
 |
« 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? // 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
Faraday Member
Karma: 33
Posts: 3617
@ssh0le
|
 |
« Reply #1 on: December 27, 2012, 12:06:55 am » |
what is serial 1 connected to?
|
|
|
|
|
Logged
|
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #2 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? // 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
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #3 on: December 27, 2012, 12:14:15 am » |
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 questionPlease 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
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #4 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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #5 on: December 27, 2012, 01:09:53 am » |
Did we? But you decided not to follow my advice about the code tags did you?
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #6 on: December 27, 2012, 07:13:52 am » |
we got same result no matter serial1 pin (RXD1,TXD1) were empty Well, now, there's a surprise. or connected to RS232 driver. So, it must be a programming issue? Not hardly.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #7 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
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Online
Faraday Member
Karma: 78
Posts: 5453
Strongly opinionated, but not official!
|
 |
« Reply #8 on: December 28, 2012, 06:22:50 am » |
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
God Member
Karma: 35
Posts: 980
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #9 on: December 28, 2012, 06:48:20 am » |
Yup, only the larger AtMega1284 from that series has two UARTs.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15310
Measurement changes behavior
|
 |
« Reply #10 on: December 28, 2012, 11:38:48 am » |
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
God Member
Karma: 35
Posts: 980
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #11 on: December 28, 2012, 01:20:19 pm » |
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 AtMega644 P-PU and AtMega644-PU).
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #12 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.
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Online
Faraday Member
Karma: 78
Posts: 5453
Strongly opinionated, but not official!
|
 |
« Reply #13 on: December 29, 2012, 12:20:28 am » |
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
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #14 on: December 29, 2012, 08:36:25 am » |
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? // 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
|
|
|
|
|
|