A message from our CEO about the future of Stack Overflow and Stack Exchange. Read 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
28
votes
6answers
2k views

Due to overcurrent, shouldn't I be extremely cautious when setting an I/O pin as Output?

The question can be applied to any microcontroller with I/O capabilities, but I’m currently working with the popular ATmega328p. Consider the following circuit: A simple SPST Normally Open switch with ...
17
votes
2answers
2k views

Seven-segment display seems to draw little current

I bought a 1.8-inch seven-segment common cathode LED display from AliExpress. So no datasheet available. I used a 1 kΩ resistor and a 5 V source, as to put a max 5 mA in the LED. I measured 1.6&...
6
votes
7answers
2k views

Compress .hex file for micro-controller [closed]

I am currently writing a program in AVR Studio, here is the build *Memory Usage : * ...
6
votes
5answers
1k views

What's the maximum time an interrupt service routine can take to execute on ATmega328P?

I have an ATmega328P that checks if a button was pressed via pin change interrupts. Now, I want to turn on an LED for 200 ms. Can I just turn the LED on, wait 200 ms and turn it back off in ...
6
votes
2answers
718 views

LED- Resistor, does the position matter? [duplicate]

I was reading the MAKE AVR programming. One of the chapters suggests to solder resistor to the cathode side of an LED. But in our uni labs it's said to connect the resistor "before" the LED; that is ...
5
votes
1answer
9k views

Atmega328P - How is brown-out-detection supposed to work?

[SOLVED][UPDATE]: The problem was with fuse bits. Somehow the fuses were being incorrectly written as 0xFE rather than 0xFD. FE corresponds to 1.8V and thus arduino board was working down to 1.8V. I ...
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 ...
5
votes
1answer
738 views

Why doesn't my VGA implementation using an AVR microcontroller work?

Problem I'm trying to generate the appropriate signal output for interfacing an AVR ATmega328P microcontroller with an LCD monitor, via the VGA specification. The VGA specification I am trying to ...
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 ...
4
votes
3answers
720 views

Is the ATMEGA328P's serial baud rate quantised?

I'm using an ATMEGA328p, running from its internal oscillator (divided by 8 = 1MHz). I've (roughly) measured the oscillator output, using my Salae logic analyser, as ranging from 960KHz to 1000KHz, ...
4
votes
6answers
2k views

Timer 1 (16 bit): Why is overflow interrupt sometimes missed?

Initialization of timer 1, the 16 bit timer on the ATmega328: ...
4
votes
0answers
238 views

Please help with my custom ATMega328 PCB [closed]

I created a PCB for my newest Arduino project and its driving me mad by now. I am through several PCB variations and tried connecting to it (via FTDI first - then) via ISP but I fail every time and in ...
4
votes
1answer
576 views

Why did this arduino burn out? SilentStepStick (TMC2130) stepper at 24V

I'm new to electronics. Attempting to bench-test a SilentStepStick stepper driver board, (based on a TMC2130) Using: Arduino Uno, a SilentStepStick driver board, a 0.6A stepper motor, and waterott ...
3
votes
3answers
215 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 ...
3
votes
3answers
611 views

is a voltage regulator required for atmega328p when powering from boost converter at a set voltage?

I know that linear voltage regulators are more accurate at holding the required voltage but the boost converter i am using seems to keep a pretty steady one. the voltage will of course be within the ...
3
votes
3answers
776 views

Servo interfering with 433MHz RF

I'm using an Atmega328P running at 16Mhz (similar to an Arduino UNO). to control a 433Mhz Superheterodyne RF receiver (WL101-541) and two TowerPro SG90 analog servos. Everything is working except for ...
3
votes
2answers
170 views

Direct port manipulation gives random result: Delay necessary?

Setup (Arduino Pro Mini ATmega328p 16MHz, 5V, no pin connected): When called from the setup(), this works: ...
3
votes
2answers
595 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 ...
3
votes
1answer
253 views

External crystal needed for ATmega328P for multi-master I2C communication?

I want to connect multiple ATmega328P chips to an I2C bus. Each unit is configured as slave but can send/broadcast messages as master too. I have this currently working with Arduino Nano units and ...
3
votes
2answers
808 views

Is it compulsory to use ext oscillator in designing arduino circuit?

