Skip to main content

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
1 vote
2 answers
130 views

Will such a scheme work correctly with ATmega328PB?

I am developing a small on-board computer for my rocket model and now I have designed the ATmega328PB connection to the CH340G and I want to ask if there are any errors in the connection and if there ...
DYNAMIC AEROSPACE's user avatar
-1 votes
0 answers
49 views

Embedded device with Hardware issues consisting atmega 328p, RFM96 and ADXL345

I have a device that works on 3V battery (2 D size cells) now I want to debug it so that all the devices work correctly. My device consist of atmega 328p, running on 08 MHz Crystal which gets readings ...
Talha Ashfaq's user avatar
0 votes
1 answer
62 views

Is it OK to power the circuit while the programmer is connected?

I have an Atmega328 connected to an Olimex AVR programmer, and programming it works fine. Because the programmer does not supply a constant power, I also power the entire circuit from an Arduino (just ...
Bart Friederichs's user avatar
0 votes
0 answers
23 views

Regarding Torque of DC Motor with PWM, Atmega328 and MOSfet

I am trying to develop a system having a DC motor (geared 12v 200rpm). There's a rotary encoder to adjust the RPM of the motor. I am using Atmega328 as the main MCU. To drive the motor I am using ...
spdif's user avatar
  • 1
1 vote
3 answers
140 views

Damaged ATMEGA328P despite clamping diodes and current limiting resistor

I have a custom PCB designed to interface an Arduino Nano's ADC pin that had 12v from a bench power supply inadvertently connected to a header pin meant for 5v input. The ATMEGA328P now gets extremely ...
Robert Susmilch's user avatar
1 vote
2 answers
52 views

How can I prevent a 120VAC solenoid valve from resetting my ATMEGA328?

I'm using an ATMEGA328 running Arduino code to control a relay which uses a 5V signal to switch a 120 VAC solenoid. I added a flyback diode to the relay which fixed an earlier reset problem, but I'm ...
Jake Nixon's user avatar
0 votes
1 answer
34 views

Why did fuse bits successfully reset using ICSP and USBASP programmer?

I read a lot about fuse bits in AVR microcontrollers and everyone says that fuse bits can be reset by using high-voltage programmer only, they can't be reset via UART<->ICSP. So, I've received ...
Alexander Perechnev's user avatar
0 votes
1 answer
16 views

High time in External Clock drive

While looking for the rise time and fall time of external clock in ATMega328p, I came across the term "High time". Is it same as "ON time" i.e. time taken to reach 10% of amplitude?...
Technaut's user avatar
0 votes
1 answer
63 views

ATmega 328P system reseting [closed]

I am working on an electronic system for irrigation. The system works well when I am using separate power supplies for the circuit and the 5 V relay. When I use a common 12 V power supply for both, ...
nad66's user avatar
  • 1
0 votes
2 answers
142 views

AVR ATmega328P if statement wrongly executed after reset

I have simplified the listing to bare minimum where I can still observe this behaviour. When this program is running, it works as expected. Button press causes LED to show up. The problem exist on ...
smajli's user avatar
  • 940
0 votes
1 answer
57 views

ATmega328P Experiences Erratic Behavior with 12V to 5V Regulator Above 10V Input

I'm encountering an issue with an ATmega328P circuit when using a 12V to 5V voltage regulator Texas Instruments LM1117MPX-5.0-NOPB.The setup includes the ATmega328P, three LEDs, a crystal oscillator ...
sam prince's user avatar
4 votes
1 answer
2k views

I'm trying to create a clock. Rate my first schematic design

Hey guys, I'm a developer trying to learn PCB design and advanced hardware design and needed a place to start. I've designed a very basic clock with a Atmel Atmega328P-AU and from checking out some ...
Mustansir Godhrawala's user avatar
0 votes
0 answers
28 views

Detecting OLED display refresh frequency using phototransistor

I am trying to detect the refresh frequency of an OLED display driven by an SSD1309 display controller. During the refresh cycle, each row of a frame is charged and driven for 65 DCLKS in a sequential ...
Joshua Dotson's user avatar
2 votes
2 answers
118 views

MCU slave receiver I2C shifts incoming data by one bit when replying with ACK

I am communicating with I2C/TWI between a MCU (Atmega328p) as Slave receiver and the raspberry pi 5 as master transmitter. I2C is at 100kHz configuration (the slower the Rpi5 can go). I have an issue ...
Christianidis Vasilis's user avatar
0 votes
1 answer
97 views

ATmega328p-A Schematic

I just finished designing my attempt at an ATmega328P-A board, had some trouble understanding how to program the MCU. The manual of the MCU didn't specify really well how, or I just didn't find the ...
dimpanas's user avatar
1 vote
3 answers
298 views

ATMEGA328 out of memory, but avr-size reports I still have a lot of space

I have a program written in C. I have 390 byte array defined and a long string value consisting of around 475 bytes. Now I hit a problem if I add more characters to the string value, around 30 bytes, ...
0x29a's user avatar
  • 481
1 vote
1 answer
130 views

7-segment 4-digit display ghosting

Currently I'm tinkering with my ADC project with my ATmega328. I asked my microcontroller educator how I can fix this issue with the ghosting. I thought it had something to do with frequency or the ...
DariShard's user avatar
0 votes
1 answer
160 views

ATmega328P ADC 4-digit 7-seg display

I've been trying to program an ADC with my ATmega328P, coding it in C++, it should show a 0 to 1023 value number, but it keeps showing random numbers when I move the potentiometer: 0001, 0039, 0014, ...
DariShard's user avatar
0 votes
1 answer
85 views

Novice, unable to burn bootloader to AtMega328P. Am I SOL?

I am completely out of my depth, and working on a gift for a friend. My assumption is that because I have literally no idea what I am doing, I missed a crucial step or connection. I ordered chips with ...
Мởṇṏсĺḕ Mᾶṇ's user avatar
0 votes
1 answer
138 views

Standalone ATmega328p not working

I designed a standalone ATmega328p board (like an Arduino Nano). I use an Arduino Nano as an ISP Programmer, I can set the fuse bits and flash the program to it. But the ATmega shows absolutely no ...
pomm es's user avatar
  • 11
1 vote
1 answer
349 views

How to program an ATmega328p using a USBasp programmer?

I'm learning to program an atmega328p using a usbasp programmer. I'm using this datasheet, page 2, PDIP pin configuration. The usbasp programmer I'm using is this. The armega328p chip I am using is ...
kovac's user avatar
  • 475
1 vote
0 answers
35 views

Flashing Atmega328p bootloader with connected SPI device in parallel

I'm designing a PCB with an ATmega328P (SMD) and two ADS1118 ADCs (also SMD) that will be connected to the ICSP pins of the ATmega328P. Will these two ADCs, in parallel with the MCU, pose a problem ...
electronics's user avatar
1 vote
1 answer
38 views

Cannot upload to Atmega328p twice in a row

I've successfully burned a bootloader to my Atmega328p via the SPI interface, and then used this CH340 and a level converter to successfully upload code to the chip. However, every time I upload code, ...
Gary Allen's user avatar
1 vote
0 answers
44 views

Where I'm wrong when importing From Arduino sketch into Atmel Studio 7, (about DHT11)

Atmega 328p is tested on a breadboard with LCD1602 and DHT11. I am programming this with SNAP MPLAB via Atmel Studio. On Arduino Uno everything is fine, but on the breadboard, DHT11 not responding. ...
zp60's user avatar
  • 11
2 votes
1 answer
88 views

Atmega328p - AD5423 SPI issue when using external crystal

I am programming AD5423 DAC IC with a atmega328p-AU microcontroller with SPI, using the MCU;s internal 8-Mhz crystal. The communication protocol between the two ICs is SPI and my code works as ...
Christianidis Vasilis's user avatar
0 votes
1 answer
83 views

How to connect BMP390 to arduino? [duplicate]

I have a bmp390 sensor and an official circuit from the manufacturer for connecting it to i2c, but there is a problem, the ...
Settings's user avatar
  • 129
1 vote
1 answer
94 views

ATMega328p wakes immediately after sleep

I'm having issues with my current AVR-C project that runs on an ATMega328p. After issuing the sleep command the chip wakes up again immediately. I want to wakeup with an external interrupt, but while ...
Julian F. Weinert's user avatar
3 votes
1 answer
271 views

Need help to understand an Arduino Capacitance-Meter program

There is a program for Arduino that without using any external component, measures value of an unknown capacitor in the range of 470pF to 18pF: https://www.circuitbasics.com/how-to-make-an-arduino-...
Meysam's user avatar
  • 73
0 votes
1 answer
54 views

How to fix a chain break? [closed]

There is a task, there is a MOSFET transistor that should, on command from an Atmega328p, close the circuits and supply power, but is it possible to somehow check this circuit for closure without ...
Settings's user avatar
  • 129
0 votes
0 answers
25 views

Designing ICSP pin header while SPI slave present?

Is this portion of my schematic accurate for designing an ICSP header while there is an SPI slave? The four SPI net labels also go to the respective hardware on my 328P. I have CS (where I believe NSS ...
1W0n_29's user avatar
  • 21
1 vote
1 answer
314 views

AVR ATmega328P wrong fuses set

I was programming on the AVR ATmega328P using the USBasp programmer. I uploaded the blink example but the LED was not blinking. Thus I went on changing the fuse bits to the one Arduino has. During ...
kam1212's user avatar
  • 669
0 votes
2 answers
413 views

Programming an ATMega328 while on a custom PCB

I designed and had made a custom PCB for a project I am working on. The PCB uses an ATMega328 chip that sits in a socket that is soldered on the board. Currently, to program the chip, I am removing ...
Thomas's user avatar
  • 111
0 votes
2 answers
60 views

burning the code to atmega328p

I am a bit confused regarding the code uploading process to the atmega328p. I have read a site where usb-ttl was used to upload the code. There is not bootloader uploaded on the atmega328p and the ...
kam1212's user avatar
  • 669
0 votes
3 answers
51 views

Making a custom Arduino

I am working on making a custom Arduino board but I have some confusions regarding that. I have seen all the documentations but am confused regarding the ICSP pins and the communication through the ...
kam1212's user avatar
  • 669
1 vote
1 answer
102 views

FIFO buffer in the ATmega328P

I have a problem in understanding the working of the FIFO buffer. The diagram of the USART in the datasheet does not mention the FIFO buffer, and it just gives the UDR register which acts as a ...
kam1212's user avatar
  • 669
3 votes
2 answers
586 views

Detecting a break condition over UART on ATmega328P

I'm implementing a protocol which begins with an 88 µs break (low) and uses an 8-N-1 configuration. The latter is easily set with UCSRnC, but is there a way to configure the UART hardware to detect ...
19172281's user avatar
  • 743
0 votes
2 answers
638 views

DHT22 issues at 3.3V - What else could I try?

I'm attempting to use an DHT22 at 3.3V for a very low power application - remote sensor unit with a very long battery life. Currently it's on a naked breadboard with a 328p. At 5V in a spare arduino ...
user2702772's user avatar
0 votes
1 answer
52 views

How to make a circuit which can give divided voltage to ADC and can send a trigger pulse to INT0 when I press a button?

I connected 4 buttons to the ADC module of AVR-ATMega328p with different resistor values, To know which button is pressed this ...
in.yssh's user avatar
  • 45
1 vote
1 answer
384 views

How do I measure distance of Ultrasonic Sensor HC-SR04 using the ATmega328P Timer Input Capture?

I am using an ATmega328P MCU with an 16 MHz external oscillator. I need to measure distance of Ultrasonic Sensor HC-SR04 using the ATmega328P Timer 1 Input Capture interrupt. I have to measure the ...
Pumbaa's user avatar
  • 25
0 votes
1 answer
83 views

Software serial not sending the first byte correctly

I implemented the following program to send data to a serial monitor.When I run it, I expect to see abcd but I always see ⸮bcd: <...
kovac's user avatar
  • 475
2 votes
2 answers
76 views

Microcontroller sinking current from another MCU

I have two microcontrollers, the beloved ATmega328p and an ATtiny85. The ATtiny85 does power management (toggling power to main MCU, get buttons clicks, and other things). The ATtiny85 disconnects VCC ...
Rokas Sondaras's user avatar
1 vote
0 answers
97 views

Not being able to write&read data from the 24C04N EEPROM using I2C

I have connected the 24C04N EEPROM to the ATmega328p like this - Image source - Google The only difference is I connected the ATmega328p on a breadboard using FTDI like this - Image source - This is ...
in.yssh's user avatar
  • 45
0 votes
1 answer
142 views

ESP8266 responds with gibberish and 'ready' to AT commands from C program

I have gotten the ESP8266 working by sending commands manually from the TTY. Now, I'm trying to connect to wifi using the following C program: ...
kovac's user avatar
  • 475
6 votes
1 answer
460 views

How does USART know which port to use for IO?

I'm trying to learn to use USART on an ATmega328P. I'm using this datasheet. I'm using the following code to echo characters I type on my terminal: ...
kovac's user avatar
  • 475
1 vote
1 answer
139 views

Uploading sketch to ATMEGA328 via FTDI with some pins set to HIGH logic

I recently changed my PCBA design so that the digital pins 4, 5, & 6, are set to HIGH logic by default (so I can use some switches on these inputs). However, now when I upload a sketch to the ...
Newbie's user avatar
  • 163
0 votes
0 answers
92 views

What are the control lines in the ATmega328P for?

I'm trying to understand the block diagram for AVR architecture in the datasheet for ATmega328P on page 9. In it, I see that instruction decoder is connected to control lines. What are they in terms ...
kovac's user avatar
  • 475
1 vote
1 answer
474 views

Understanding assembly code for LED blink with ATmega328P

I wrote the following program to turn an LED on and off at 1-second intervals: ...
kovac's user avatar
  • 475
0 votes
1 answer
114 views

Why is ENC28J60 getting as hot as 65°C?

I am working on an Ethernet adapter and I am using ENC28J60 as SPI slave an ATMEGA328P as SPI master. The adapter works fine, but ENC28J60 really gets hot, measured with infrared thermometer and it ...
salocinx's user avatar
  • 103
7 votes
2 answers
595 views

What is the '0x04' next to 'DDRB' in the ATmega328 datasheet?

I was trying to change the value of DDRB by its memory address with the following code: *(volatile byte*) 0x04 = 0b00100000; It did not work. I got the value 0x04 ...
luek baja's user avatar
  • 269
2 votes
2 answers
670 views

How do I measure a pulse width using the ATmega328P interrupts and timers?

I am using an ATmega328P MCU with an 8 MHz internal oscillator. I need to measure the pulse width of an incoming pulse. The frequency of this pulse is approximately 500 Hz. Once every 2 ms, one pulse ...
turqay mammadov's user avatar

1
2 3 4 5
8