Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [atmega2560]

The tag has no usage guidance.

-2
votes
0answers
23 views

I need to combine 3 different codes [on hold]

#include <Servo.h> //servo library Servo servo; int trigPin = 5; int echoPin = 6; int servoPin = 7; int led= 10; long duration, dist, average; long aver[3]; //array for ...
0
votes
1answer
4 views

Arduino Nano, Uno and Mega - XBee connection difference

I have a simple sketch working on arduino Uno and Nano sending data using an XBee. However, if I run the project on an Arduino Mega it does not work. What differences between Uno/Nano and the Mega ...
0
votes
0answers
27 views

Why is arduino Mega2560 taking so much time to recognise the pin is no longer at HIGH?

I am in my first arduino steps. I have a Mega2560R3 I wrote this code const byte D0 = 22; const byte D1 = 24; const byte D2 = 26; const byte D3 = 28; const byte D4 = 30; const byte D5 = 32; const ...
0
votes
0answers
32 views

How to use watchdog timer for the purpose of recovery from failures in Arduino ATmega2560

Here is my tool-set; Visual Studio with plugin called "Visual Micro" Flashing the HEX file using Atmel Studio. via AVRISP mkII on ATmega 2560 MCU And my simple trial code (I have also some others). ...
0
votes
1answer
35 views

Which board's bootloader is on the microcontroller?

Currently I'm doing a project that needs an Atmega2560 standalone MCU. After I burned the bootloader with this method: http://www.gammon.com.au/bootloader . I set the Board as "Arduino/Genuino Mega or ...
0
votes
1answer
42 views

Receiving junk values in Arduino serial monitor console

I want to send a character from a Zigbee transmitter to an Arduino Mega 2560. After the character is received, Arduino should send some data back to Zigbee. But Arduino is always receiving junk values ...
2
votes
1answer
66 views

Trying to run Timer1 in ATmega2560 with assembly

I have a slight problem with Timer1 in arduino (ATmega2560) while coding it in assembly. I try to run the Timer1 in CTC mode - I configure everything well in my opinion, but the TCNT1 just doesn't ...
0
votes
1answer
18 views

What are the negative PINs for on the IndustrialShield M-Duino 58 Analog

I am working as an internship on an Arduino based PLC. It is the M-Duino 58 Analog from IndustrialShields. I try to figure out how it works; Reverse Engineering. But i dont know why it has negative ...
0
votes
2answers
34 views

Read sensor data repeatedly after specified time?

I want to read sensor data using analogRead() after every 5ms. I have read other answers to similar questions but what I'm confused about is: let's say, I made a loop to read sensor data using ...
0
votes
1answer
25 views

Arduino loop over a function is always displaying 0 as final values

I trying to loop over a function in arduino to get values for 2000 times, and then divide it by 2000 to get an average offset: int16_t x_offset = 0; int16_t y_offset = 0; int16_t z_offset = 0; And ...
2
votes
1answer
102 views

Arduino Mega and gyroscope erroneous values

I have Arduino mega2560 and MPU6050. I connected to Vcc pin of the gyro to +5V on the mega, the SDA to SDA pin, SDL to SDL pin, AD0 and GND to 2 GND pins. I used this code: #include<Wire.h> ...
0
votes
0answers
101 views

Reading raw values from MPU6050 using Arduino Mega

I am trying to connect Arduino Mega with a gyroscope/accelerometer with 6DOF, using MPU6050 micro ship. While searhing online, I found lots of codes with more than 200 lines, to just read raw values ...
1
vote
1answer
67 views

Using the Arduino compiler, is it possible to use Atmega2560 interrupt pins that are unused by Mega?

Looking into the schematics for the Arduino Mega I noticed that pins PE6 and PE7 are interrupt-enabled (INT6 and INT7 respectively); however, they remain unconnected to any Arduino I/O pin. I'm ...
0
votes
0answers
53 views

Two Arduino Megas-Connecting through I2C gives wrong values

I have a problem with my Arduino. I am using two Arduino Megas connected through I2C. The master Arduino has two sensors attached to it while the slave Arduino is just supposed to collect data from ...
0
votes
1answer
24 views

attachInterrupt for mega 2560 not triggering

I recently bought a mega 2560 to toy around with as a hobby. It's pretty fun so far, but I've recently gotten stuck while trying to use attachInterrupt with a button. I'm using the CHANGE mode, and ...
1
vote
1answer
64 views

Arduino Mega Pins for SoftwareSerial (vs. AltSoftSerial)