I am designing a circuit for arduino. I will be using Atmega328p, and will connect few male header for pin access and 6 male headers for programming (MOSI,MISO,SCK,...
3
votes
1answer
709 views

Using Atmel Studio 7 to program Arduino Uno

I will like to use AS7 IDE to program the Arduino board, for start Im using Arduino UNO with ATMEGA328P-PU chip. Im using Windows 10 professional First I used the Arduino IDE in order to run/...
2
votes
1answer
3k views

AREF on atmega328 if analog is not used

I have setup a hackduino following this instructables http://m.instructables.com/id/Perfboard-Hackduino-Arduino-compatible-circuit/step6 This connects AREF to 5V directly. My understanding now is ...
2
votes
1answer
314 views

CAN Bus sniffing

I am CE major prototyping embedded hardware to read and send data via the CAN bus. The design is coupled with a GSM/GPS module to enable tracking. I needed an EE perspective on the schematic diagram (...
2
votes
1answer
227 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, (...
2
votes
2answers
108 views

Buck/Boost converter interaction with MCU in sleep mode?

I am trying to design a battery powered remote controller that has the following components, TPS63802 (converter), AP9211 (battery charger/protection), Atmega328 (MCU), NRF24 (transceiver). The ...
2
votes
2answers
147 views

Read voltage of the battery that feeds ATmega328p

I am designing a system focused on the uC ATmega328p and I am feeding it directly with a 3.7V LiPo battery. I also have a 3.3V LDO feeding several sensors in the system. My question is the next, If I ...
2
votes
2answers
865 views

Help connecting custom ATMega328PB using serial FTDI

I built this ATMega328PB circuit. It runs at 3.3v from 1.5v battery using booster and 8MHz from external resonator (CSTCE8M00G52A-R0). Using USBTinyISP I set fuses: Low-FF (for 8MHz), High-D8 (Boot ...
2
votes
2answers
138 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 ...
2
votes
2answers
855 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 (...
2
votes
1answer
628 views

Atmega328P Watch Dog Timer - Delay Issue

I am trying to give delay of 0.5 seconds on 13 pin of the arduino using Watch Dog timer interrupt, the code complies and works fine but the led is blinking so rapidly that it seems like it is ...
2
votes
1answer
50 views

Single Arduino I/O pin driving multiple DVR8834 stepper driver boards

I working on a project that uses 6 NEMA 8 stepper motors very similar to This One, each stepper will be driven by a DVR8834 and the STEP/DIR logic supplied by a ATmega328P which has a VCC = 2.7V to 5....
2
votes
1answer
199 views

ATmega328P running on 3.3V using a CH340G as serial to USB interface

I'm trying to use a CH340G chip with an ATmega328P that is running on 3.3V to have a simple serial to USB interface. The available datasheets for this chip seem to be very minimal so I've tried ...
2
votes
1answer
79 views

Power Consumption and efficiency

I know that similar threads had been answered but due to the fact that i am a beginner at electronics i would like to verify my measurements concerning about voltage total current and power ...
2
votes
1answer
218 views

Why atmega168/328p starts to reset?

First we set fuse bits: avrdude -c usbasp -p atmega328p -U lfuse:w:0xFF:m -U hfuse:w:0xDF:m -U efuse:w:0x07:m # same for atmega168 In the following examples we ...
2
votes
1answer
489 views

Discrete Fourier transformation or FFT?

I currently have a setup,AUDIO-> LM386 -> MSGEQ7 ->ATMEGA328p (16mhz) and it works to light up an 8x8 LED matrix. 16mhz crystal. each column lights up to represent a frequency: average, 63Hz, 160Hz, ...
2
votes
1answer
254 views

“light_ws2812” library 10x slower than required (AVR C, ATMega328p int. 8Mhz)

So I'm trying to run some SK6812 (WS2812 clones) on a standalone ATMega328p. The output signal is too slow! I define F_CPU as 8000000 (8Mhz), both in the code and in the Atmel Studio Symbols, but my ...
2
votes
1answer
283 views

ATMega328P Programs at 2V but not at 1.8V

I'm perplexed by this one: I'm trying to run my ATMega328P at 1.8V. The voltage at the chip (pin 4 and 21) sits at 1.82V (BK Precision Multimeter). When using the AVRISP mkII, the programmer LED ...
2
votes
2answers
725 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 ...
1
vote
4answers
3k views

Is power cycle reset different from reset pin reset?

I am using custom built arduino uno for a home automation project. Sometimes, the arduino locks up due to electrical noise or sparks in the ac lines. More details here. I tried conducting some ...
1
vote
2answers
248 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 ...
1
vote
3answers
116 views

How to access GPIO pins on Atmega with memory mapping?

I'm programming the Atmega328P in embedded C. I'm going to use 16 pins for turning on LEDs, and I have to use PORTB, PORTD and PORTC for this. I would like to just iterate a pointer so I can turn them ...
1
vote
2answers
187 views

AVR atmega328p - Can I use port C as digital output pins?

I'm currently trying to connect a 7x5 dot matrix to an AVR ATMega328p. I'm already using port B/D and I would like to use port C so that I have extra output pins. My question is, can I use port C as ...
1
vote
3answers
323 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 ...
1
vote
2answers
620 views

how to choose the right pullup resistances for i2c lines with multiple slaves

In my project I have connected multiple sensor breakout boards to a Arduino-proMIni running at 3.3V and 8Mhz as follows on a fabricated pcb but preserving the original board layouts (so that I can ...
1
vote
2answers
2k 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: ...
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
1answer
1k views

ATMEGA328P send MIDI via USB

I've created a circuit on my breadboard including multiple shift registers and a teensy 2.0++. My program takes inputs from the shift regs and converts them into MIDI messages. Using my teensy in ...
1
vote
1answer
198 views

AVR SPI slave first byte problem

I have written a simple SPI slave on an ATMEGA328PB. It mostly works, however, I can't seem to get the first byte to be what I want. The difference between the first, second, and all other attempts ...
1
vote
3answers
216 views

How to obtain Input voltage from ADC value

I am using atmega328p for my project. I have to read my battery voltage and display it in my cloud. For that, i am using ADC. Now I am getting the ADC value for input voltage applied. But i need to ...
1
vote
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, ...