Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [atmega328p]

This tag should only be used with questions about the ATmega328p microcontroller. Questions about other ATmega series MCUs should use the tag "atmega", and those about the use of the ATmega328p within the Arduino UNO should use the tag "arduino". It is acceptable to use this tag with specific variants, like the ATmega328, ATmega328P-PU, etc.

Filter by
Sorted by
Tagged with
0
votes
1answer
1k views

How to set two timers running at the same time in atmega328p?

I want to set up two timers running two ISR-s with different resolutions. One timer for counting milliseconds for clock time, another for counting microseconds when ...
0
votes
1answer
389 views

How to use two timers for one interrupt vector on avr?

I want to use timer1 and timer2 for same vector TIMER#_COMPA_vect isr on atmega328p. Idea is to start and stop one when requested, for time sensitive functions. And ...
0
votes
1answer
186 views

ATMEGA328P standalone sketch doesn't work as expected

As I finished programming the MCU in the Arduino Uno board to receive some RF Signal and drive relays, I moved it into a standalone board I made with Eagle. The circuit is pretty basic, the MCU ...
1
vote
0answers
151 views

ATmega328P current drawn when in Brown out

I'm experimenting with an ATmega328p on a breadboard using the standard Arduino bootloader. I'm looking at the power consumption as I want to power the device from a solar panel and a large cap. I've ...
1
vote
1answer
322 views

I2C & SPI Operating at the same time

I'm starting to learn AVR microcontrollers. I used some books, and the hardware I use is the ATMega328P. I would just like to ask if both SPI and I2C can operate at the same time. Thanks for the ...
1
vote
1answer
1k views

DS3231 on Battery Power and Use of Aging Register

