Questions tagged [atmega]

ATMega is a family in the AVR series of Atmel microcontrollers. This is the main microcontroller of the Arduino prototyping platform. Please Specify the specific part number in your question.

Filter by
Sorted by
Tagged with
0
votes
3answers
170 views

atmega timer strange behavior

I'm using atmega8 running at 1MHz. I wrote a function that counts the milliseconds and it was working flawlessly. However, when ...
0
votes
1answer
501 views

atmega328p watchdog keeps restarting

I have AVR Atmega328p which I want to blink for 5 secs every 16 secs (to test the watchdog interrupts). I have the following code, which keeps restarting, and the last line is: ...
1
vote
1answer
99 views

Atmega328 and Servo on same suppply

I currently am working on a battery powered Atmega328 design, using 4 AA batteries, at around 6.5 volts. I am using it to control a single digital servo, HiTec HS-5645MG. This is done using a RF ...
0
votes
1answer
550 views

Why does the LSR (logical shift right) instruction only require a single clock cycle to execute?

A while ago, I was reading the book Some Assembly Required on programming assembly for the avr family of microcontrollers... Early on, it explained that the LSL ( logical shift left ) instruction was ...
1
vote
1answer
557 views

How to read an input value from atmega32 pin?

I'm trying to read a value from an avr pin but it doesn't work. I'm trying to read a value that is coming from a push button and this button is connected to 5V DC cell. When I press the button the ...
0
votes
0answers
166 views

Not getting stable output out of ADC

I have written a short program to measure the room temperature using a temp sensor, LM335. The power supply is fixed pretty constant at 5.04V. The following code is supposed to print out the second ...
0
votes
1answer
152 views

How to reduce code size in flash of atmega8? [closed]

I write code for Atmega8 in Atmel studio and the size of code is overflow the flash size of microcontroller. Could anyone help ...
0
votes
1answer
227 views

Atmel ATMega8 doesn't hold “HIGH” state of PB0 and PB1

I'm new in microcontrollers and I wrote simple program that set HIGH state at PB0 and PB1. ...
0
votes
1answer
619 views

Atmega328p RS232 communication what's wrong?

I'm trying to connect Atmega328P to PC via RS232, the Microcontroller code is basically a : Serial.write("Greetings !"); inside the loop function. I've tried the following circuit but it doesn't work ...
1
vote
1answer
358 views

Why does a DC motor doesn´t move with low OCR values

I'm using a 6V DC motor for the first time and I've set up a timer on an atmega328p to create the PWM signal that then goes to the H-bridge (L293D). My question is why, for example, using a 8 bit ...
-1
votes
1answer
1k views

74HC595 Shift Register LED Array

I am kind of stuck with my shift register understanding whats happening. I uploaded an empty program to test the connection and what I see is 8 LEDs in my array all lighting up. I don't call any ...
1
vote
1answer
275 views

AVR Bitwise Operations

I am getting started learning more about AVR ATMEGA programming. Reading an article about the inner workings of Arduinos, I am learning how the shiftOut method is ...
0
votes
0answers
158 views

Microcontroller(Atmega16A) hangs in Stop method while communicating using I2C with Atmega16 and 24LC256

First of all let me say that I am a beginner in embedded programming. I am trying to do write/read using I2C protocol from 24LC256 EEPROM using Atmega16A. While debugging in Atmel Studio 7, I see I ...
1
vote
0answers
255 views

Serial Connection ATMEGA328p

I wrote up a function to connect via UART and print a string for debugging purposes. But my logic does not add up somehow... I see the line "Random Number" printed in the console but blazingly fast... ...
1
vote
2answers
886 views

AVR Timer/Counter Overflow and ISR

I want to create a PWM on any PIN and therefore using ISRs to achieve this. The setup I chose, working with my ATMEGA328p and Timer0 is: ...
0
votes
0answers
100 views

How to read the ATMEL unique ID? [duplicate]

Hi anybody know how to get ATMEL unique ID from Atmega microcontroller? I read this question but the code in answer not work in Atmel Stadio. Edit: Because we produce about 1000 board per week I ...
0
votes
1answer
272 views

Random output when reading AVR UART transmission

