Questions tagged [atmega328]

The ATMega328 is the chip that is the heart of the Arduino Uno. It is popular also as a chip to use to create your own board. Since it is available in the through hole version, it can be placed on a breadboard easily for circuits.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
28 views

Help finding bug regarding MCP23S17 switching pin between input and output [closed]

I am making a circuit that a user will plug a 74lsXX chip into, and it will detect if the chip is an inverter, or gate, and gate, etc., or broken. All of the pins in the circuit are conveniently ...
0 votes
0 answers
45 views

Can't get timer 2 to work on PD3 [closed]

Whenever I try to run the PWM code on PD6 or PD5 with timer 0, they work properly. But when I switch to PD3, which works with timer 2, it doesn't work. PD3 is the pin I have to use as I have an LCD ...
1 vote
4 answers
2k views

What does avrdude: Device signature = 0x000000 mean? Faulty wiring? Software issue? Incorrect tutorial?

I followed this tutorial a couple of times and when I clicked on bootloader I get this error: avrdude: Device signature = 0x000000 To see the configuration file click here. Why do I get this error (...
0 votes
0 answers
32 views

How can I upload a sketch to atmega328 using FT231XS-R?

I have found several posts detailing exactly what I'm trying to do, and I am at my wits end. Below is a picture of the schematic I am using: I know for a fact that the USB-UART controller is working ...
0 votes
1 answer
47 views

ATmega328 drop-in replacement with more flash memory

Is there a ATmega328 drop-in replacement with more flash memory? Needs to be 28 pin DIL to fit the socket. Alternatively, is there a board that has the exact dimensions and pins as an Arduino UNO, but ...
1 vote
1 answer
140 views

Difference between FreeRTOS libary (AVR_ATmega328PB_Xplained_mini_GCC) Versus FreeRTOS compatible for Arduino boards from Richard barrey

I am researching about different IoT development boards and found that espressif uses IDF framework. When looked at the source code it uses FreeRTOS libraries. I have Arduino Uno and i wanted to use ...
3 votes
1 answer
140 views

Connecting nRf24L01 to Atmega328PU with external 8Mhz Crystal problem

I am trying to fix the problem of communicating between two nRf24l01+ together, one connected to Arduino Uno and another connected to Atmega328PU with 8Mhz external crystal. The bootloader on ...
1 vote
2 answers
3k views

Serial printing from flash memory (F() macro, PROGMEM, sprintf_P, SPTR)

I have been testing various techniques on an Arduino Uno for serial printing from flash memory instead of RAM. At the same time, I have been using the freeMemory() function from Adafruit. I created a ...
1 vote
1 answer
93 views

Atmega Millis with Quartz crystal

I followed https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard this tutorial to program my Atmega 328p to run on a breadboard with a 16 MHZ Quarz crystal and two 22pF capacitor. I want to program a ...
0 votes
1 answer
281 views

IDE will not upload to ATTiny88

I was successfully compiling sketches and uploading to various MCUs, including the ATTiny88. Suddenly the IDE quit compiling and complained of various missing compilers. I found and corrected an ...
5 votes
3 answers
18k views

ATMEGA328P-U vs ATMEGA328-PU

On my Arduino UNO the chip part number is ATMEGA328P-U, i recently bought a ATMEGA328-PU to make a standalone Arduino. realized the part number differences after receiving the package... I noticed ...
3 votes
1 answer
168 views

The gateway is not working in Arduino EthernetENC

I am using ENC28J60 and EthernetENC library to connect an Arduino UNO with ATmega328 to the network. Everything works fine within the local network, but outside of it, I cannot ping the device. What ...
0 votes
4 answers
120 views

Can arduino be used in industrial projects?

I'm developing an industrial project and my programming knowledge is limited to arduino. I'm planning to use either Atmega328 or STM32F103C8T6 chip in my pcb and to program it using arduino IDE. My ...
2 votes
2 answers
151 views

Barebones AVR - Connecting RESET pin to Vcc

I want to build my first barebones AVR circuit. I plan on NOT having a RESET button. For this reason, is it valid if I connect the ATMEGA's RESET pin to Vcc directly? What I mean by this, is that in ...
1 vote
2 answers
121 views

interface pcf7991at to arduino

I wanted to try to interface the pcf7991at with arduino, I assembled the pcb containing the pcf7991at following the diagram shown in the datasheet. I saw that a frequency of 125khz must go on the CLK ...
1 vote
0 answers
28 views

Mirroring PWM input on a pin + Motor Encoder

I am interested in hooking up a nano to an RC receiver. I want the nano to mirror the PWM input and output on another pin when a specific command is given via serial. I also want to send the received ...
0 votes
2 answers
200 views

What processor can I replace on behalf of ATMEGA328P, to get more processing power for machine learning in UNO

I wanted to do a machine learning project in Arduino UNO R3. But I came to know that the processor(ATMEGA328P) isn't capable of supporting the processing power needed for machine learning. So is there ...
-1 votes
2 answers
78 views

Atmega 328pu on breadboard. What to choose in order to upload code with ftdi converter

When I program atmega328 PU on breadboard,vwhat programmer do I have to use and what arduino board type I have to choose? I am trying this with ftdi converter I have already done the connections and ...
1 vote
1 answer
391 views

Problem with using PubSubClient, the "callback" function doesn't seem to work correctly

I have a program that communicate between a esp8266 and a atmega328 using Serial, the esp8266 will connect to a MQTT server running on local network, and publish/subscribe to some topics. In the ...
2 votes
1 answer
93 views

Curious Collision between OneWire and RadioHead

The code below runs on an Arduino Pro Mini (8MHz 328p) sending temperature readings using an inexpensive ASK transmitter. I use OneWire to read the DS18B20s, and RadioHead to manage the radio. The ...
1 vote
0 answers
34 views

Atmega328P constantly restarting when defining a function

I wanted to make a simple led on/off program using USART interface. When the code doesn't have any functions other than main it runs fine, however Arduino keeps resetting when one is included. At this ...
0 votes
1 answer
64 views

ATTiny88 missing pulses - maybe

I have been given to understand the ATTiny88 is very similar to the Arduino Uno / ATMega328 MCU. There does not seem to be a tag for the ATTiny88, so that is why I chose the tags I did. I do not ...
1 vote
2 answers
232 views

Timer 1 "Set on Compare Match" in Normal Mode - Not working

I'm using the hardware timers on the 328 for phase angle control of a triac with zero-crossing detection. I am encountering some strange behavior with the "Set on Compare Match" feature not ...
6 votes
3 answers
9k views

How to deep sleep ATtiny/ATmega (to run for years with batteries) but still detect a button press?

Question (TL;DR): what is the optimal method to deep sleep (to run an ATtiny45 or ATmega on batteries for 1+ year) but still be able to detect a button press? Is it possible to deep sleep until a ...
13 votes
3 answers
7k views

I got a missignatured ATmega328-PU. How can I fix that?

Sometime in the past, I was burning bootloaders on a fresh batch of four ATmega328-PU using the Arduino IDE (notice there's no P after 328 - it's the slightly cheaper non-picopower version of the MCU, ...
2 votes
3 answers
4k views

Is the LGT8F328P legal?

Since some months, everyone can buy a board with this IC. It is compatible with the ATMega328 and has some features like 12bit ADC (instead of 10 bit), DAC, unique ID and also 32MHz. But I can't ...
0 votes
1 answer
367 views

Arduino nano timing precision

How precisely can an Arduino nano be timed? The project I am working on needs two Arduino nano to work synchronously. Arduino one have to activate a relay after 2700 sec and Arduino two have to ...
1 vote
1 answer
79 views

How to load scal factor external to the code?

We know that, we need calibration factors (scale factors) to read current sensor data (ACS758) to arduino. I am also using voltage reader using voltage divider circuit for my project. I need to build ...
0 votes
2 answers
568 views

SoftwareSerial will not read all of the printed string when calling readString()

I have an Arduino UNO and an ESP32 that need to communicate to each other using SoftwareSerial. The problem I am coming across is that when I call readString and print it out using Serial, it will not ...
0 votes
2 answers
221 views

Is it possible to program an AVR chip (atmega328p) via i2c?

Currently I am using avrdude and I'm programming my atmega328p chip via the spi pins by pulling the RESET pin low (spidev programmer). In my project I'm using predominantly i2c and this the only place ...
-2 votes
2 answers
1k views

Sketch uses 33218 bytes (102%) of program storage space. Maximum is 32256 bytes?

I need to upload code on atmega328 wihout bootloader https://github.com/EasyOne2030/test but see Sketch uses 33218 bytes (102%) of program storage space. Maximum is 32256 bytes ?
0 votes
2 answers
695 views

Replacing large lookup table with switch statement

My arduino needs to take a 14-bit number and convert it to a 10-bit number. Can't use a formula for it since the data is quite random. So I created a lookup table with 2^14 elements, each containing a ...
8 votes
3 answers
7k views

What is the rise time of an output pin of atmega328 changing its state?

I've already searched a lot and didn't found the answer. Also, I don't have an o'scope. Anyone can help me?
7 votes
7 answers
14k views

Arduino 16 MHz with only 3.3V?

Now I have these Arduino Pro Mini from Sparkfun. They are the latest version that I know (yeah, it's the one that have those horrible misaligned pins). Now they are designed around the ATmega328P and ...
1 vote
1 answer
144 views

Keep 5V on while sleep with LowPower library [closed]

Is it possible to keep the 5V on, while putting the Arduino (ATMEGA328P) in sleep more, using LowPower library? I'm trying to use this HAT: https://spellfoundry.com/product/sleepy-pi-2-usb-c/ to ...
0 votes
1 answer
355 views

Adding L293D motor shield to Breadboard

Anyone knows how to attach the l293D motor driver shield on a breadboard? I need to put the shield on top of a breadboard and then use an Atmega328P as the main way of controlling it. Than you :)
0 votes
0 answers
38 views

Writing to ADMUX on 3.7V from battery restarting chip

Given: arduino nano (atmega328P) with nrf24l01. What am I trying to do: Measure battery drain. What am I doing for that. So I made a small research of how could I measure the battery voltage without ...
0 votes
1 answer
83 views

Problem with character concatenation algorithm in matrix led

good afternoon, I am making a 7x10 led matrix in which I use a CD4017 to handle the 7 rows and 2 cascaded shift registers to handle the 10 columns. I first tried a programming to turn on my entire led ...
1 vote
1 answer
110 views

Help with Arduino sleep and watchdog timer interrupt

I want to use Arduino's sleep and wakeup functionality but have hit a roadblock and can't seem to get past it. As I am just prototyping for a final system, I cannot use the LowPower library to ...
-2 votes
1 answer
219 views

1Hz & 32Hz from 32.768 kHz on ATmega328P at 8MHz & DS3231 32K

I have a 32.768 kHz signal at the ATmega328P input. I need to get 2 signals from this signal: 1Hz and 32Hz. How well will it work? How to do this with a ATmega328P Timer/Counter? What gain will the ...
1 vote
2 answers
1k views

Call functions of one class from another class - Callback

I am new to C++ & I need to call functions of one class from another class. And so that the classes do not know anything about each other. How to do it in Arduino environment? class Encoder { ...
0 votes
0 answers
40 views

How does C2 work on the ATMega328P?

What is the purpose of C2 on this schematic below? How does it work when the microcontroller is being programmed?
1 vote
0 answers
180 views

Is it possible to use Nano with mblock and oldbootler?

I've old Nanos that to program (upload) with Arduino IDE I have to select "ATMEGA328P Old Bootloader". The programming is via the standard Nano USB cable, and I need the CH340 driver under ...
0 votes
2 answers
554 views

Standalone ATMega328 - do I need to burn the bootloader?

I want to get an ATMega328 off of the Digi-Key, and use it like an Arduino (without requiring the whole Arduino board). When it comes to programming, do I need to do anything special like burn the ...
0 votes
0 answers
90 views

Cannot upload sketch to DFRduino nano

I previously succeed in uploading the code to DFRDuino Nano (Arduino Nano Compatible) (with wrong digital pins) but after changing pin I cannot upload it again. From the document, I changed back the ...
6 votes
5 answers
1k views

How do I convert Arduino to an ATmega328P-based project?

I have an Arduino board where I am using some of the peripherals like LCD with I2C. Now I want to convert this Arduino-based circuit to an atmega328p based circuit, i.e. atmega328p with LCD and I2C. ...
3 votes
1 answer
124 views

Why am I reading only zeroes from PORTB?

I am using a custom Arduino Nano compatible board with an Atmel 328P. I am externally changing the values applied to several pins on PORTB. I expect to be able to read the values of these pins (low ...
0 votes
2 answers
930 views

How does erasing the EEPROM work?

The datasheet for the ATmega328P contains this table, which describes bits 4 and 5 of EECR: EEPM1 EEPM0 Programming Time Operation 0 0 3.4ms Erase and write in one operation (atomic operation) 0 1 ...
2 votes
3 answers
3k views

Change the fuses of an Arduino Uno (can an Arduino Uno change its own fuses?)

For now, I'm using an Arduino Uno alone including its 328p (no other external chip to program). I would like to change its fuses to internal 8 Mhz clock (because then I'll move the 328p out of the ...
1 vote
2 answers
50 views

Can we use more than one timer when programming an Atmega32/16?

I tried to do a simple program using the ATmega16 microcontroller, the program is to toggle two LEDs the first one by using timer0 interrupt and the other using timer2 interrupt.

1
2 3 4 5
10