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.

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

Can't uploading on Atmega328P-MU after a while

I am having a problem to upload sketches via Arduino IDE on the Atmega328P-MU chip on a custom board. Shortly after I have mounted the chip on the board everything works fine. I can upload a ...
0
votes
0answers
63 views

I2C pull up arduino mega 2560 issue

We're communicating Arduino Mega 2560 I2C with MCP4728 and INA219 MCP4728 address are 0x60, 0x61, 0x62 and INA219 address are 0x40. With 10k resistor as pull-up we're getting signals as below for SCL ...
0
votes
0answers
63 views

ATmega168 TQFP vs. 28DIP - different behavior after programming

I have developed a program for ATmega168 using Atmel Studio 7.0 and Atmel-ICE as debugging interface. The development was done on a 28DIP package, since it's easy to work with it on a breadboard. ...
0
votes
0answers
28 views

Atmega644 timer0 not work

I setup timer0 on Atmega644: ...
1
vote
1answer
73 views

Why would you right shift 8 bits for 8 bit register?

MCU: Atemega328P Datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf (Page 143 - USART) Note: I am beginner :) Using the BAUD ...
1
vote
2answers
82 views

Tact switches only work once

I am trying to do a digital clock using an Atmega8A, LCD display (2x16) and four tact switches. Key number 1 is connected to pin PD2, number 2 to PD3, number 3 to PB6, number 4 to PB7. When you press ...
0
votes
2answers
57 views

How do I get started in C using avr-gcc on the mega2560 [closed]

I've program the arduino using tools before (on windows) and using C++ but never with c++ without tools nor done it on linux I have a (at)mega2560 and want to do a simple blink program like the below <...
0
votes
0answers
35 views

How to replace AVR _delay_ms() with timer

Good day. I need problem with replacing _delay_ms() bultin function with timer. MCU: Atmega644@16Mhz My code (simplified): ...
0
votes
0answers
54 views

Temperature it's not read well on microcontroller

I'm trying to build a thermometer using the ATMega164 microcontroller, but my problem is that it's not displaying temperatures correctly over 32 degrees, what it's the problem? This is how the setup ...
1
vote
0answers
28 views

Atmega328p-pu (arduino bootloader) processor freezes/resets randomly

I have updated the schematic of my project. The board for this was produced and all components are soldered to the board. Now I am trying to make a "n20 gear motor" move using the motor ...
1
vote
1answer
39 views

Pin change interrupt won't toggle OFF my LED

Friendly Note: I am a beginner :) Microcontroller: Atmega328p LED = PORTB0 BUTTON = PORTB1 Aim: To have the button generate a pin change interrupt request which runs an ISR that toggles PORTB0 ...
0
votes
1answer
21 views

ADIF is set first or ADSC is cleared first?

I am using an ATmega8A for ADC conversion. I start ADC conversion by setting ADSC bit and wait till it clears by hardware to detect the end of conversion. I saw some people checking the ADIF bit to ...
1
vote
1answer
172 views

How can I make a led blink at different frequencies upon button switch?

I'm trying to make a led blink at 3 different frequencies, upon successive keypresses. My problem right now it's that it's only blinking 2 times and I don't understand why. D6 is LED, D4 is the test ...
0
votes
1answer
26 views

Use attiny as an external watchout timer

I like to failsafe an Atmega8 mcu despite having its own WDT. does it make sense that if I add an attiny to the circuit to check if each loop is taking a specific time, if not reset the Atmega chip?
-5
votes
3answers
177 views

Only green display but temperature it's not showed there

I'm trying to build a graphic display thermometer in Proteus, with an LM35 sensor using the ATmega 164 microcontroller. My problem is that the program that I've built it's only starting the display(it ...
0
votes
1answer
43 views

How to use reset pin of ATmega64

I have an Avocent SwitchViewDVI (4SVDVI10) KVM that looks to be run by an ATmega64 microcontroller. Every now and then the KVM locks up and I need to reset the unit by pulling all USB power sources ...
1
vote
0answers
43 views

What does Configure RESET Port Pin as wire-AND mean?

I am studying to use the ATmega328P in debug mode and this sentence in the datasheet is confusing especially the term "wire-AND". Link to Datasheet-https://www.sparkfun.com/datasheets/...
0
votes
0answers
27 views

Atmega88P ADC not working

