Questions tagged [atmega]

ATMega is a family in the AVR series of Atmel microcontrollers. This is the main microcontroller of the Arduino prototyping platform. Please Specify the specific part number in your question.

2
votes
2answers
176 views

ICSP + SST25VF016B + ATmega2560 Problem

We have designed a board that uses an ATMega2560 and wanted to have the option to do remote firmware updates (it has a Sim800C as well for getting the firmware files). Therefore we've added an ...
1
vote
1answer
97 views

Is there a way to save state in a very low power way?

I basically want to determine if power has been totally disconnected in a low power device I am making that uses an Atmega328 chip. The theory is that when power gets first applied the ATmega will ...
2
votes
1answer
205 views

Comparator/capture miss during RC timing

I've written a capacitance meter for the Arduino Mega platform, which has an ATmega2560 chip. It works using a simple first-order RC charge circuit, and the ATmega's comparator, bandgap ref and time ...
1
vote
1answer
80 views

Irll024N logic level mosfet + atmega 2560 problem

We're designed a circuit based on an atmega2560 and wanted to turn on or off some parts of our pcb. So we've installed an logic level mosfet (IRLL024N) that was supposed to act as a switch on our 5V ...
0
votes
1answer
89 views

How read -8v to +2v using ADC ? which ADC i can use?

input signal is from +2v to -8v whose time stabilization is 3-8 Sec and frequency is varying from 60 Hz to 100 Hz. How i can read that signal, and which ADC i can use ?
1
vote
2answers
349 views

Atmega32 ADC Value not accurate

I was trying to simulate on proteus ADC with potentiometer and get the reading to control dc motor with PWM it's working but the problem is the ADC value not accurate. ADCH reach max value before ...
-4
votes
2answers
94 views

i have a problem with my school project?

i'm working on a school project "Android control a robot car via Bluetooth" with temperature sensor "LM35" , gas detector "MQ-2" ,motor drive IC "l293D" and Bluetooth module "HC-05" using atmega 32 . ...
-7
votes
2answers
85 views

ATmega168 Dimensions

Anyone has the dimensions of the ATmega168? The on-board one, not the through-hole one. I need it, and after searching in the datasheet, I couldn't find it.
-4
votes
2answers
98 views

How do I burn my C program onto my microcontroller (Atmega32) wirelessly? [closed]

My team-member is moving to a different city. So how can he upload his codes, when the board is with me, many kilometers away from him. Is there an option of burning the codes in a wireless-mode? If ...
1
vote
2answers
1k views

Using an AVR Programmer to program the TQFP version of ATMEGA328P [closed]

I am attempting to upload the Arduino bootloader and a program to an ATMEGA328P-AU with an AVR programmer. I have done this before using the Arduino UNO board and and the 28 pin DIP version of the ...
3
votes
1answer
86 views

ATMega128 A/D Floating

I'm working with an ATMega128 micro working with a joystick (pot in the schematic below) that's a .25-4.75V output with a 2ohm output impedance (Joystick Part Number is: ch products ts-2-r-1-u-05-a). ...
0
votes
2answers
575 views

External interrupt on atmega328p

I want to connect 4 push buttons using interrupts on all of them, with my atmega328p, but when i read the datasheet, I found that the atmega328p had only 2 external interrupts ( INT0 and INT1), are ...
1
vote
4answers
603 views

Digital clock by atmega8 with timer1 and LCD display

I have written code to make a digital clock using timer1 and tested with Proteus (an Arduino simulator). That program has been downloaded into an Atmega8 and interfaced to an LCD display. Seconds are ...
1
vote
3answers
1k views

Is ESP8266 an AVR?

