Questions tagged [atmega2560]

Low-power 8-bit AVR microcontroller with 256kB flash.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
12 views

2 sensors (metal and capacitivie) 2 servo motors [closed]

I'm trying to create a program. heres my code: #include <Servo.h> Servo tap_servo1; // 4 metal // 5 capacitive int sensor_pin1 = 4; int tap_servo_pin1 = 11; int val1; Servo tap_servo2; int ...
John Mark Bacolod Alumia's user avatar
0 votes
1 answer
128 views

What is the max output rating of the pins on the Arduino Mega?

I have conflicting information on the max output rating for the Arduino Mega. Some say 200 mA and others say 800 mA like the Uno board. I am running 8 model railroad signal devices that have (3) 3mm ...
Robert B's user avatar
2 votes
1 answer
76 views

ATMEGA2560 died inside a arcade game circuit

I am building arcade game with 10 player buttons (5 for each player) and one start button. All buttons have build in LED inside. Player buttons has LED for 12V and start button has led for 5V. I am ...
andz's user avatar
  • 123
1 vote
0 answers
520 views

LiquidCrystal_I2C, lcd.begin() causes runtime error on Arduino Mega2560

I have tested the library and LCD with simple script and everything worked fine. Now I am trying to add the LCD functionality to my working program but the code reaches the lcd.begin(); function it ...
Jesus Soto 's user avatar
1 vote
0 answers
64 views

Running a 5V, 4pin pwm fan with Mega2560

I have a Mega2560 and would like to use it to power a single fan and display. The fan is a 5V fan that draws 260mA and I can't find power specs for this display. I can't find a clear answer for how ...
David Carpenter's user avatar
2 votes
1 answer
204 views

GY-521 output and degrees

I am trying to make an observatory through 2 GY-521 gyroscopes and using the outputs I have to make a motor move, but I have a problem. When I move one of the two gyroscopes the outputs change, but ...
Liam Ferretti's user avatar
0 votes
1 answer
580 views

Avrdude verification error when uploading to Arduino Mega 2560

I have been getting the error avrdude: verification error, first mismatch at byte 0x036c 0xb8 != 0xf8 avrdude: verification error; content mismatch avrdude done. Thank you. When trying to upload the ...
Banjoof's user avatar
  • 13
-1 votes
1 answer
144 views

Arduino + Solar Charger Shield V2.2: Battery and Solar panels selection [closed]