I am currently looking at using an Arduino Mega to build a MIDI Receive box that will then pump the data over USB, but am having design issues/uncertainties with the Arduino's receiving end. I am ...
0
votes
2answers
57 views

Is an atmega 2560 board compatible with the Adafruit Trellis?

I want to build a custom midi controller for my computer, and yes, Adafruit has a mini Untz project. For my purposes, I need more analog inputs than the Leonardo, and the only other option I can find ...
0
votes
0answers
76 views

ATmega 2560 based 3d printer control board - GT2560 Rev A+

I have a question about my 3d printer control board. I may have damaged a few analog input pins, is there a way to check them, by uploading some other code than marlin firmware? Also, is it possible ...
1
vote
1answer
126 views

PROGMEM Corrupted Array

I am trying to store a large number of values into a couple of arrays using PROGMEM, but I am finding that a few of the values are read back corrupted. I am storing just 1s and 0s, but when I read ...
0
votes
0answers
196 views

How to program an SSD1322 display?

I'm new to programming. I would like to change the characters on an SSD1322 OLED display. Here are the photos. Is this possible with an Arduino Uno? Is the program of the display in the display or in ...
0
votes
0answers
133 views

How to burn the bootloader of an Arduino Mega using the AVR MKII ISCP?

I somehow fubared my Arduino Mega 2560, and it stopped responding to normal uploads. I tried using the IDE to burn the bootloader, but it gave me the same connection errors as the normal upload ...
0
votes
2answers
76 views

how can I break from this case by IRremote even if it's not finished yet?

I want to give a pause to case 0xFF02FD or at least to break from that case by entering the case 0xFFA25D even if the 1st case not finished, when I press power button wich has hexa code ( 0xFFA25D) I ...
1
vote
1answer
117 views

Confusion over Transistors for a switching circuit with an Arduino Mega 2560

Apologies if this is a stupid question asked by a noob, but I've looked around to try and find the answer and just can't work it out. Basically, I'm making a project on thingiverse (Glitch's MK2 ...
0
votes
2answers
90 views

Meaning of part number suffix on top of atmega2560 chip

I have been working on creating a stand alone atmega2560 arduino. When trying to program it with a serial adapter using the rx and tx pins nothing was happening. After a lot of debugging I found the ...
0
votes
2answers
233 views

ATmega 2560 with Arduino bootloader running issue

I have designed a board based on an ATmega2560 chip and I burned the bootloader by following this tutorial. Now I am able to load Blinky and other programs using an FTDI cable. But the issue I am ...
2
votes
3answers
122 views

Conditional randomization gets stuck

First-time poster here... I have the following code to randomize note values and store them in an array loop1[i], where i is a specific step in the loop: nextNote = random(-2, 3); note = note + ...
0
votes
1answer
398 views

Uploading code to Mega 2560 is stuck

I'm trying to upload code from a Mac (online Arduino editor) onto an Arduino Mega2560, to connect a motor to pin 52 and Ground to get it to move. But at the top it says busy (like it does when it ...
0
votes
0answers
1k views

Disable auto-reset Mega 2560 on serial monitor open using 60 ohm resistor

I tried preventing my Arduino Mega 2560 from restarting every time I open the serial monitor. This link didn't work for me at all. I tried connecting the RESET pin to 3.3v pin via a 60 ohm resistor ...
0
votes
2answers
348 views

avrdude flash issues

I want to burn a hex file to a custom ATmega2560 board. I use this USBasp programmer for flashing (firmware version 1.01) on my Mac OS X 10.12.6 system. All hex files are compiled with avr-gcc (GCC) 4....
1
vote
2answers
152 views

Trying to determine the phase difference between two square signals

I have been looking for the phase difference between two square signals and this is the code: #include <avr/io.h> #include <avr/interrupt.h> void setup() { //Serial.begin(9600); ...
0
votes
2answers
107 views

Why Arduino Mega 2560 throw error when i try to upload example

I'm try to connect my Arduino Mega 2560 to PC, but I think it's not easy as I imagine. I spent a lot's of time to install USB driver. Here is a screenshot: When I try to upload blink example, Arduino ...
0
votes
2answers
274 views

Burn Bootloader to Chinese Arduino 2560 with AVR ISP programmer

I got my hands on one of these ISP programmer for Atmel AVR microcontroller in USB stick design: Then I selected Progammer > AVR ISP and clicked on Burn Bootloader but it says stk500_recv(): ...
2
votes
2answers
817 views

Arduino MEGA2560 Standalone