AVR is just an integrated circuit microchip, made by Atmel. It looks something like this: (source: https://stackoverflow.com/questions/1447502/whats-the-difference-relationship-between-avr-and-...
1
vote
3answers
348 views

Atmega328p PWM overheating and flickering

I'm trying to build a dimming control for a 24V RGBW-LED strip using potentiometers as analog inputs. It's pretty similar to the analogWrite() example on the arduino website (arduino.cc/en/Reference/...
0
votes
2answers
150 views

Laying out an AVR Board V2

This is an update to my previous board here, which I made after implementing the useful suggestions offered in that post. In the schematic I have added decoupling capacitors, programming header and a ...
1
vote
1answer
102 views

Shared programming pins

Alright so there is a question that I need to ask. I am designing a PCB and I plan to include a ISP header for programming. Now one of the programming pins (PB3 - MOSI) is connected to a push button ...
0
votes
3answers
395 views

PCB Design questions

Ok so I have finished laying out a board. I have an ATMega328P running with a 8MHz crystal. The board has two layers and I have chosen the top layer as the ground plane (GND) and the bottom layer as ...
1
vote
2answers
81 views

Building a clock. Need some guidance

Alright so I learned all the fundamentals of the AVR and now I am thinking of building a clock as a project. I will use the ATMega328P along with the DS1307 RTC. The time will be shown on an LCD or ...
8
votes
2answers
821 views

Need help reverse engineering and understanding a small circuit

I am an electronic student, and one day I opened an energy meter I have at home called EM21, and found out that its body is comprised of two major components: The meter body, that connects to the ...
-2
votes
3answers
180 views

Atmega32A and relay module cant turning water pump on

I have some problem with water pump. So I use atmega32a and 5v relay module to turn water pump on for 5 second, but in reality the water pump can't last for 5 second. Just after water pump goes on, ...
8
votes
7answers
1k views

How to find the UART line is free for send data

I have several boards that communicate together with Rs485. They have ATMega series microcontrollers such as atmega168p or ...
1
vote
3answers
437 views

get dynamic length packet from UART?

I Write a program for receive data from Uart ISI, my Data Packet is something like : 2 first byte contain Device ID and type of command. Data is contain some bytes that could be have different length,...
2
votes
4answers
701 views

Best way to find delay between receive data from USART

I write a code (for Atmega168P) for receive data from USART interrupt as below: ...
1
vote
1answer
1k views

ATmega328p driving RGB LED WS2801

I am using an ATmega328p to control this RGB LED module. The ATmega is on an Arduino Uno, but I am programming it in C, without using the Arduino libraries. To power the RGB module I am also using a ...
2
votes
0answers
119 views

Sending Serial Data Over FTDI causes loop

I'm trying to send and receive serial data from an atmega328 (using the arduino library) over an FTDI (FT232R) chip. I can send data to my pc and view it in a serial monitor. I can send data from my ...
-1
votes
1answer
375 views

Which crystal do i choose in atmel studio?

I'm trying to use this 16mhz crystal with an atmega328 chip and I need to set the fuses for it in atmel studio. But I have no idea which option is the correct choice. None of them say 16mhz. I've has ...
0
votes
1answer
223 views

Why isn't atmega8 using the internal oscillator at 8MHz by default?

I've been using the atmega8 for some time and encountered a problem related to timers that require higher clock speeds. I missed the part in the datasheet and ...
1
vote
4answers
129 views

Is it possible to implement RC-5 not using interrupts?

The problem with my atmega8 is that I don't have the external interrupts INT0 or INT1 ...
0
votes
1answer
39 views

Can't program atmega32 interfaced with LM34

i want to read all temperature range of the LM34(-50 to +300) but i only can program single ended like this one, and i only can read from 0 to 50 F but i can't program one like this(can't read two ...
0
votes
1answer
385 views

How to read LM34 temperature sensor negative voltage with atmega32?

I'm trying to read the temperature witr LM34 but it only reads from 0 to 50 F and ut's rage knows as from -50 to +300 F, so i asked a lot and i found that my circuit below can't read a negative ...
0
votes
3answers
167 views

atmega timer strange behavior

I'm using atmega8 running at 1MHz. I wrote a function that counts the milliseconds and it was working flawlessly. However, when ...
0
votes
1answer
466 views

atmega328p watchdog keeps restarting

I have AVR Atmega328p which I want to blink for 5 secs every 16 secs (to test the watchdog interrupts). I have the following code, which keeps restarting, and the last line is: ...
1
vote
1answer
94 views

Atmega328 and Servo on same suppply

I currently am working on a battery powered Atmega328 design, using 4 AA batteries, at around 6.5 volts. I am using it to control a single digital servo, HiTec HS-5645MG. This is done using a RF ...
0
votes
1answer
516 views

Why does the LSR (logical shift right) instruction only require a single clock cycle to execute?

A while ago, I was reading the book Some Assembly Required on programming assembly for the avr family of microcontrollers... Early on, it explained that the LSL ( logical shift left ) instruction was ...
1
vote
1answer
540 views

How to read an input value from atmega32 pin?

I'm trying to read a value from an avr pin but it doesn't work. I'm trying to read a value that is coming from a push button and this button is connected to 5V DC cell. When I press the button the ...
0
votes
0answers
157 views

Not getting stable output out of ADC

I have written a short program to measure the room temperature using a temp sensor, LM335. The power supply is fixed pretty constant at 5.04V. The following code is supposed to print out the second ...
0
votes
1answer
138 views

How to reduce code size in flash of atmega8? [closed]

I write code for Atmega8 in Atmel studio and the size of code is overflow the flash size of microcontroller. Could anyone help ...
0
votes
1answer
168 views

Atmel ATMega8 doesn't hold “HIGH” state of PB0 and PB1

I'm new in microcontrollers and I wrote simple program that set HIGH state at PB0 and PB1. ...
0
votes
1answer
540 views

Atmega328p RS232 communication what's wrong?

I'm trying to connect Atmega328P to PC via RS232, the Microcontroller code is basically a : Serial.write("Greetings !"); inside the loop function. I've tried the following circuit but it doesn't work ...
1
vote
1answer
321 views

Why does a DC motor doesn´t move with low OCR values

I'm using a 6V DC motor for the first time and I've set up a timer on an atmega328p to create the PWM signal that then goes to the H-bridge (L293D). My question is why, for example, using a 8 bit ...
-1
votes
1answer
1k views

74HC595 Shift Register LED Array

I am kind of stuck with my shift register understanding whats happening. I uploaded an empty program to test the connection and what I see is 8 LEDs in my array all lighting up. I don't call any ...
1
vote
1answer
260 views

AVR Bitwise Operations

I am getting started learning more about AVR ATMEGA programming. Reading an article about the inner workings of Arduinos, I am learning how the shiftOut method is ...
0
votes
0answers
143 views

Microcontroller(Atmega16A) hangs in Stop method while communicating using I2C with Atmega16 and 24LC256

First of all let me say that I am a beginner in embedded programming. I am trying to do write/read using I2C protocol from 24LC256 EEPROM using Atmega16A. While debugging in Atmel Studio 7, I see I ...
1
vote
0answers
192 views

Serial Connection ATMEGA328p

I wrote up a function to connect via UART and print a string for debugging purposes. But my logic does not add up somehow... I see the line "Random Number" printed in the console but blazingly fast... ...
1
vote
2answers
851 views

AVR Timer/Counter Overflow and ISR

I want to create a PWM on any PIN and therefore using ISRs to achieve this. The setup I chose, working with my ATMEGA328p and Timer0 is: ...
0
votes
0answers
84 views

How to read the ATMEL unique ID? [duplicate]

Hi anybody know how to get ATMEL unique ID from Atmega microcontroller? I read this question but the code in answer not work in Atmel Stadio. Edit: Because we produce about 1000 board per week I ...
0
votes
1answer
245 views

Random output when reading AVR UART transmission

I'm trying to learn how to use the USART interface on an Atmega328p. For now, I just try to send a 'c' character bytes every 500 ms and read it on my computer using a PL2303 USB-serie TTL converter. ...
1
vote
1answer
1k views

USART in SPI mode vs. SPI hardware speed

On AVR ATmega devices, the USART has the capability to function in SPI mode (i.e. synchronous with no start or stop bits). The chief operational difference is that the TX line (i.e. MOSI) has a buffer,...
1
vote
1answer
187 views

Binary Display with LEDs

I tried an example of code to display serial output on an array of LEDs. ...