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.
509 questions
0
votes
1
answer
50
views
Send uint32_t over i2c from attiny85 slave to atmega328p master
I run into an issue with querying a uint32_t with an atmega328p master from an attiny85 master.
I have put both codes below.
I did run the equivalent code for just sending a uint8_t and all works ...
-2
votes
2
answers
117
views
Trying to program atmega328p-an via arduino leonardo isp
a friend of mine gave me broken hw-308 (chinese meter).
https://besomi.com/media/catalog/product/t/m/tmet0006-1.jpg
Atmega chip was broken so i replaced it with the new one i bought recently. Now i ...
1
vote
1
answer
84
views
Generate all frequencies between 5 and 8 kHz in steps of 1Hz
Is it possible generate all frequencies between 5000 and 8000Hz, 1Hz in between with an ATmega328?
When I create a c-program outside the Arduino IDE to calculate the frequencies with the formula ...
-1
votes
1
answer
103
views
Reasons for an ATmega328P Nano SuperMini USB-C board not being recognized by a PC/Mac? [closed]
I recently got two of these ATmega328P Nano SuperMini USB-C boards but none of them is being recognized by my PC or Mac.
I'm using the old bootloader setting in the Arduino IDE 2.3.6, CH340 drivers ...
1
vote
2
answers
97
views
Unwanted toggle on OC1A
The code below for the ATmega328P (Arduino Pro Mini 5V @ 16 MHz) produces a periodic sequence on timer1 pins OC1A and OC1B:
#include "Arduino.h"
// For Arduino Pro Mini 5V @ 16 MHz
// ...
1
vote
0
answers
79
views
FS1000A transmitter and MX-RM-5V receiver not working
I'm new to Arduino development. I use Arduino Nano v3 ATmega328P (Old Bootloader). I assembled 2 small boards, one of which is a transmitter with three buttons, and the second is a receiver with three ...
1
vote
2
answers
100
views
Translating PIC PWM settings to ATMega328P
I'm trying to get some C code that runs on a PIC18F, working on an Arduino '328P. It uses an 8-bit timer, PWM, and a LUT to generate sine waves. I hope to get it going using Timer2 on a Nano.
The PIC ...
-1
votes
1
answer
160
views
Unable to upload code Atmega328PB-MU
I am unable to upload any code to my Atmega328PB-MU microcontroller. However I could upload the bootloader just fine. Here is my custom board to upload the bootloader. As you can see I use a adapter ...
7
votes
2
answers
3k
views
Finite loop runs infinitely
To gain better understanding of both Rust and Arduino (Uno), I'm trying to write direct hardware code for Arduino in Rust. Here's a very simple LED blink example, that I've tried to write.
I've made ...
4
votes
1
answer
354
views
ATmega328PB Sleep Mode Current Consumption
I am using an ATmega328PB to run an RF module. When testing sleep mode current consumption, I noticed it was much higher than I expected. I took off all unnecessary components. The only things in the ...
2
votes
1
answer
292
views
Hardware serial baudrate inconsistent between Arduino nano and standalone 328P
I have a 328P (328P-AUR to be specific, [link]), and in the schematic below is how I've implemented it to a PCB:
Uploading a program works fine, but I hink there is an issue with the clock source, ...
3
votes
1
answer
93
views
Is it possible to use an already working Barebones (328P) via FTDI to load a bootloader onto another 328P?
When testing / developing a proto type using a barebones board with 328P, I usually add a Serial to TTL adapter, which then allows me to modify and upload code as well as being able to the use Serial ...
2
votes
1
answer
752
views
Emulating Arduino Uno with QEMU: interrupts do not work
So I wrote this code for Arduino Uno:
// file qemu.ino
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(millis());
}
And then compiled and uploaded it to the real ...
3
votes
1
answer
433
views
I can't upload my sketch to Arduino Uno using avrdude
I have already spent a couple of days by trying to upload a sketch onto my Arduino Uno R3 board and now it's time to give up, so I'm trying to ask some more experienced developers.
My hardware and ...
-2
votes
2
answers
88
views
Physically passing through a pin to access another [closed]
I would like to know about physically passing through a pin in order to get to another. For instance, if I have a sensor on one side of an ATMEGA328P or ESP8266 (Wemos D1 Mini) yet need to connect to ...
1
vote
1
answer
234
views
Is it safe to leave an ATmega328PB's RX and TX pins unconnected?
I am using an ATmega328PB and was looking at Arduino's and others' schematics that use it. All schematics I've found use a serial chip to communicate between USB and TX & RX. However, I do not ...
0
votes
1
answer
282
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 ...
0
votes
4
answers
313
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 ...
4
votes
1
answer
364
views
Connecting nRF24L01 to ATmega328PU with external 8 MHz crystal problem
I am trying to fix the problem of communicating between two nRF24L01+ together, one connected to an Arduino Uno and another connected to an ATmega328PU with an 8 MHz external crystal.
The bootloader ...
2
votes
2
answers
537
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
0
answers
42
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 ...
1
vote
2
answers
387
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
votes
2
answers
150
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
1k
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 ...
0
votes
1
answer
772
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 ...
3
votes
1
answer
360
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 ...
1
vote
0
answers
61
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
146
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
630
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 ...
0
votes
1
answer
967
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 ...
0
votes
2
answers
1k
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
738
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
1
answer
193
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
votes
2
answers
3k
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
0
answers
58
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
118
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
2
answers
2k
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 {
...
-2
votes
1
answer
314
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 ...
0
votes
0
answers
61
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
356
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
2k
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
194
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 ...
3
votes
1
answer
208
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
2k
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
1....
1
vote
2
answers
115
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.
0
votes
0
answers
77
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 ...
1
vote
1
answer
256
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 ...
1
vote
0
answers
163
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 ...
2
votes
1
answer
646
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, ...
0
votes
1
answer
151
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 ...