Currently working with DS3231M RTC module with Arduino Uno and also creating a library for this. It is working perfectly but I have a doubt that DS3231M work on both VCC(main current) and VBAT (i.e ...
0
votes
1answer
801 views

I2C communication ATmega328P slave: answer to general call but not to own address

I have the following problem: I want to make two AVR Atmega 328P-Pu communicating together with I2C No1 is Master (I2C address :0x01) No2 is Slave (I2C address :0x02) On slave answer to general ...
0
votes
3answers
204 views

Voltage regulation for Atmega328p

I am designing a circuit containing two Atmega328p. First chip will drive TFT screen with 3.3 V linear voltage reg. Second one will drive BT module, couple of relays, two sensors, SD card module, and ...
2
votes
2answers
133 views

Are these circuits equivalent? (Arduino on breadboard)

Small background: I would print a PCB with an ATMEGA. Per Gammon website instruction (http://www.gammon.com.au/breadboard) we need 2 ceramic capacitors, on both "side" of Atmega, connected to the VCCs ...
0
votes
2answers
371 views

Unable to set Pin Change Interrupt on ATmega328p

so I am working on learning some AVR programming with the ATmega328p. I am trying to set up a pin change interrupt and this is the code I am running. However, the interrupt never seems to trigger. ...
5
votes
4answers
2k views

Does the output bypass capacitor of an LM7805 double as a decoupling capacitor?

I'm using a 5v linear regulator (specifically an LM7805) that outputs directly to an ATMEGA328P. According to the LM7805 datasheet (page 23) input and output bypass capacitors should be used, as seen ...
3
votes
2answers
578 views

Realizing a multitasking program with Timer Interrupts

This is my attempt to realise multitasking (well almost) through interrupts. In this example, Task 1 is: Toggle LED connected to PB1 at 2Hz (Timer 1 is used, OCR1 can hold values upto 65535), Task 2 ...
1
vote
0answers
349 views

Replacing an Arduino Uno with a 3.3V ATMega328p

For a school project my partner and I have been prototyping our system, a microcontroller + sensor + rf transceiver, with an Arduino Uno as the micro. The sensor and transceiver both run off of 3.3V, ...
0
votes
1answer
522 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
242 views

I2C-ATMEGA328p as Master and 24LC256 as slave

So i am trying to establish a connection between ATMEGA328p as Master and 24LC256 EEPROM Chip using I2C protocol. Clock is set to 100KHz SDA and SCK lines are pulled up to Vcc using 4.7K Ohm ...
1
vote
2answers
1k views

LED on button push ATMEGA328p

I am using a Tinkerkit button as input to Arduino PORTD pin0 and expect an output on PORTC, pin0 as output. Code: ...
0
votes
1answer
337 views

SPI problems with ATMEGA328 as Master

I am trying to connect ATMEGA328p as master to X25020 EEPROM as slave. here is my code ...
1
vote
3answers
306 views

Encoder too fast for a poor Atmega328?

I've been playing with a couple servomotors i got from surplus of pick and place machines. So far, i've decoded their pinout and i'm working on reading the encoder, here comes the problem: From what ...
0
votes
1answer
71 views

Reconfigure ATMega328p registers

So I'm working with an ATMega328P. I'm trying to write a stepper driver to drive a DRV8825 breakout board. This requires only a single PWM. In order to properly accelerate the stepper motor I need to ...
0
votes
1answer
427 views

Help! Arduino `INPUT_PULLUP` not inverting

I have a situation where I tried setting pins on my Atmel Mega328P to INPUT_PULLUP. I was told to expect an inverted input: a +5V would result in ...
2
votes
2answers
669 views

ATmega328p will not enter programming mode

simulate this circuit – Schematic created using CircuitLab I'm trying to connect a ATmega328p and Raspberry Pi together, communicating via SPI. The Pi is Master and is used to program the ...
0
votes
1answer
512 views

Led Bulb Flicker when duty cycle is below 40%. What is wrong with circuit?

I am working on project to dim the LED bulb(Dimmable) with Atmega328. Everything works fine when duty cycle is above 50% but as soon as i am decreasing duty cycle below 50% LED bulb start flickering. ...
0
votes
1answer
327 views

LDR / photoresistor issue: resistance is constant in different light conditions

I have installation with Controllino mini, it's essentially an ATmega328, and with 6 LDRs and 6 lasers, creating laser rays/barriers. The system acts as a lasers labyrinth for entertainment purposes, ...
0
votes
1answer
784 views

L6234D three phase motor driver, atmega328p, and brushless motor speed

Folks, this question involves an arduino, a brushless motor, and L6234D three phase motor driver. A very nice description of the principles to use the L6234D be found at this site. The gist it's ...
-3
votes
3answers
414 views

Differene between DS3231sn and DS3231mz

Which one is better? DS3231SN have accuracy ±2ppm and the other one have ±5ppm.What is actually meant by the accuracy and what are the other differences.? What type of internal oscillators are used by ...
0
votes
1answer
168 views

NE555P Frequency Drop to 0 after a couple of minutes? [closed]

I'm trying to build a frequency measurement circuit using NE555P and Atmega328P. The circuit is the following : I use this library https://www.pjrc.com/teensy/td_libs_FreqCount.html Always, The ...
0
votes
1answer
90 views

Change current using PWM, for specific range outside PWM boundaries [closed]

I have a circuit where I use a digital potentiometer (namely MCP41100) to change current, and I use duty between 0 and 255 (thus, I have 256 steps). The current changes from 25 micro to 50 micro. And ...
0
votes
1answer
613 views

Trying to flash Atmega-328P with a zhifengsoft USBASP

I'm trying to flash Atmega-328P using avrdude. I've written a custom config for my USBASP to be recognised. ...
0
votes
3answers
417 views

ATMega328P - faulty ADC behavoir - update

BLUF: What causes the ADC2 to work perfectly while ADC3 charges towards a value of 328 (1.6V) on ATMEGA328P? I use an ATMega328P for one of my current projects and had an issue with the ADC. \$A_{...
3
votes
3answers
214 views

Please critique my schematic

I'm very newbie in electronics, so, I kindly asking the community to review my schematic. This is my most advanced project I ever did and I'm really unsure about particular points in my scheme and ...
0
votes
2answers
3k views

Arduino Atmega328 sleep mode with internal timer interrupt

I am trying to reduce the current consumption of my Atmega328 -Arduino- by using the sleep modes. In my code, I want to wake-up every 10ms, read the value from ADC, ...
4
votes
7answers
3k views

Is it safe to drive I/O pins of an unpowered AVR ATmega328P? [duplicate]

Is it safe to drive the pins of this AVR chip while it's unpowered? For example, if I were to share a motor driver such that it can be driven by two microcontrollers, would either microcontroller be ...
0
votes
0answers
84 views

How to run micro servo with ATmega 328 PU

When I use arduino board it works fine but when I try to put it on prototype breadboard it just freez and start humming. For circuit I am using 5v regulator, duracel 9v battery, ZTT 16.0 mx resonator(...
0
votes
1answer
145 views

Generating a short pulse after a delay on ATmega 328/P

I am trying to use one of the hardware timers on the ATmega 328/p (arduino uno) to generate a short pulse some number of microseconds after receiving a pulse on an input. Currently my code looks like ...
2
votes
1answer
222 views

ATmega328P firmware flashing interrupted - is it fixable?

I am working on some PCB with an ATmega328P on it. I use a Pogo connector because we have to program and test the PCB outside. I program with usbTiny, (...
1
vote
2answers
684 views

ATMega328P free-running ADC interrupt not firing

I'm playing with an ATMega328P running off a USBtiny 1.0, and have the following set up: Potentiometer to ADC0. PB0 sourcing current for a LED. My program then mirrors ADC0 to the PWM on PB0, so the ...
1
vote
0answers
839 views

Programming the Atmel Mega 328P-AU 32 MLF (QFN) using the Arduino ISP

I have successfully managed to program both a (DIP)Mega168A-PU and a (DIP)Mega328PU using another (DIP)Mega328P-PU ISP. This is the configuration that works for both DIP formats (168A-PU & 328P-...
-1
votes
4answers
741 views

Programming The Atmega Chips [closed]

Can someone explain a little bit to me how to program the Atmega MCU for example the Atmega328P without the arduino?? So, what i want is to program the Atmega chip without Arduino IDE but using the ...
1
vote
1answer
243 views

Prototyping with ATMEGA328P-PU (DIP-28) for ATMEGA328P-AU (TQFP-32)

My schematic will use internal oscillator, but will not require precise timing. It will be produced using surface-mounted ATMEGA328P-AU (in TQFP-32 package). However this is not convenient for ...
1
vote
4answers
3k views

Determining current draw of arduino

I am trying to determine the correct batteries required for my Arduino (Atmega 328) project. I have components which have both voltage and current ratings. I am adding up all the maximum current ...
1
vote
2answers
244 views

27 pin Arduino Microcontroller

I have to solder a microcontroller that belongs to an Arduino Uno to a PCB. The Arduino uno uses the Atmega328p which has 28 pins. On the pcb I have, i see only 27 pins for the microcontroller. Could ...
0
votes
1answer
622 views

Fade a LED using fast PWM and interrupts on Arduino

I have a project to make an LED fade in for 1 sec, stay on for 1 sec, fade out for 1 sec and then stay off for 1 sec, all the project must be done with registers and with the help of the timer0 fast ...
0
votes
1answer
141 views

Use one power source for two atmega chips

I'm working on a big project recently that requires 2 atmega chips one to handle input midi signals and one to transmit output midi signals. Because of the complexity of the project I cannot use one ...
0
votes
2answers
103 views

microcontroller current supply - noise minimisation

I'm building an Arduino-based quadcopter. I already built a partially working prototype and now I'm preparing the second version, which will probably be the definitive one. Instead of the the whole ...
2
votes
2answers
837 views

Standalone Atmega328p setup not working properly

I have been using arduino uno development board for a few months now and wanted to shift to a smaller version of the same. For this, I used Atmega328p AU standalone chip using an I.C. socket (...
1
vote
0answers
576 views

ESP8266 and ATmega328 UART communication, gets() function

I'm trying to get an ATmega328 and an ESP8266 to talk to each other over UART. In the attached minimal example, I have an LED on pin 16 (B2) that should start on and do a slow blink to show data was ...
0
votes
1answer
350 views

How can I solve atmega328p-pu resetting while it is supplied from power supply

Currently I am using a dip Atmega328p-pu with a breadboard built circuit. The problem is when i am supplying the circuit from Arduino Uno's 5V it is working perfectly fine, but it's not working when I ...
0
votes
3answers
493 views

ATMega input buffer

What happens if a AVR ATMega controller is doing something else when a input arrives on one of the serial ports? Does it has some sort of input buffering? I was thinking of using ATMega328 or simalar ...
1
vote
0answers
484 views

atmega328p not responding to avrdude

I have this prototype pcb with an atmel avr atmega328p on it and it doesn't respond correctly to my AVRISP Mk2. From what i can tell the signature is wrong for that part. Here is the output from ...
1
vote
2answers
279 views

Shift register 74HC164 not working

I recently got started working with digital electronics as a hobby and gotten myself some parts and soldered together a test board for AVR µCs. I'm using an ATMega328P. Now I wanted to play around ...