I have an Atmega88P (default 1 MHz clock) and I'm trying to have a LED blink and to regulate the luminosity of another one using the potentiometer. For the first LED I used TIMER/COUNTER0 in CTC mode ...
3
votes
2answers
134 views

ATmega: Can one determine if an address is program memory or data memory?

On an Atmel ATmega1284 (or any of its AVR cousins), is there any way to determine at compile time or at runtime whether an address that is passed to a function belongs to program memory space or data ...
2
votes
2answers
64 views

How to store the last counting value in EEPROM in ATmega8 after power failure

I written a program to store the last counting value according to ATmega8 datasheet. but it didn't save the last value. The counter variable went to zero after power failure. Please check the ...
1
vote
0answers
49 views

Why can't I connect an external clock oscillator to an ATMEGA64A-AU?

I've decided to change my crystal oscillator for one of those smaller (and also expensive-er!) SMD clock oscillators on ATMEGA64A-AU. I've found this image on the web, which seems right: So I built ...
0
votes
0answers
27 views

How to set up ATmega168 timer to turn on LED after x amount of time then turn off after 5 s?

I am new to AVR programming, what I am trying to do is configure two buttons representing different time delays, so when I press a button it will have a time delay then the led turns on then turns off ...
0
votes
1answer
36 views

Why a newer TOP value in the Atmega328p Timer1 has to be greater than the values in all The compare registers?

The datasheet mentioned the following on p.167 When changing the TOP value the program must ensure that the new TOP value is higher or equal to the value of all of the Compare Registers. If the TOP ...
1
vote
0answers
47 views

Custom ATMEGA2560 with RS-232 Communication Problem

I made a custom PCB using ATMEGA2560 with 2 MAX3223 RS-232 ICs (because they were available to me) but only one Tx channel is working on both ICs and I can't receive anything on any of them. I tried ...
0
votes
0answers
31 views

Analog readings vary by higher current draw

I have a circuit, where an Atmega328pb and an WS2812-LED-Strip is powered by a 3,7V battery which voltage is boosted by a step up converter to 5,1V. To indicate low battery, It reads the unboosted ...
2
votes
1answer
52 views

Can't program ATmega with ICSP on custom pcb

I'm fairly new to PCB design, and I've been trying to program the microcontrollers on the board I designed with no luck. The board uses an ATmega32u4 and an ATmega328P. I've been trying to program ...
2
votes
1answer
130 views

Espressif ESP-01 plus Digispark (Tiny85) design power supply oscillation (fine on batteries)

