Questions tagged [arduino-mega]

A microcontroller board based on the ATmega2560 or 1280 chip. Use this tag for questions specifically regarding the Mega, and not just general Arduino usage.

The Arduino Mega is a board based on the ATmega2560 or 1280 chip.

Use this tag for questions specifically regarding the Mega, and not just general Arduino usage. This applies to both versions of this board.


Arduino Mega 2560:

From official Arduino page:

Microcontroller ATmega2560

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V

Digital I/O Pins 54 (of which 15 provide PWM output)

Analog Input Pins 16

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 256 KB of which 8 KB used by bootloader

SRAM 8 KB

EEPROM 4 KB

Clock Speed 16 MHz


Arduino Mega 1280:

From official Arduino page:

Microcontroller ATmega1280

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V

Digital I/O Pins 54 (of which 15 provide PWM output)

Analog Input Pins 16

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 128 KB of which 4 KB used by bootloader

SRAM 8 KB

EEPROM 4 KB

Clock Speed 16 MHz

1822 questions
71
votes
12 answers

How do I split an incoming string?

I am sending a list of servo positions via the serial connection to the arduino in the following format 1:90&2:80&3:180 Which would be parsed as: servoId : Position & servoId : Position & servoId : Position How would I split these values up, and…
ValrikRobot
  • 843
  • 2
  • 8
  • 6
67
votes
2 answers

How do you use SPI on an Arduino?

With reference to the Arduino Uno, Mega2560, Leonardo and similar boards: How does SPI work? How fast is SPI? How do I connect between a master and a slave? How do I make an SPI slave? Please note: This is intended as a reference question.
Nick Gammon
  • 38,901
  • 13
  • 69
  • 125
29
votes
8 answers

Are global variables evil in Arduino?

I'm relatively new at programming and many of the coding best practices I'm reading effectively state that there are very few good reasons to use a global variable (or that the best code has no globals at all). I've done my best to keep this in…
ATE-ENGE
  • 941
  • 3
  • 19
  • 32
29
votes
8 answers

How can I get a unique ID for all my Arduino boards?

Once you have uploaded a sketch to one of your Arduino boards, it is hard to know exactly what source code led to that sketch. Indeed, you may change the source code of your sketch on your PC without updating it (in binary format) to your board. I…
jfpoilpret
  • 9,162
  • 7
  • 38
  • 54
17
votes
1 answer

Convert int to char[]

I'm looking to convert an int value to a char array. currently I've found the following will return [number] int num = [number] str = String(num); str.toCharArray(cstr,16); Serial.println(cstr); However, per Majenko's The Evils of Arduino Strings I…
ATE-ENGE
  • 941
  • 3
  • 19
  • 32
15
votes
2 answers

What are the fundemental differences of different Bluetooth modules for beginners?

I'm a beginner to microcontrollers and electronics, albeit not really to computers and programming. Starting out with the Arduino, I came to a point whereby I'm really interested in getting my prototype to talk to a mobile device or a computer to…
Phil
  • 435
  • 2
  • 4
  • 12
13
votes
3 answers

Arduino Mega timeout communication with programmer error

I have an Arduino Mega 2560 and it was working fine until about lunch time when I started getting this error: avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer I know it isn't the code…
bladepanthera
  • 376
  • 2
  • 3
  • 14
11
votes
2 answers

3.3V, 5V and 9V pins on Arduino

On my Arduino Uno R3 and Arduino Mega R3, there are 5V and 3.3V pins. However on this page Introduction to the Arduino Board, there is a 5V and 9V pin but no 3.3V pin. The page at Arduino: What Adapter? also mentions a 9V pin. Why is there a…
Nyxynyx
  • 1,419
  • 4
  • 23
  • 25
11
votes
4 answers

What is the cheapest way to add wifi to Arduino?

I am trying to find some sort of wifi adapter for Arduino, it needs to be as small as possible (not a shield) and as cheap as possible. So far I can only seem to find shields that cost about £10+ but I figured that if you can get a replacement wifi…
connersz
  • 266
  • 1
  • 5
  • 13
10
votes
1 answer

Setting timer3 in CTC mode - conflict with servo library

I would like to set up a timer in order to call a function 800 times per second. I'm using the Arduino Mega and Timer3 with a prescaler of 1024. To choose the prescaler factor I've considered the following steps: CPU freq: 16MHz Timer resolution:…
UserK
  • 559
  • 1
  • 11
  • 24
10
votes
1 answer

Reading several rotary encoders

Have an upcoming project where user input will be based on spinning a large cog and I have several UNOs available Since rotary encoders need two pins, only a Mega would be able to handle the 7-8 encoders needed. Unless theres a better method of…
Andrew Lazarus
  • 243
  • 1
  • 2
  • 7
10
votes
5 answers

Can I make delayMicroseconds more accurate?

I'm trying to bit bang DMX data and that requires 4us pulses. Not having much luck with the results I'm checking to see how good the Arduino is at delaying... Seems to be pretty terrible at it. Here's a quick little test I did: unsigned long…
bwoogie
  • 203
  • 2
  • 9
10
votes
4 answers

How to interconnect multiple Arduinos with a Rpi to control home-lights/switches

While planning the lightning infrastructure (wall-switches and lights) of my new home (it's still under-construction) I choosed to go through the "automated route" way and due to my background (I'm an "old" system/network administrator with…
Damiano Verzulli
  • 454
  • 6
  • 18
10
votes
4 answers

2.4" TFT LCD Shield isn't working on Arduino Mega

Even on ebay's website it is mentioned that I can't use 2.4" TFT LCD Shield display on attach to Arduino Mega. The problem is that I bought this shield by mistake. I want to put this shield onto Arduino Mega 2560. Is there a way to combine Mega and…
Bay
  • 303
  • 5
  • 8
  • 20
9
votes
2 answers

What is the maximum wire length for serial communication between two Arduinos?

I am building a project in which two Arduinos will be linked by three wires: TX an RX for serial communication and a common GND. What would be the maximum length of the wires here before communication gets affected? I am using an Arduino Mega R3 on…
hobie
  • 487
  • 2
  • 5
  • 12
1
2 3
99 100