Questions tagged [atmega2560]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

How i can separate integer number in 3 “houses”? Hundred, Ten and Unity [migrated]

I have, for example, a variable int number = 300; And i need modify "number" by "number", i wonder if i need separate in 3 variables for hundred, ten, unity or if there a method for divide that ...
0
votes
2answers
27 views

what will be the sampling frequecy of my arduino Mega 2560 code. How would I calculate it?

void setup() { // initialize the serial communication: Serial.begin(9600); pinMode(10, INPUT); // Setup for leads off detection LO + pinMode(11, INPUT); // Setup for leads off ...
0
votes
1answer
44 views

ADC register always returning high

Regardless of whatever voltage at A0, the software is always returning high (1023) volatile unsigned char* ADmux = (unsigned char*) 0x7C; volatile unsigned char* ADCSRa = (unsigned char*) 0x7A; ...
0
votes
1answer
55 views

C++ State Machine / Wpmf-convesion

I'm quite a newbie using C ++. I am trying to implement in C ++, the state machine described in this link for C language: https://barrgroup.com/Embedded-Systems/How-To/Coding-State-Machines. I have ...
0
votes
0answers
57 views

Arduino code does not function when relays are powered

I have a mega arduino, which is supposed to to power 4 relays using 4 touch sensors TTP 223, the relays are 5V coil and 220V. the arduino is powered by a 5 V adapter "mobile phone charger" and it ...
0
votes
0answers
17 views

An Error while uploading the sketch [duplicate]

I am getting the error, unable to fix it. I have Arduino mega2560 board which is showing the error. and also When connected both the LED's are continuously in ON. But it is showing in device manager ...
0
votes
1answer
34 views

Floating power supply for Arduino - Is it still connected to the USB ground?

I am trying to power my Arduino Mega 2560 from a benchtop power supply. I plan to essentially feed in a 9V supply directly on the Vin pin and connect the GND pin to the floating ground pin on the ...
1
vote
0answers
22 views

Advice needed for powering Multiple HX711 with Arduino Mega

I have a project where I need to use multiple load cells (6-8), with individual HX711 for each load cell, which need to be powered simultaneously. I am not sure if I can power all the HX711 with 5V ...
2
votes
1answer
122 views

I2C communication between arduino and raspberry pi breaks under stress for unclear reasons. Why?

I am having a behavior I cannot explain while using arduino mega as a I2C slave for a raspberry pi master. I am showing here an idealised program that shows the issue. I experience pretty much the ...
0
votes
1answer
36 views

Concern myself with current draw from digital pins used as INPUT with internal pullups?

My project is using a genuine Arduino Mega 2560, probably 3-4 yrs old since purchased (I don't see any revision numbers on the PCB). It's being used to read a lot of switches, buttons and drive some ...
1
vote
1answer
51 views

How to count the number of rising edges on DS3231 rtc?

I am using a DS3231 rtc and I would like to get millisecond accuracy from it so I decided to use the 32kHz generated clock from it. I wrote a code that would count the rising edges or falling edges ...
2
votes
0answers
68 views

How to wake up Arduino with an rtc?

I am doing a data logger with an Arduino Mega2560 and I want to use a code to make it sleep when no measure is needed and wake it up with an RTC when time comes. The reason I want this is because I ...
0
votes
1answer
33 views

Why is Serial Print causing different behaviour based on where its located

Im trying to test out these two motors I have where I need to call a function from the loop. I only want to call this function once so I made a quick little if statement to have the program only run ...
1
vote
1answer
63 views

Set PWM by period? And have it variable?

In this other stack QA I'm asking about generating a pulse signal with a period ranging from 63 ms to 6.5 ms. There is a popular PWM library however it doesn't compile and also since 63 ...
0
votes
0answers
112 views

OneWire with DS18B20 digital sensor only works on the I2C (20 and 21) pins of my Mega?

I am using an Arduino Mega to read a DS18B20 temperature sensor using the OneWire library in the code below which I got here: #include <OneWire.h> #define DS18S20_Pin 20 //DS18S20 Signal pin ...
0
votes
1answer
34 views

Maximum sampling rate of Arduino Mega2560

I'd like to know what is the maximum sampling rate achievable while using ADC on Arduino Mega2560. Thanks
1
vote
1answer
34 views

Serial Port fails with speeds greater than 19200

In Arduino Mega 2560 R3, properly selecting the Serial Monitor bauds, this code works with #define R 38400, but for some reason, not with #define R 19200 (?), #define R 38400 int rate=R; ...
0
votes
1answer
25 views

Velleman KA02 not working on Mega 2560 r3

I have a Velleman KA02 audio shield. When I use this shield on an Arduino UNO R3 with this sample code, it works. And by "work" I mean when I interact with the Serial Monitor (by pressing Y, for ...
0
votes
0answers
39 views

Programming AFE4404 using Arduino mega2560

I'm facing difficulties programming an AFE4404 using the arduino mega2560. I'm using AFE4404 I2C to program it. I tried most of the code I found online with minor changes to get all the LED and ...
-1
votes
1answer
25 views

Controller freezes

I am using atmega 2560 as main(master) controller and other 5 salve 2 atmega 8 and 3 atmega 328p, there is two device with analogue output connected to main controller atmega 2560 through ads1115 ...
0
votes
2answers
55 views

Rubber keypads and DC motors & LCD on Arduino Mega2560

I'm quite a newbie to Arduino and hardware & circuit board stuff, so please forgive me if you feel my questions are too stupid. Recently, I'm working on an assignment which I have to reconstruct a ...
0
votes
0answers
40 views

MEGA2560 only starts program after pressing RESET button multiple times

I am working on a program where I am controlling an MP3 player by using UART between my MEGA2560 and the MP3 player. The MEGA2560 sends serial commands to the MP3 player when external interrupts are ...
0
votes
1answer
73 views

Adafruit Micro-SD breakout not initializing on MEGA 2560

] [I am having quite a bit of trouble trying to get my Arduino MEGA 2560 to read my micro-SD card. My wiring is as follows: Breakout Arduino 5v 5v Gnd Gnd CLK 52 DO ...
0
votes
1answer
58 views

How can i stop DC motor when button on remote is released? [closed]

I am trying to control a motor using a remote with Arduino Mega. The motor turns on when I press the button on the remote but when I release the button, it continues to move. Does anyone know how to ...
0
votes
1answer
94 views

Help understanding how avrdude works with ArduinoISP and why its not working for me

I am trying to use avrdude with a Mega2560 running ArduinoISP Note: I have the 10uF cap on the Mega2560 RESET line as described by Ardunio. Also, I am using avrdude/6.3 on Windows 10. The Mega2560(...
0
votes
0answers
32 views

Min/Max current for supply input of mega2560

What is the min and max current the mega2560 can take for the 5v supply input voltage of the chip itself, not just the arduino mega?
1
vote
1answer
52 views

Switch statement cases not executing

Overview: I am trying to use a switch statement to run different tests. A main menu is displayed on the serial monitor, and then the user is given the option to enter their menu choice in the serial ...
0
votes
0answers
20 views

Arduino Swarm - WiFi and Embedded Communication

I'm developing an Arduino-based swarm, each bot having 1 ATMEGA2560 as its main processor and 1-2 ATMEGA328 as sub-processors and a variety of sensors and actuators, with WiFi (LAN) connection in a ...
0
votes
2answers
50 views

How can I discard power from a device I want to read from?

I want to read the data line from a device that normally interfaces with a controller. It has 3 pins, 3.3v power, gnd, and data. I don't need the power line since the Arduino will be USB powered and I ...
2
votes
1answer
134 views

Ardunio Mega/ATmega2560: Using Port F or K for both analog inputs and digital outputs

On an ATmega2560, can ports have some pins used for analog inputs but others as digtial i/o? Specifically, I only need to use 3-5 analog inputs but have many digital inputs. I would like to use the ...
0
votes
2answers
222 views

Will a 12 VDC 1A Power Supply Adapter supply too much power and damage an Arduino Mega 2560?

The specs shown here: show that it has 54 digital pins with each outputting a DC current of 20mA which makes it 54 * 20 = 1080 mA Plus the DC current of the 3.3V Pin of 30mA we get a total of 1110mA....
1
vote
2answers
68 views

Matrix keyboard and 7segment display countdown combination

I'm working on an escape room for my university with an Arduino Mega. The last part consists of a 7segment display representing a time countdown, and the participants have to introduce the correct ...
0
votes
1answer
70 views

Converting code for ATTINY85 to ATMEGA2560. Pin change interupts

I have code that compiles correctly for an ATTINY85 board using the ARDUINO IDE but I don't have an ATTINY85 board. I have an Arduino Mega ATMEGA2560 and when I select this board in the Arduino IDE ...
0
votes
2answers
859 views

Parse a large json response with ESP8266

I'm doing a project where my Arduino uses an external ESP8266 wifi module (with AT firmware) to send http requests and receive server response. I'm trying to get an NBA scoreboard, and here's what my ...
0
votes
0answers
86 views

EEPROM.read data not comparing with DHT11 sensor value - Arduino temp controller

I'm using a DHT11 to read temperature to control a relay that will control a fan. When 'A' is pressed it allows the user to update the temp value that the relay will go HIGH at. The value is being ...
0
votes
1answer
1k views

How to program the Robotdyn Mega 2560 PRO MINI?

I want to program the Robotdyn Mega 2560 PRO MINI which has no USB port. How do I connect the pins to an FTDI? Which setting do I have to use in the Arduino IDE?
0
votes
0answers
71 views

Sketch works on MEGA 2560 timer2, but does not work on timer1

I set the PWM frequency on MEGA 2560 like this: TCCR2A = 0; TCCR2B = 0; TCNT2 = 0; TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM20); ...
0
votes
2answers
235 views

ATmega 32A and 2560 R3 register to pin mapping?

I've been doing research for the last few hours trying to determine the mapping of physical pins to memory-mapped I/O registers for the Arduino Mega board (which is an ATmega 2560 R3). My code is on ...
1
vote
1answer
783 views

SOLVED: Strange phenomenon with avrdude: stk500v2_ReceiveMessage(): timeout only with ATmega250 on windows 7x64

I know this problem has been reported multiple times but in my case I think there is a different light on it. My desktop is a w7x64 box and I also have a notebook with w10. Both system have the ...
0
votes
1answer
52 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
29 views

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

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
307 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
48 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
133 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
311 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
44 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
46 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
325 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> ...
1
vote
1answer
162 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 ...