I'm trying to learn how to use the USART interface on an Atmega328p. For now, I just try to send a 'c' character bytes every 500 ms and read it on my computer using a PL2303 USB-serie TTL converter. ...
1
vote
1answer
1k views

USART in SPI mode vs. SPI hardware speed

On AVR ATmega devices, the USART has the capability to function in SPI mode (i.e. synchronous with no start or stop bits). The chief operational difference is that the TX line (i.e. MOSI) has a buffer,...
1
vote
1answer
199 views

Binary Display with LEDs

I tried an example of code to display serial output on an array of LEDs. ...
0
votes
1answer
77 views

AVR Skipping Page Message

I just flashed a new program into my ATMEGA328p, just letting 8 LEDs blink. When I have a look into the output of avrdude I get a strange message: ...
0
votes
1answer
281 views

ATMEGA328p LED Example not working

I tried to build a test circuit based on the Book "AVR Programming". It is very simple and shown here: The circuit itself is working and the upload of my code as well: ...
0
votes
0answers
165 views

Problem in reading/writing bytes with atmega16 & 24LC256 EEPROM

I am beginner in MCU world. I have learned quite few things and felt quite good. I am trying to experiment with my Atmega16 and 24LC256 eeprom chip. After making all the necessary connections on ...
0
votes
1answer
240 views

ADC unable to read from multiple channels

The problem is that I am unable to read from multiple ADC channels (atmega8-au). The code works fine if only one channel is used eg. ADC0, however, if the second ...
0
votes
0answers
70 views

Get more UARTs with a Shift Register?

My microcontroller (ATMEGA328) only has one UART. Is it possible to effectively create, say, 8 UARTs with one 8-bit shift register (like a SN74HC595)? The theory would be to send 1 bit from each "...
0
votes
0answers
103 views

ADC6..7 pins not defined in avr-libc

I have an atmega8-au microcontroller and analog inputs on ADC6 and ADC7 It is written in ...
0
votes
2answers
126 views

Shorted an ATmega32U4

I am still in the process of flashing my very first micro controller (an ATmega32U4). In the whole process of learning and exploring how to get this done I also used a multi meter several times on the ...
3
votes
2answers
3k views

How is the ATmega32U4 chip recognized via USB?

I have an ATmega32U4 chip which can be wired up on a PCB and connected to a PC via USB. When this is done, Windows 10 (if the proper drivers are installed) recognizes the device as ATmega32U4 chip. ...
2
votes
3answers
490 views

PCB design considerations for running 48 stepper motors

For a while now I'm working on a project where I want to control 48 stepper motors. A pair of two motors is controlled by an Atmega8. All modules are connected as slaves on an I2C/TWI-bus with an ...
0
votes
1answer
204 views

Programming a 3.3V Atmega chip using USB

I am planning to use Atxmega128A1U in a battery monitoring system. This chip comes with USB device support. However, it is a 3.3V logic chip with input voltage limit of 3.6V and I want to use the USB ...
0
votes
1answer
277 views

AVR: why reading data have some delay from writing it in SRAM (Timing diagram)

In that timing diagram we see that the write command in the same time nearly with the data. Why we don't see that also in reading data and why there is that delay between data and read command? That ...
1
vote
3answers
1k views

What is the most suitable? Pull Up or Pull Down

This is the IO port of ATMEGA328p according to 76 page of datasheet. As I know, Pull up is the most suitable system because lots of voltage spikes are logic 1.So, if we can give logic 1 normally, we ...
0
votes
1answer
113 views

MCU (Atmega644p) PWM without interrupts

I have an Atmega644p which is connected over SPI to a MCP2515 can-controller. In the MCU I use time based interrupts to send messages to the can-controller, which he translates and sends onto the ...
2
votes
1answer
2k views

AVR: Using ATmega328 Timer1 to create a delay [duplicate]

I am having some trouble wrapping my head around this, and it might just be some small error somewhere, that I keep missing .. but as it stands, I am trying to create a hardware "delay" that can run ...
0
votes
1answer
336 views

atmega2560 i2c problems

I'm tying to use a atmega2560 but can't get the I2C working. When I send the address byte i get never a ack response. Does anyone see what i'm doing wrong i used the code out of the datasheet? I tried ...
0
votes
1answer
86 views

Change current using PWM, for specific range outside PWM boundaries [closed]

