Pages: [1]   Go Down
Author Topic: Sketch works on ATMega328 but not on ATMega2560  (Read 403 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a sketch that reads a GPS module and displays the data on a 16x2 LCD display.

When I run the sketch on a ATMega328 it runs fine and the data from the NMEA sentences get displayed, but when I run the same sketch on an ATMega2560 the display layout is correct but it is obvious that the data is not being interpreted as the displayed values are the defaults.

I have got the pull-up resistor set on the input pin in the sketch and I have tried other pins on the 2560 just in case there is a dead pin.

When I put a scope on the input pin I can see the quiescent state as being 3V0 with the Space dropping to GND when each sentence is sent from the module.  This is the same for both microcontrollers.

Short of posting the sketch to this forum somewhere, is there anything that springs to mind that I should be looking for?

TIA.
Logged

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

Quote
Short of posting the sketch to this forum somewhere, is there anything that springs to mind that I should be looking for?

The most common source of Uno Vs mega problem is for attached things using the I2C pins or the SPI pins as their location is on different pins for those boards. But if your not using either of those interface methods then no, nothing pops out at me, so post your code.

Lefty
Logged

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

Quote
Short of posting the sketch to this forum somewhere, is there anything that springs to mind that I should be looking for?

The most common source of Uno Vs mega problem is for attached things using the I2C pins or the SPI pins as their location is on different pins for those boards. But if your not using either of those interface methods then no, nothing pops out at me, so post your code.

Lefty


Correct, I am not using I2C nor SPI.  The TXD data from the module is being read on pin D2 as INPUT with the pull-up resistor set on.
My ATMega328 is built on a RBBB board; the ATMega2560 is a Cappucino.
Code in attached files...


* quopter_1.ino (1.8 KB - downloaded 10 times.)
* quopter_2.ino (2.89 KB - downloaded 10 times.)
Logged

Pages: [1]   Go Up
Jump to: