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
0 votes
4 answers
97 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 ...
vignesh vignesh's user avatar
3 votes
1 answer
120 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 ...
Jon depoy's user avatar
2 votes
2 answers
112 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 ...
user1584421's user avatar
  • 1,371
1 vote
0 answers
27 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 ...
FourierFlux's user avatar
1 vote
2 answers
86 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 ...
Gastone Krankenwagen's user avatar
-1 votes
2 answers
67 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 ...
Alexis Tsetsonis's user avatar
1 vote
1 answer
265 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 ...
J. C. Stark's user avatar
0 votes
1 answer
195 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 ...
Leslie Rhorer's user avatar
3 votes
1 answer
128 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 ...
ArgusLibovski's user avatar
1 vote
0 answers
33 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 ...
L1RG0's user avatar
  • 19
0 votes
1 answer
57 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 ...
Leslie Rhorer's user avatar
1 vote
2 answers
152 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 ...
saustinp's user avatar
0 votes
1 answer
260 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 ...
Lawliet's user avatar
  • 183
0 votes
2 answers
416 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 ...
Primitive's user avatar
0 votes
2 answers
164 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 ...
php_nub_qq's user avatar
2 votes
1 answer
88 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 ...
Eric Nelson's user avatar
-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 ?
one next's user avatar
0 votes
0 answers
37 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 ...
user10160994's user avatar
0 votes
1 answer
76 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 ...
Lucio Mazzini's user avatar
1 vote
2 answers
847 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 { ...
Andre's user avatar
  • 27
-2 votes
1 answer
183 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 ...
Andre's user avatar
  • 27
0 votes
0 answers
38 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?
RGB Engineer's user avatar
1 vote
0 answers
131 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 ...
pathfinder's user avatar
0 votes
2 answers
332 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 ...
RGB Engineer's user avatar
0 votes
0 answers
86 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 ...
CoffeePlease's user avatar
3 votes
1 answer
98 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 ...
Joe's user avatar
  • 33
0 votes
2 answers
737 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 ...
glibg10b's user avatar
  • 297
1 vote
2 answers
44 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.
Ebraheem Ali Abd Al-Maksod's user avatar
0 votes
0 answers
56 views

Can't pair two HC-05 (Master - Slave)

I want to connect two HC-05 modules, one master and one slave. So to that I need to access 'AT Commands'. Theoretically, I just needed to upload an empty code, and then connect the module to the ...
Bikke21's user avatar
1 vote
1 answer
107 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 ...
phizaics's user avatar
1 vote
0 answers
77 views

ATmega 328 Bootloaded, but Cannot Upload

I have been working on a project that I program using the ATMEGA 328p inserted into an Arduino Uno, and then remove it to put it on my breadboard. I now have realized how inadvisable this is, since I ...
Jenna Hebert's user avatar
2 votes
1 answer
330 views

Arduino Nano Atmega328P not sleeping with either <LowPower> or <avt/sleep.h>

I'm working on a battery powered Arduino Nano project. I really need it to save power for hours on end, so I turned to Arduino LowPower Library and avr/sleep.h to do the job. However, whatever I do, ...
Santanor's user avatar
  • 123
0 votes
1 answer
86 views

Safely extend TCNT1 / ICR1 to 24 bits using TOV1

I'm hoping to time external events on a '328p Arduino that will occur slowly enough that they'll overflow the 16-bit counter TCNT1. In a different scenario I'd prescale the counter, but I need the ...
Jim Mack's user avatar
  • 237
1 vote
1 answer
467 views

Interval timer on Arduino: Doubt about TimerOne library

I want to synchronize a timer interrupt from a button is pressed. I want to read a button state 3 seconds later from the first pulse moment (to identify long pressed button, 3 seconds for this example)...
Juanma's user avatar
  • 113
2 votes
0 answers
279 views

Why can't an Arduino/ATmega328 act as an SPI slave at anywhere approaching the maximum speed claimed in the datasheet?

The ATmega328 datasheet claims a maximum SPI slave speed of Fosc/4. For a chip clocked at 20MHz, that would be 5Mbps. However, my tests show that even with no processing whatsoever in the interrupt (...
Infinity Computers's user avatar
1 vote
1 answer
392 views

Uploading to an external Atmega328P with a clone UNO R3 with soldered chip

As a complete newbie, after much looking for the best bargain, I ended up buying one of these UNO R3 clones, without realizing it had the chip soldered on the board. It looks like this: It works OK ...
Pere's user avatar
  • 121
2 votes
2 answers
107 views

Trying to understand the bottleneck of sensor sampling rate

Lets say I have a sensor connected to Arduino Uno Rev3's I2C Bus. I am reading the sensor output and using Serial.print() to send the sensor reading back to a my laptop. I am trying to understand the ...
Quazi Irfan's user avatar
2 votes
1 answer
104 views

Will the pro trinket gamepad library work on an Arduino Uno?

I have an Arduino Uno and I wanted to know if the pro trinket gamepad library works on an Arduino Uno since both have same atmega328p CPU chip.
Kushagra Kumar Singh's user avatar
2 votes
1 answer
70 views

SparkFun RedBoard PTH Kit wrongly configured hardware

I have a SparkFun RedBoard PTH Kit. It's not made by SparkFun, but by https://inmotion.pt (that doesn't exist anymore). I soldered it, and bought a FTDI adapter, but when I try to upload the blink ...
Ayo Reis's user avatar
  • 121
2 votes
1 answer
471 views

Arduino not rebooting with watchdog enabled

I have a custom board that is switching an inductive load through a 10A@230V ac relay. Due to a poor design, voltage spikes are causing the board to reboot from time to time (brown-out, watchdog and &...
Jvila's user avatar
  • 21
1 vote
3 answers
708 views

Power saving configuration of unconnected pins

By default, all Arduino (ATmega328P) pins are configured for input without the internal pull-up enabled. This default seems to come from the AVR microcontroller itself. When it comes to saving power - ...
maxschlepzig's user avatar
0 votes
1 answer
66 views

Where does the 5v Output power on the Arduino uno come from?

I am wondering where the extra 5v output power on the Arduino uno come from. Is it directly from the atmega328 microcontroller or from the external power source (usb or 9v battery). Thanks.
Glenn Krause's user avatar
0 votes
1 answer
48 views

Bootload from a Nano to an ATMega328 without a crystal

I have a program to load from a Aduino Nano as ISP to a ATMega328p chip that will have an internal clock at 16M, but I don't have a crystal handy. Is there a way I can not have to buy a crystal? What ...
B7th's user avatar
  • 167
2 votes
1 answer
234 views

Arduino data-types

(Im new to the arduino side of stackexchange). Im working on a worksheet for to begin with arduino. I have prior experiences working with arduinos, but problem is new for my field of expertise. Any ...
UnfreeHeX's user avatar
0 votes
1 answer
152 views

Procedure for changing frequency of Nano or similar

I need to get interrupts at one of three specific rates: 1920, 2000, and 2400 per sec, at a fairly high precision (~10 ppm). I've asked about this on Electronics but I think here might be more ...
Jim Mack's user avatar
  • 237
0 votes
1 answer
294 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 :)
August Exner's user avatar
5 votes
2 answers
635 views

Powering Atmega328p from 4.5V

I want to use Atmega328p controller to handle some very simple signals. I'm using the chip and not the whole arduino board because it is a lot cheaper. The problem is that chip itself doesn't have ...
Mirakul's user avatar
  • 75
2 votes
0 answers
152 views

Stand alone Atmega328p-au

I'm trying to make a standalone arduino board with an OLED display using an Atmega328p. I never tried to make such a board using SMD components. I've soldered everything together except the OLED ...
Aerandir's user avatar
0 votes
1 answer
199 views

Two-Wire Interface (TWI) Frequency and SMBus Compatibility

Have I understood the ATmega328P datasheet correctly regarding the TWI clock frequency? From §21.5.2 Bit Rate Generator Unit, the TWI clock frequency is calculated as follows: Then solving for TWBR: ...
tim's user avatar
  • 699
2 votes
1 answer
75 views

Interrupt takes longer than expected [closed]

I am trying to write a delay function in C, which should take 0.5 seonds then carry on. I am aware that there are libraries for this purpouse, I want to make it myself. #include <avr/interrupt.h>...
ibroketheinternet's user avatar

1
2 3 4 5
10