first of all I would like to apologize for the, probably very basic and stupid questions for you, but I'm not an electronic expert.. I'm implementing my project using an Arduino Mega 2560 (I need more ...
Safari's user avatar
  • 101
2 votes
1 answer
248 views

Atmega2560 PWM on PH4

I am trying to convert the following code to output to pin 7 (PH4, OC4B) on an Arduino Mega. The code outputs to pin 6. This code is from a GitHub for the GRBL on the Mega "https://github.com/...
Mr.Spriggs's user avatar
2 votes
0 answers
354 views

External Interrupt and Input Capture pin | Arduino MEGA

I have a code for finding the rpm of one system calling here as engine , the engine have a hall sensor output and I have tried the following Code #define SERVO_MIN 2000 #define SERVO_MAX 4000 struct ...
Lawliet's user avatar
  • 183
0 votes
1 answer
202 views

Softwareserial send wrong values

I'm trying to use softwareserial to exchange datas with a sensor. After some tries without any answer from the sensor, I checked the arduino TX with my scope and what I've seen is not what I've sended....
Prof_Sims's user avatar
3 votes
1 answer
203 views

False interrupt triggering Arduino Mega

I am using Arduino mega with 4 interrupts to find the rotation speed of 4 motors . For this I have used INT2, INT3, INT4, INT5 and the code for the same is given below struct Pulse { uint32_t ...
Lawliet's user avatar
  • 183
1 vote
0 answers
68 views

Program a mega2560 from a different Serial port

I want to be able to use my HC-05, currently on Serial3 to download code to on my 2560 from a connected android tablet. I'm currently running MegaCore, which has optiboot on it. I've looked for ...
Thom's user avatar
  • 173
1 vote
1 answer
931 views

Mega2560 programming megacore avrdude: Device signature = 0x000000

I have two sunfounder mega2560s. I am using one as an ISP programmer and the other is my target. The programmer has the original bootloader on it. I have placed the ArduinoISP sketch on my programmer ...
Thom's user avatar
  • 173
2 votes
1 answer
327 views

Loading code to a mega 2560

As part of my application, I need to be able to update the code on my mega 2560 in the field with a download from the internet. I have found this code in the AT Mega 2560 data sheet ;-the routine ...
Thom's user avatar
  • 173
1 vote
0 answers
180 views

ShieldBuddy TC275 as a drop-in replacement for MEGA 2560?

I have an autonomous wall-following robot based on a Mega2560, that is just about maxed out in terms of memory usage and speed. I'm starting to have weird intermittent failures with previously ...
starship15's user avatar
1 vote
1 answer
193 views

How do I temporarily disable TIMER5 Interrupts?

I have a fairly complex autonomous robot program that is getting into trouble when executing controlled turns. I constructed a very small program to test just the turns, and this works fine. When I ...
starship15's user avatar
1 vote
0 answers
91 views

Program only works with Serial.begin

My program only works when the following line is added: Serial.begin(9600); When this is disabled/removed the program no longer switches output state regular I'm using an Arduino Mega 2560. When the ...
Magnus's user avatar
  • 31
1 vote
0 answers
288 views

sim808 init error when trying to use DFRobot to get gps

I'm using "mega 2650 pro" Arduino with SIM808 BK-808 V-3.1 and I connect the vcc for the sim808 to 5volt pin in the arduino, and the arduino connected with laptop usb. and I add a sim to the ...
user75899's user avatar
1 vote
2 answers
391 views

Where is the digitalPinToInterrupt macro defined

I am new to Arduino, and it's confusing to me how you can just write code in the IDE and use functions or macros such as #define ISR() in the avr-libc library without having to include the header file ...
Name's user avatar
  • 111
1 vote
1 answer
390 views

ISR for timer on Arduino MEGA gets called only once

I am trying to write an Arduino code to blink LED using timer 4 on Arduino MEGA (atmega2560). I resetted the timer registers, and entered all the necessary values to bring to 16MHz to 1Hz (rescalar = ...
Ashwathama's user avatar
1 vote
0 answers
155 views

it just gets too hot . any way of cooling it?

there i just got started with the arduino mega2560 . i tried 8x8 matrix tube and after ~30secs i found the atmega2560 a bit hot that i can melt a small amount wax on it ! is there any sort of heatsink ...
Raj's user avatar
  • 41
1 vote
0 answers
127 views

Arduino mega PinChangeInterrupt with 16 bit timer

With reference to this question ::I have written a program by using 16-bit timer, The program is as follows . volatile uint32_t ovfCount = 0; struct Pulse { uint32_t last_toggle; uint32_t width; ...
Lawliet's user avatar
  • 183
1 vote
0 answers
267 views

Fail to burn bootloader into standalone atmega2560

I am making a project where I use standalone atmega2560. I used arduino mega schematic to put all necessary components so atmega2560 would be working. I tried to burn bootloader into it using arduino ...
Paulius r's user avatar
1 vote
0 answers
58 views

Upload of software working unreliably

I've got a new Keyestudio ATmega2560 (compatible with Arduino Mega 2560) board and was trying to upload a simple sketch. I noticed that both the Arduino IDE and PlatformIO were unable to do so, they ...
Yanick Salzmann's user avatar
1 vote
1 answer
2k views

Programming custom Arduino Mega with Arduino Uno

I'm making a custom board with AtMega2560-16AU as MCU and CH340G as bootloader (schematic can be seen in the picture). I have printed the custom PCB and soldered everything in place now I want to ...
Exclose's user avatar
  • 41
2 votes
1 answer
47 views

Testing 433MHz Transmitter

Folks, There is a document named "Complete Guide for RF 433MHz Transmitter.pdf" available in the GitHub. There is a a connection diagram showing the Data pin of the Transmitter connected to ...
Ranjith's user avatar
  • 61
1 vote
1 answer
247 views

Problems in calculating and printing long unsigned integers

I have this code which provides an erroneous unsigned long number. CODE: char buff[100]; int unsigned long bytes; bytes = 48 * 70 * 144; sprintf(buff,"%lu bytes\n", bytes); BTPort.print(...
Willem Ferguson's user avatar
1 vote
1 answer
360 views

How to identify pinout of ATmega 2560 derivative board?

My 3d printer, Creality Ender 4, has an ATmega 2560 chip based card, and I need to identify the number associated with a particular Pin. I read, on the official Arduino website, a simple tutorial in ...
David's user avatar
  • 11
6 votes
1 answer
155 views

Adafruit_LEDBackpack library interfering with analog input reading

I'm trying to do something I think would be simple. I'd like to read the input of a electret microphone board and update the Adafruit 24-segment LED Bar Graph. I got each individual item working ...
OneCleverMonkey's user avatar
0 votes
1 answer
444 views

Can Only Upload Arduino Sketch Once to Custom Mega2560 Board

I created a custom Arduino based off the Mega2560 R3. It uses the ATMega16U2 uC as the USB interface between ATMega2560 uC and the PC. The bootloader on the 2560 is uploaded by using an Arduino Micro ...
Agriculex's user avatar
  • 139
1 vote
0 answers
514 views

CC2541 Bluetooth AT Commands not work for any Commands sended from Serial

i bought the HM 10 Bluetooth controller (CC2541), i got connect on this device through Serial Bluetooth Terminal (Android App) with Serial BLE menu this method not requires any pass and "...
luke cross's user avatar
0 votes
1 answer
927 views

Get more PCINT capable pins on Mega 2560

I'm building kinda "ball game" for a total of 6 players based on these per-player specs: 1 stepper motor with 4 pins 2 end stops (start & finish) per motor 1 finish LED 3 holes to score,...
Yoda's user avatar
  • 103
0 votes
1 answer
486 views

SPI transactions in Arduino

I have a task where I should do SPI transactions in interrupt mode. Means I have to handle data in IRQ handler (both for tx and rx bytes). How should I approach? I have a arduino board (2560) and a ...
ProPlayerMaxUltra's user avatar
1 vote
2 answers
3k views

Using HC-08 bluetooth module with arduino

I have an arduino mega 2560 and a recently purchased HC-08 module and the connection is as the following: Arduino | HC-08 VCC - VCC GND - GND 14TX3 - TXD 15TX3 - RXD When I power up the arduino it ...
Wool's user avatar
  • 21
2 votes
1 answer
235 views

Why is their need of response time needed in esp8266 AT commands?

I am writing an AT commands firmware for esp8266 via connecting it to atmega2560. Now the question is how will I come to know the response time for AT commands for writing its firmware to read the ...
Kunal's user avatar
  • 81
1 vote
0 answers
266 views

Atmega 2560 IR receiver returning random values with using NeoPixels

I am using atmega 2560 to control 590 LED lights with NeoPixels library. I also got an IR receiver connected so I could control the LED properties and it does work but only when the LEDs are not ...
user1031204's user avatar
1 vote
1 answer
147 views

Strange Arduino Serial Behavior

I have a quirky question today. I have an Arduino MEGA 2560 with a very simple setup. It's connected to my pc over usb, and has one device connected on its onboard TX/RX2 port group. Whenever I open ...
Interrobang's user avatar
1 vote
2 answers
587 views

Am not able to call C++ function pointers from inline assembly

Due to some curiosity, I was trying to use some assembly with my Arduino MEGA 2560. I am not able to invoke a function from a c++ function pointer array. When I uncomment the call function, func_a ...
darkspine's user avatar
  • 113
0 votes
2 answers
34 views

DHT11 and Liquidcrystal setting cursor issue

lcd_key = read_LCD_buttons(); float temp = dht.readTemperature(); delay(1000); // lcd.setCursor(0,0); if(temp < 0) { lcd.print(temp); } if(temp >= 0.00 || temp <= 5.00) { lcd....
Dennis's user avatar
  • 13
1 vote
0 answers
556 views

I am trying to rewrite an RFID with a MEGA2560 and a RFID-RC522

I have been trying to rewrite an RFID tag so it is the same as my other one. I have code that will read both separately but I cannot find any already written for the MEGA2560 that will work for me. ...
cameron cain-jones's user avatar
2 votes
1 answer
113 views

Servo motor troubles

The image is as clear as I can make it. Here are the basics of my problem. My program is meant to make 6 red LED lights in sequence fade in and out, toggle 5 white LED's on and off with a button, and ...
Koen Zimmerman's user avatar
2 votes
1 answer
116 views

Activating a defined macro in a class from main.cpp

Sorry if this question been asked. I'm trying to activate certain function in a class using a macro defined in the class from main.cpp. I'm using jrowberg MPU6050 library if that matters. main.cpp #...
zaraku27's user avatar
0 votes
1 answer
72 views

Passing struct from main.cpp to a class

Sorry if this question been posted but I couldn't find the one that matches my issue. I couldn't pass my struct values from the main file to a class. Any ideas? I got this: error: no matching ...
zaraku27's user avatar
1 vote
0 answers
214 views

Problem with I2C

I trying to make a project to write and i2c display from a renault megane vehicle. There is many people showing it but there is no code that i can use. So i buy a cheap analyzer and i can clearly see ...
Javilico's user avatar
1 vote
0 answers
130 views

Using SMS to receive password, then to choose whether to turn the relay on or off

I'm trying to use SMS messages to turn a relay on/off but before doing that i need to have a password system before allowing the user to turn the relay on/off. Basically, you have to send the password ...
YMSmash's user avatar
  • 23
0 votes
1 answer
189 views

How can I make a Parallax Servomotor move a water tap correctly and prevent from vibrations?

I am using Arduino Mega 2560 I have built an structure with plastic 3D pieces to move this water tap.: I am using the "Servomotor Parallax Inc 140 mA, 4 6 V" to rotate the tap: Some more images to ...
ChesuCR's user avatar
  • 105
2 votes
2 answers
228 views

Arduino Uno lag in simple loop

I have a simple Arduino sketch which I have been playing with on my Uno. The idea is simple, the user turns a potentiate (pin A2), when they pass a certain threshold a LED is turned on (pin 7). Here ...
Hoppy's user avatar
  • 159
0 votes
2 answers
197 views

Is possible use Macro F() with Integer and Other types of variable?

i have a sketch that is using very memory RAM of my Atmega2560 (is a giant project), and i need use various "println" because i have a TFT screen and i need to show data on the screen to user see. So, ...
luke cross's user avatar
1 vote
1 answer
224 views

Will bootloader communicate via TX0 / RX0

I'm fairly new to Arduino programming but have a good deal of experience with low-level programming early processors, having originally cut my teeth on Z80, 8088, etc. I'm looking at developing a ...
Davidas's user avatar
  • 21