Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

81
votes
3answers
74k views

Have I bricked my Arduino Uno? Problems with uploading to board

I can't upload sketches to my Arduino Uno. Have I "bricked" it? What steps can I take to work out what is wrong? What can I do to fix it?
9
votes
1answer
13k views

How do interrupts work on the Arduino Uno and similar boards?

Please explain how interrupts work on the Arduino Uno and related boards using the ATmega328P processor. Boards such as the: Uno Mini Nano Pro Mini Lilypad In particular please discuss: What to use ...
11
votes
2answers
8k views

Put ATmega328 in very deep sleep and listen to serial?

I have investigated the sleeps options of the ATmega328, and read a few articles about it, and I would like to understand if there are more options. So I would like to get as low current as possible, ...
3
votes
2answers
804 views

Timer2 “Clear OC2B on Compare Match” not working as expected in CTC mode

This is a follow up to my previous question. I have Timer2 in CTC mode, with TOP=OCR2A set to 150 (with a prescaler of 8, giving a 75us timing interval). The datasheet states that setting COM2B1 to ...
1
vote
2answers
630 views

How to concatenate strings

I am new to the Arduino platform so please bear with me. I have a program to display rolling text on a LED matrix which is for the Tinyduino platform #include "Charliplexing.h" #include "Font.h" #...
6
votes
3answers
4k views

ATMega328P-PU and 328P-AU

im planing to make my very own arduino design based on the Arduino PRO mini. I picked this board instead of the UNO mostly because it's way more simpler compared with the UNO since the USB-to-Serial ...
0
votes
2answers
159 views

How do I replace a burnt atmega328 with a new atmega328(bootloaded) in arduino?

I have an arduino UNO with atmega 328 whose microcontroller got burnt. I bought a new atmega328. I have another working arduino with atmega8. I followed the instructions in http://arduino.cc/en/...
0
votes
5answers
413 views

How would I use Arduino microcontroller separately?

I'm learning Arduino. I use Arduino Uno board with ATMEGA328-PU. I tried basic codes like LED blink, control of DC motor etc. Arduino board is used only when we program microcontroller, right? I mean, ...
3
votes
1answer
2k views

Using an Arduino board to program an AVR

I think the arduino board is awesome. Though I'm not interested in the library and IDE at all... Is there a way, to use an AVR 328p, as you normally would, on an arduino board? I like how arduino's ...
3
votes
2answers
521 views

Can a timer be used in both CTC and (fast) PWM mode simultaneously?

I would like to generate a sequence of pulses of varying lengths in the range of 0-100us, so that from the start of one pulse to the start of the next there is a delay of 100us. I have set up timer0 ...
5
votes
1answer
555 views

Is my ATmega broken, and would replacing it with another break that one, too?

I was communicating between my computer and my Arduino Uno R3 through Bluetooth using this Bluetooth module. The connector I use has a red wire where it connects to GND, and a black wire where it ...
3
votes
2answers
2k views

Atmega328P-PU: Programmer is not responding

Few days ago, I built my own custom Arduino on the breadboard. It is built according to tutorial on http://www.crash-bang.com/resource/breadboard-arduino/. The Atmega328P-PU is already burned with the ...
3
votes
4answers
5k 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 ...
2
votes
1answer
679 views

Vcc measurement with internal 1.1V reference fails on 3.3V powered Atmega328

I need to monitor a battery plugged to an ATmega running on standalone mode. I use the "ATmega on a breadboard (8 MHz internal clock)" bootloader. More info here When the ATmega is powered with 5V ...
2
votes
2answers
12k views

Stable frequency generation

I'm trying to work out the best way to generate a stable frequency with my Uno R3 I'm using interrupts to generate an approximately 40KHz frequency which drives some ICs/MOSFETs to effectively ...
1
vote
1answer
744 views

Nano clone not working over USB, no data, no power, but can power via Vin (CH340 chip? schottky diode?)

My quite new Nano clone (ATmega328P + CH340G) suddenly stopped working. Plugging it in with USB did not light up the LED(s) nor did it get detected by my machine. I looked it up, and found some how-to'...
1
vote
1answer
408 views

Timer2 Compare Interrupt not working as expected

To get this out of the way first: I have already looked at "Timer2 does not work as it should" and "Timer2 “Clear OC2B on Compare Match” not working as expected in CTC mode" but have not found the ...
1
vote
2answers
982 views

Aduino 7 segment dice project

I am struggling with the code that I should write for my project. I finished my breadboard but I have never learnt programming before so I cannot write the program for the dice. My project is to make ...
1
vote
1answer
70 views

redefining delay and delaymicros as personal function

Is it possible to redefine delay and delaymicros function with #define ? I want to use timer2 interrupt instead of these. Something like this: #define delay(unisgned long ms) countMicros(uint16_t ...
0
votes
3answers
162 views

Why atmega168/328p starts to reset?

First we set fuse bits: avrdude -c usbasp -p atmega328p -U lfuse:w:0xFF:m -U hfuse:w:0xDF:m -U efuse:w:0x07:m # same for atmega168 In the following examples we use the following commands to compile ...
0
votes
1answer
215 views

Running Arduino code for Bluefruit LE on bare ATMega328

I need to hook up Bluefruit LE Breakout (nRF8001-based) to ATMega328 chip (to use it as wireless UART), and it seems like the library provided is for Arduino. What I have is just bare ATMega328 (note ...
0
votes
3answers
429 views

Extending EEPROM life

I'm working on some software using an Uno (ATmega328P). I have a stage byte that can be 1 of 5 values (0-4) in my code and it will increase by 1 every 2.5 hours. If I lose power I need to ensure that ...
0
votes
3answers
2k views

Feasability of flashing Arduino UNO r3 with teensy firmware for HID (keyboard) emulation purposes

I've been working on a DIY keyboard project I have all the hardware designed and now its time for the code. For the microcontroller, I'm sort of locked into an Arduino UNO r3 as I already have it ...
0
votes
1answer
328 views

LCD library and timer2 CTC interrupt not working together

I want to set up real time counter along with lcd functions from LiquidCrystal library. But they don't work together. However, they work fine separately. The code is working by itself, but by ...
0
votes
0answers
560 views

Unable to reset arduino with RESET pin

I am using a custom built arduino UNO for some personal projects. I am using a custom optiboot bootloader given by Nick in this post. This was done to prevent the three LED flashes on digital pin 13. ...
0
votes
2answers
481 views

Arduino analogWrite source code explanation

The source code for the analogWrite function looks like this: void analogWrite(uint8_t pin, int val) { ... sbi(TCCRnA, COM0x); OCRnx = val; ... } Where n is which timer (0, 1, 2...) ...
-1
votes
1answer
319 views

transmit a sequence of bit using arduino uno [closed]

How do i code to transmit a sequence of bit using arduino uno?My project is about a transmitter and a receiver.Arduino as the transmitter and an application as the receiver.Light sensor will detect ...