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
0
votes
2answers
93 views

Can I use any digital component to avoid 7805 killing my microcontroller directly when its ground is disconnected (hence 12v goes to uC directly)?

My idea is to have an intermediate cheap component that will blow-up before my uC if the voltage goes above 5v from 7805 (or even some fuse, but I am not sure if a fuse will blow-up with over-voltage ...
0
votes
1answer
68 views

How to configure atmega 328 IO pins to reduce the power?

I am having a atmega328p for my home project. Consider the pins Pin B2 - connected to LDO enable. Output Pin D7 - MUX s0 Pin B0 - MUX s1 Pin B1 - MUX s2 Pin B4 - MUX s3 Pin c3 - MUX enable Pin B3 ...
1
vote
1answer
51 views

ATMEGA328P I2C Clock Issue

I have a custom designed CCA that uses an ATMEGA328P micro controller, a MCP4725 DAC (I2C interface) and another sensor (SPI interface). In my initial design all of these devices ran off of 5 V and ...
0
votes
0answers
53 views

FreeRTOS with ATMega328P

Im trying to run FreeRTOS on ATMega328P and with two tasks its works well, but when i put one more task, no one is scheduling, I got the return of CreateTask of all tasks created and is right, all of ...
0
votes
4answers
163 views

Why do my all Atmega328P chips stop responding suddenly in a 12v circuit with Zener diode?

I have noticed this strange thing where my atmega328p stops working and when checked through Arduino IDE or AvrdudeSS or ProgISP, they show programmer not in sync, rc=-1 initialization error (while ...
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 ...
4
votes
1answer
583 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 ...
1
vote
3answers
117 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 ...
0
votes
1answer
44 views

Why did my Atmega328p chips stop working?

I am fairly new to embedded programming. I bought some Atmega328P U chips (not Atmega328P-PU). I have two Arduino boards and the chips worked just fine, and were letting me upload sketches. One of ...
0
votes
0answers
76 views

AtMega328p and TCA9548 problem

I have a custom made PCB that has an AtMega328p MCU and 4 MLX90614 IR Sensors that are being interfaced by a TCA9548 I2C Multiplexer. When I first got my hands on the board I had 10k pull-up ...
2
votes
2answers
727 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
1answer
122 views

Selecting true crystal settings for 328P [7.3728 MHz]

I want to make a new board working with 115200 (gsm modem) UART. so I want minimum baud error rate. I look at https://cache.amobbs.com/bbs_upload782111/files_22/ourdev_508497.html table and decide ...
0
votes
1answer
165 views

How to lock an ATMega328P from cloning?

I was working with the Arduino IDE. I tried to find out from where a MCU can be locked so that nobody can make a clone from it. I found many answers describing something about lock bit. I realized ...
0
votes
1answer
37 views

What will happen to TLV1117 (5V / 3.3V) from reverse voltage?

There is a step-down DC / DC converter that receives 5V input and 3.3V output It powers the Atmega328P microcontroller. TLV1117 TI For the firmware of the controller, I will use the USBASP ...
0
votes
0answers
24 views

program upload circuit using CH340G ic

I want to make a circuit for upload program to Atmega328p-AU using CH340G. In CH340G ic there is a vcc and V3 pin. how I connect the V3 and Vcc pin? My power supply 3.7v.
0
votes
2answers
89 views

Power on Atmega

I want to design an alarm circuit using Atmega328 microcontroller. How much voltage supply to the IC will be better? In Arduino I see that 5v power supply used. For Atmega328 which will be better? 5V ...
2
votes
1answer
285 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 ...
0
votes
3answers
211 views

Voltage regulation for Atmega328p

I am designing a circuit containing two Atmega328p. First chip will drive TFT screen with 3.3 V linear voltage reg. Second one will drive BT module, couple of relays, two sensors, SD card module, and ...
0
votes
0answers
31 views

ATmega328p: Does SPI conflict with timers TC1, TC2 or interrupts PCINT2, PCINT0?

My code - based on my library MultiTrans - uses timers TC1 and TC2 as well as interrupts ...
1
vote
1answer
64 views

Using FTDI with AtMega328P@3v3,8MHz and RFM69

I am running an AtMega328P-PU at 3v3, 8MHz with external crystal successfully. I am able to burn the bootloader using ISP and flash the chip using FTDI and the clock seems right. The mega is ...
0
votes
2answers
169 views

HC-SR04 Distance Sensor Trigger Signal on 2.5V Voltage level gives no reading

I am using an Arduino on a breadboard setup with an ATMEGA328p MCU. The whole circuit is designed to work in a low-power state and is powered using a 3V (Nominal) voltage Coin Cell. The HC-SR04 is ...
0
votes
0answers
50 views

A sensor for jaw/mouth movements in a mask

The mask I'm trying to build will display different lighting patterns. The overall goal is to synchronize these patterns with a musical/dance performance, so there were two options: either hard-code ...
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 : * ...
0
votes
1answer
149 views

Generating a short pulse after a delay on ATmega 328/P

I am trying to use one of the hardware timers on the ATmega 328/p (arduino uno) to generate a short pulse some number of microseconds after receiving a pulse on an input. Currently my code looks like ...
2
votes
1answer
257 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 ...
0
votes
1answer
405 views

Can not flash atmega328p with usbasp

My usbasp was working fine.I could burn programme to atmega328p.But last night i wanted to cahnge the clockspeed by clock_prescale_set ( clock_div_t x ). after that it burned successfully and ...
0
votes
1answer
50 views

1602a LCD - Voltage drops to zero when both VSS and VDD are connected

I'm currently trying to connect a 1602a LCD screen to an ATMega328P MCU: As you can see, I use an Arduino Uno for power supply and as ISP. However, when I connect both the first (VSS) and second (VDD)...
1
vote
2answers
240 views

Half H-Bridge Driver

I'm working on a project to control power sideview mirrors in a car, with features like TildDown, that tilts some of the mirror down helping to park. The circuit is pretty simple, but I'm having some ...
0
votes
0answers
82 views

ATMega328P - DS18B20 temperature sensor returns incorrect temperature values

I'm using a Dallas DS18B20 sensor to measure temperature in conjunction with an AVR ATMega328P microcontroller (using this AVR C library to implement the code). Unfortunately, the value always returns ...
0
votes
1answer
62 views

Atmega328p ADC - value keeps returning zero when connected

I'm currently try to connect a DS18S20 temperature sensor to the atmega328p. I have wired AVCC and AGRD to the same power rail on my breadboard as normal VCC/GRD and AREF is not connected. When I try ...
1
vote
2answers
190 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
0answers
54 views

Serial.println using Registers in ATMEGA328P

I have worked with ATMEGA328P using Arduino libraries, but new to actual register level coding. To start with that, I have written code for basic Serial.print in ...
0
votes
2answers
201 views

LED strip driver using Standalone atmega823 and MOSFETs

I want to make a LED strip driver, using an atmega328 on a custom PCB. I was able to get it to work perfectly using an arduino UNO, with the mosfets connected on a breadboard. However, when I just ...
0
votes
0answers
34 views

atmega328p is not detecting on USBasp programmer after verify 0 error?

I was trying to burn my atmega328p board which is designed for some wireless application. The ICs atmega328p, esp8266 12f, and ADM7171 are using the same Vcc. Here the Power supply is connected to ...
0
votes
0answers
70 views

Atmega328p datasheet mistake “OCRA”

I was reading the atmega328p datasheet, and suddenly, i saw that a register is mentioned called "OCRA", on page 108 and page 160, which normally, should be register "OCR0A", which is widely mentioned ...
1
vote
1answer
206 views

ATMEGA328p-AU BootLoader

I have ATMEGA328P-AU chip, to burn the bootloader I used ARDUINO Uno Board as "ARDUINO as ISP" with setup Board: Nanno. I'm getting the following error. While looking for the solution I got ...
1
vote
2answers
90 views

328p-pu drawing too much current in sleep mode

I have a ATmega328p-pu and run it at 8MHz with the internal oscillator. I am executing some code and then send the chip to sleep. I deactivate the brownout and ADC before activating the sleep. I have ...
0
votes
1answer
28 views

Atmega328 ubrr value shifting issue for serial transmission

My doubt is about the way in which the baudrate value is written into UBRRn registers. For eg: Lets say i want to write the value 25 into UBBRn registers to configure the microcontroller to ...
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 ...
0
votes
1answer
74 views

Will leaving 1 of the 3 GND pins on the ATMEGA328p ungrounded cause any problems?

I am creating a circuit using an ATMEGA328P and i am unable to ground one of the 3 ground pins (other 2 are fine) due to limitations of my design. I have tested the IC with a multimeter and the pin ...
0
votes
1answer
61 views

Suggestions on wiring PCA9685 i2c + TB67H303 motor ic

I'm trying to design a circuit in order to use the TB67H303 motor driver with the ATMEGA328p and the i2c protocol by using the PCA9685 controller. I never used the TB67H303 and the PCA9685 chips ...
0
votes
2answers
52 views

LM2902 unity gain op amp, miss-wired

I am using LM2902 as a unity gain voltage follower to isolate measurements of a sensors voltage. ( datasheet: http://www.ti.com/lit/ds/symlink/lm2902.pdf ) the sensors i wan to measure operate at ...
1
vote
2answers
58 views

ATMEGA328 Serial input via ISR to buffer - buffer messed on printout

Using an ISR on the atmega328 to read a string ended by a \r from UART and echo back the readout string afterwards ...
0
votes
0answers
24 views

AT328 + CP2102(firmware update) + control

we used the AT328 be a microcontroller to control relays. But we want to use CP2102 to update the firmware, before we used the NANO be a bootloader to update the firmware to AT328. Is it possible to ...
0
votes
0answers
46 views

TPIC6C595D Q0 pin is always high

Good day everybody! So I have a LED clock circuit, which I designed, powered by an atmega328p xmini, and whatever I do the first pin of the shift register which does the current sinking (TPIC6c595D) ...
0
votes
1answer
93 views

Choosing a capacitor capacitance for a quartz resonator (ATMEGA328P)

I am designing a controller based on an ATMEGA328P-AU chip. For the chip, I provided an external crystal oscillator at a frequency of 16MHz. As a resonator I use YSX321SL His description refers to ...
1
vote
0answers
129 views

ATMega328P control servo motor speed with potentiometer

I'm trying to develop an application in atmel studio 7.0 which will allow me to control the speed of my servo motor with my potentiometer. Now, the problem is that I don't really know how to do that? ...
0
votes
1answer
142 views

(Noob question) Placing parts of a byte in different (parts of) registers

Background: I'm trying to get a gLCD working with an Atmega328p. I got it to work quite easily, but there was one catch: the library that I found, used portB for the datapins. This was unacceptable, ...
0
votes
2answers
72 views

Power Supply for Arduino on breadboard (ATMEGA328PU) from a car battery

I wanna power my Arduino on breadboard (ATMega328PU) from a 12V car battery. simulate this circuit – Schematic created using CircuitLab Is this safe ? What should I add more to make it a ...
-3
votes
3answers
474 views

Differene between DS3231sn and DS3231mz

Which one is better? DS3231SN have accuracy ±2ppm and the other one have ±5ppm.What is actually meant by the accuracy and what are the other differences.? What type of internal oscillators are used by ...