I have a circuit where I use a digital potentiometer (namely MCP41100) to change current, and I use duty between 0 and 255 (thus, I have 256 steps). The current changes from 25 micro to 50 micro. And ...
0
votes
0answers
93 views

ATMega/Tiny barely working on breadboard without ISP

currently I want to get an ATMega328P and an ATTiny85 to work on a breadboard, which should talk to each other and an LCD via TWI. Anyway, I came across some issues I don't seem to be able to fix at ...
0
votes
3answers
394 views

ATMega328P - faulty ADC behavoir - update

BLUF: What causes the ADC2 to work perfectly while ADC3 charges towards a value of 328 (1.6V) on ATMEGA328P? I use an ATMega328P for one of my current projects and had an issue with the ADC. \$A_{...
-1
votes
1answer
352 views

Accidentally connected an Atmega328p and an Atmega644p to 12v instead of 5v. Are they screwed? The 328 seems to be bricked, the 644 seems fine.

I'm working on a project using the Atmega328p and Atmega644p, so first I built myself a USBasp programmer board for each one and I've successfully programmed a blinking LED, which is awesome! The not-...
0
votes
2answers
106 views

Will an ATMega128A work with a 12.8MHz external crystal?

Ultimately I am trying to create a timer that interrupts on a 50kHz cycle. Using the equations in the ATMega128A datasheet, I've determined that I would have to scale down a 12.8MHz crystal. In the ...
1
vote
1answer
165 views

USBasp programmer first firmware

I am building an evaluation board for ATmega32, I am designing an embedded USBasp programmer (The programmer will be also in the board and they will be a micro-usb header to connect the board to PC). ...
0
votes
2answers
217 views

Different voltage levels for LCD and microcontroller

I want to interface my microcontroller (ATmega32) with a 2x16 LCD. I am powering my microcontroller with 3.3V, and I need to use 5V with the LCD. Will be there any problem with that (i.e data signals ...
3
votes
1answer
155 views

Capacitors for MAX232

I want to use this chip (ST3232CDR) as an RS232 transceiver. The problem is that I want to power the chip using 2 levels of voltage (3.3V and 5.0V) using a simple jumper, but in the datasheet (http://...
0
votes
2answers
153 views

AVR ATmega TWI Hardware Questions

I have thoroughly read the TWI part of ATmega data sheets, but I am still confused about a few things. If I write TWCR = (1 << TWINT);, will that write a ...
0
votes
0answers
83 views

How to run micro servo with ATmega 328 PU

When I use arduino board it works fine but when I try to put it on prototype breadboard it just freez and start humming. For circuit I am using 5v regulator, duracel 9v battery, ZTT 16.0 mx resonator(...
0
votes
3answers
308 views

Block characters are shown in 16x 2 LCD instead of letters while interfacing with atmega328p?

I am trying to display some characters in 16x2 LCD (1602 A) using Arduino Uno (atmega328p-pu). I have written my code using embedded C for 4 bit mode. The code is below. ...
1
vote
2answers
158 views

Benefits of using an External A/D converter with ATmega128

I am new to electronics and working on my first project. Can someone explain why you would use an external A/D converter instead of the on board one? According to Mplabs the ATmega128 has a 8-...
2
votes
1answer
221 views

ATmega328P firmware flashing interrupted - is it fixable?

I am working on some PCB with an ATmega328P on it. I use a Pogo connector because we have to program and test the PCB outside. I program with usbTiny, (...
0
votes
1answer
243 views

Is it possible to connect USB printer to Atmega8 [closed]

I have a usb thermal printer, that I want to control using Hex commands in its datasheet from cheap micro-controllers. But to do that I need to create USB host in my board and it requires more than ...
0
votes
1answer
183 views

Atmega32u4 USB 2.0 Routing Check

I am making last minutes changes to USB 2.0 differential pair routing on Atmega32u4 based board. I can't re-route the entire board and/or re-arrange the components. So the picture attached is the best ...
1
vote
0answers
799 views

Programming the Atmel Mega 328P-AU 32 MLF (QFN) using the Arduino ISP

I have successfully managed to program both a (DIP)Mega168A-PU and a (DIP)Mega328PU using another (DIP)Mega328P-PU ISP. This is the configuration that works for both DIP formats (168A-PU & 328P-...