I had an Arduino UNO (ATmega168) standalone working, but I need more pins, and I decided to use the ATmega2560, I was searching for some schematics, and none of them shown an ATmega2560 standalone, ...
1
vote
0answers
30 views

Erasing all flash on boards with over 64kb of program memory

I'm using a Mega2560 board. My project needs to store some large constant data. To preserve the first 64kb flash chunk, I write these data on addresses beyond this limit. But there is either an ...
3
votes
2answers
907 views

Arduino crashing during serial print for no obvious reason

I've written some Arduino Code which kept crashing and i couldn't find out why. Then i reduced the code as much as i could in order to see the problem. The reduced code currently doesn't do anything ...
1
vote
1answer
92 views

Controllino Debugging

Its a well known fact, that you can debug your arduino board with the help of an Atmel Ice. However, you might know the Controllino which is an arduino compatible device. It has an ATmega2560 on it. ...
1
vote
1answer
3k views

Rotary encoder I2C LCD menu

I am trying to make a menu for a monitoring/control system. I am not sure how to make this without interrupting my current code which needs to be monitoring my system at all times to shut off if it ...
0
votes
2answers
223 views

Read and store data with the usb

Hi i am new to Arduino and I want to know if it is possible to read the data from a sensor that it is connected to the Arduino, I am using the Arduino mega 2560, which is already working, as I have a ...
0
votes
2answers
133 views

mega2560- Interrupts reading digital input

Hi I am very new to Arduino, with very little programming experience. I am using mega 2560 and trying to understand how interrupt works. I have a code written, it is very similar as the example ...
2
votes
2answers
746 views

Error while boot loading Atmega 2560 using Arduino Mega 2560

I have developed custom board using Atmega 2560. I am doing boot loading process using the process of migrate from an Arduino board to a standalone microcontroller. I have followed this steps... 1) ...
3
votes
1answer
280 views

Bootloader and Boards Definition for Atmega2560V-8AU at 8 MHz / 3.3v

I am working on a home made project,where i am using Atmega2560V-8AU (note the suffix, this part has an 8 MHz maximum clock rate) as my main controller, supplying 3.3V to this chip. I want this ...
0
votes
0answers
49 views

I want to preserve existing arduino sketch before I try a new one [duplicate]

I'm a complete newbie to Arduino. And to 3D printing. I have a PRUSA I3 clone that has been assembled, but not calibrated or tested. I've determined that I need to change the value of some constants ...
0
votes
1answer
165 views

Atmega2560 USART UDR r/w conflict possible?

I'm having a really weird issue with my project right now. I have an Atmega2560 using hardware serial, and the software on the other side is doing full duplex read/write at 500kbps. If I change it to ...
0
votes
3answers
494 views

2.4Mhz clock for 3-wire SPI using Arduino Mega 2560

I am trying to develop an Arduino sketch for ADS8320 ADC IC, which is 3-wire SPI. I need a 2.4MHz serial clock for the SPI interface. I tried the code below, but I don't know how to generate clock ...
3
votes
2answers
183 views

Is there an ICRn CTC mode interrupt vector?

I can use the CTC waveform generation mode to loop to OCRnA and trigger the corresponding TIMER1_COMPA_vect interrupt. // CTC mode TCCR1A &= ~(1 << WGM10); TCCR1A &= ~(1 << WGM11);...
3
votes
4answers
1k views

If else statement not mutually exclusive?

When I'm running some test on my encoder motors using the following provided code by Makeblock, it appears that the if..else.. statement is not mutually exclusive ie. I can control Encoder_1 and ...
0
votes
1answer
55 views

Value appears to change sign suddenly

When slot == SLOT_1 is true, speed_value is positive but when slot == SLOT_2 is true, speed_value becomes negative. I printed the value of speed_value immediately after the statement speed_value = -...
1
vote
2answers
328 views

7 segment displays arduino mega 2560

I'm trying to use an Arduino Mega 2560 to use 7-segment displays, 6 displays... I use 3 CD4543B to pilot the 6 displays. It works very well for 4 displays as you can see in this video. But when I ...
0
votes
1answer
54 views

Get when a button close the circuit

That seems to be a bit stupid to myself but I can't figure out to get to know when my button is pushed (closed) or released (open). You must know that this not just a simple push button. Actually it ...
2
votes
4answers
656 views

Will an ATmega2560 board be faster than a Uno for hard real-time data logging?

I am designing a hard real-time data logger. The Uno is a bit marginal in processing speed. a) Would it be faster if I changed to an ATmega2560? b) On the datasheet, ATMEGA2560 has 135 instructions; ...