WARNING: If you try to do something similar to this (using a non-isolated small power supply inside one of your home appliances in an attempt to provide power to "user-added" functionality ...
0
votes
1answer
30 views

Issue with avr spi slave interrupt in proteus ATmega8

I want to get some data from spi, but spi interrupt doesnt work. I get a message and a pause in proteus instead of a signal on LCD. How to fix this? My code: ...
1
vote
2answers
220 views

Can I use a CP2102 USB to TTL IC for programming an ATmega 328p?

I am going to start working with microcontrollers. I will need to programm it. To programm it, I want to use a USB to serial port shield. There are several options. Should I use https://www....
1
vote
1answer
57 views

Inconsistent bootloader failure ATMEGA328P

I am creating a wireless charger with a microcontroller on it. I have assembled 3 boards. One of them has a microcontroller that works fine - burns bootloader and uploads code sketch fine. However, I ...
0
votes
3answers
116 views

PCB review + Analog/Digital separation?

I have built a PCB using this schematic used to charge a small wireless device. This schematic is based on this Texas Instruments evaluation module: https://www.ti.com/lit/ug/slvu928c/slvu928c.pdf?ts=...
1
vote
1answer
49 views

Running AT90USB646/Atmega32u4 between 3.3V and 5V

I'm working on a battery powered project that will need the AT90USB646 µC. From the data sheet, I know it can take from 2.7V to 5.5V at 8MHz. However, apparently, lower voltages reduce power ...
2
votes
1answer
115 views

Configuring Atmega32 timer using the oscillator without prescaling gives wrong delay time

I am using AVR atmega32 microcontroller. The code below is supposed to toggle the LED connected to PORTD. The frequency of the oscillator connected to the ...
0
votes
0answers
31 views

Arduino issues on reading inputs from some buttons

I'm building a sort of joystick with atmega328p: For the moment, I have only written the code to visualize on the OLED display if we press a button or move the joystick. Let's focus on the four ...
2
votes
1answer
79 views

Arduino based triac dimmer bulb flicker fix on touching Arduino ground

I've designed a triac based dimmer circuit. It is working just fine except the bulb is flickering on dimming (working fine with full brightness). Bulb I am using is filament based and dims perfectly ...
-1
votes
1answer
52 views

Atmega resets when switching on/off relays with inductive loads

I have been developing a product that uses an atmega8a to turn on/off 5vdc relays. The layout is simple: 5v directly to relay coil, coil to npn 2n2222a transistor, transistor to ground, transistor ...
0
votes
0answers
41 views

EEPROM chip always toggling bit when reading

I have a parallel EEPROM, the AT29C020 (doc: http://pdf.datasheetcatalog.com/datasheet/atmel/DOC0291.PDF) In order to read it I'm using an ATMega8535 as it has enough pins. At first I thought reading ...
0
votes
0answers
31 views

Atmega16U4 (Hardware USB) does not show up as DFU device on device manager

I am trying to get the Atmega16U4 to show up in windows device manager. Right now, when I connect the atmega16U4 through USB to the computer it does not do anything (does not even play the USB ...
0
votes
1answer
30 views

Atmega32u4 on 5V. MISO from IC on 3.3V?

I'm running an Atmega32u4 on a 5V circuit. However, I'm also using a Bluetooth IC [MDBT40] on a 3.3V circuit that I'm setting down from 5V with a linear regulator. I'm turning both SCK and MOSI to 3....
0
votes
0answers
36 views

Generating PWM at pin PD5 of ATmega328P

I am beginner to ATmega328P programming for PWM generation. I am trying to generate a PWM wave at PD5 pin the datasheet says PD5(OC0B/T1/PCINT21). When I generate the PWM with help of timer0 overflow ...
1
vote
1answer
89 views

Can I use ceramic resonator for ATmega328p?

https://lcsc.com/product-detail/Ceramic-Resonators_ABRACON_AWSCR-16-00CV-T_16MHz-0-5-22pF_C179647.html I have been developing a project that includes ATmega328p-AU, So I have studied many circuits ...
1
vote
1answer
75 views

Does AREF pin of ATMEGA series consume any current?

I have a voltage reference in the circuit and I thought I can feed that reference to AREF pin of ATMEGA as well: The current at "1.024V" tag is around 200 uA, any current drawn by the AREF ...
0
votes
1answer
61 views

Atmega MCU freezes when nearby VSD starts. Possible causes and solutions

I have a custom PCB that uses an ATMEGA1280 MCU. The board has a few inputs and a relay output. Inputs are mostly 4-20mA measuring temperature sensors. I also measure VSD current from a VSD mounted ...
0
votes
0answers
19 views

ATMEGA128 & AD7417 Reading first channel using external reference voltage

I'm doing test work in Proteus ISIS. Where in circuit used External ADC, but there is no modeling module in the proteus. And i can't test it. This ADC using TWI(I2C) interface. ADC connection circuit: ...
0
votes
2answers
46 views

Brown-out detection with an external clock ATmega1280

I'm using ATmega1280 with an external clock and I have some questions about the "safe operating area" for preventing EEPROM corruption with BOD. The external clock is: Crystals 14.7456MHz ...
0
votes
0answers
86 views

Read specific line faster

i am working on a mp3 player project for hobby use,i use atmega644pa @12Mhz and use fatfs library via spi.Avr has no enough sram to the long file names so I tried to store long file names in a text ...
0
votes
2answers
72 views

How to calclate Rb value for NPN transistor?

Here is a part of my schematic. K pin from LCD is connected to NPN transistor. A pin is connected to Vcc, 5V. Base is connected to uController. It is Atmega16. 5V supply. I am using BC547 transistor ...
1
vote
1answer
33 views

USART and ATmega RX Problem

I'm trying to understand how USART of ATmega works. I read some pages and I've picked information about it. To test functionality I've written this code: ...
1
vote
0answers
65 views

Power supply for ATmega16

I am working with Atmega16 mc and it works on 5V. Also my project consists of IR sensors, LCD and few diodes. All of those works on 5V. I am wondering how can i power this board. I read somewhere i ...
2
votes
2answers
62 views

Why does the ATmega MCU on the Arduino board have both a flash memory and EEPROM?

I know that both are non volatile. Flash is used to store my code and EEPROM stores long lasting values (like a hard drive on PC)...

1
2 3 4 5
23