We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [avr]

AVR is a 8- and 32-bit microcontroller core developed by Atmel. AVR was chosen as microcontroller for the popular Arduino SBCs.

Filter by
Sorted by
Tagged with
0
votes
2answers
15 views

What is IDC connector pitch on a USBAsp?

I am planning to use a USBASP programmer to program one of my boards, and I want to use a fitting receptacle on my board. I fail to find the exact pitch that the USBAsp's IDC connector has (as I ...
0
votes
0answers
29 views

How to connect an SPI angular sensor (AVAGO AEAT-9000-1GSH0) with RS485 transceivers to an AVR microprocessor?

I need to connect an AVAGO AEAT-9000-1GSH0 angular sensor to an ATMEGA32U4 processor. I designed two versions: one using IC-s, one using resistors. I do not now witch of my two designs is better (or ...
0
votes
1answer
27 views

AT90USB1286 not detected by Windows Device Manger

I'm working on a controller for a USB-C keyboard. I understand USB is a very complicated protocol, and USB-C even more so, however luckily enough there's a ton of open-source projects that aim to ...
0
votes
0answers
32 views

Timer/Counter Compare match event fired on next clock tick

I'm using ATmega2560's timer-counter3 to count external pulses. I need to switch some output pin to logical 1, wait for some amount of input pulses at T3 pin and then immediately disable output. I've ...
0
votes
3answers
85 views

Tone output with AVR

I've got a keypad hooked up to an ATMega168 and its supposed to play various tones depending on the button pressed while the respective key is held down. I'm generating these tones by alternating the ...
2
votes
3answers
143 views

Gosh darn PORT structs on AVR

To my shock, Atmel has restructured the way they do port addressing in the ATtiny-avr-one series (1616 for example.). I am writing a function that takes in a pin and a port and sets the corresponding ...
1
vote
1answer
39 views

xmega-E5: exposed pad

I'm drawing my own CAD library for the ATXMEGA*-E5 devices. At page 69 (Seztion 35.2 32Z) there is the drawing of the package 32Z (5x5mm 32-lead VQFN). I cannot find any information about the ...
0
votes
1answer
31 views

What does _SFR_IO8(0x04) is doing? AVR

I'm trying to write a program in assembly to toggle the on-board LED of the Arduino MEGA2560 in assembly. To do so I just have to indicate the direction of the pin (13 in this case which is PB7) as ...
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 : * ...
-1
votes
2answers
82 views

Can I use C++ stl in avr-gcc?

I have implemented C++ queue in my codes, those I run on my PC. Now I'm programming an ATmega128 micro-controller to implement a .c code. Can I use that ...
-1
votes
2answers
46 views

Interfacing 4*4 keypad avr-gcc [duplicate]

I have this function for a 4x4 keypad: ...
0
votes
0answers
26 views

Help With ATMega32 Fuses

I decided I wanted to learn Atmel Studio to be able to work with all their microcontrollers problem being i'm trying to use a brand new ATMega32 with default fuse settings and an external crystal ...
0
votes
0answers
38 views

Can I use PWM to control the speeds of more than two motors separately in ATmega32A?

Can I use PWM to control the speeds of more than two motors separately in ATmega32A ? The latest thing I could do is controlling The speeds of two mototrs using fast PWM mode in counter 1 with ...
0
votes
0answers
64 views

AVR ATMEGA168 UART behaving strangely

I am new to AVR and microcontrollers and I am trying to get the UART working correctly on my Atmega68 chip. When I transmit data from my chip my PC terminal program receives them as weird symbols. I ...
0
votes
1answer
52 views

.96 inch TFT with ST7753 and AVR - can't draw individual pixels

I bought this from aliexpress: https://www.aliexpress.com/item/32859042892.html It seems to be a good display, even a bit higher res, than advertised, however, I'm having trouble doing anything more ...
0
votes
1answer
44 views

How to use output PWM in AVR

I have this code to blink an array (8-led) of led one after one: ...
0
votes
1answer
111 views

How to make 1uA consumption on Attiny13a?

I'm measuring my standalone Attinty13a (internal 128kHz) current consumption with li-ion accumulator (3.7v, 220mAh). Here is my schema and code: ...
0
votes
0answers
57 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 ...
3
votes
1answer
71 views

AVR diagram of functions calling, ISR and main loop share the same resource

I made a simple diagram of functions calls to illustrate the potential problem which bothering me a little. As you can see, my task_list (which is simple linked ...
0
votes
1answer
59 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 ...
0
votes
0answers
44 views

Strange Clock output on AVR [duplicate]

I have programmed my ATtiny1616 to output the clock on a pin. Here is my reading: Why is there all that ripple? How might I reduce it?
0
votes
0answers
49 views

avr/io.h don't include the appropriate avr/ioXXX.h file

I'm facing a problem on Eclipse IDE that when compiling my project (which has #include <avr/io.h>), the compiler includes ...
1
vote
2answers
50 views

AVR ATMEGA644 print Local time

From this tutorial, I can print local time when I code using codeblock. https://www.tutorialspoint.com/c_standard_library/c_function_localtime.htm I am measuring capacitance by atmega644. I read the ...
0
votes
0answers
38 views

OLED SS1306 displays on one side only when using AVR

I have an I2C 128x64 OLED display here. I've tried using Arduino and everything works flawlessly. Now I'm trying this but just writing in straight-up C code. Majority of the display is garbled up. I'...
1
vote
2answers
161 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
2answers
65 views

Simulate Shift Register on AVR (Configurable Logic/Timers?)

Recently I set up two MCUs (ATtiny1616) to perform basic serial communication using shift registers I made myself. simulate this circuit – Schematic created using CircuitLab Here is the logic ...
1
vote
2answers
59 views

Where should be defined a device specific ISR when making a static library?

Suppose I want to make a static library (.a file), which contains an ISR. That library should be used by many AVR MCUs, but each device has different ISR vector name, so it cannot be defined in .c ...
-2
votes
5answers
126 views

Bitwise operations in embedded C if button pressed on AVR circuit

I am using ATmega32 AVR microcontroller. I am confused about bitwise operation in embedded C. I understand (AND, OR, XOR, NOT) logic gates very well, but there is something that I don't understand: I ...
0
votes
1answer
38 views

What is the difference between ADC single conversion mode and free running mode in ATmega32A?

Can someone explain this to me as I don't get what's written in this section of datasheet A piece code written in C showing the difference would be great too . thanks in advance.
0
votes
1answer
60 views

Programming ESP8266 in circuit

I've designed a simple WS2812B LED Controller utilizing the ATMega328p and an ESP8266 to connect to WiFi. The two are supposed to be communicating over UART. I've made a mistake of not testing the ...
0
votes
0answers
61 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 ...
0
votes
1answer
59 views

What is best sources for learning and practising AVR microcontrollers? [closed]

I am computers and systems engineering student and I am very interested in microcontrollers so What is best sources for learning and practising AVR microcontrollers ?
0
votes
1answer
77 views

Thread-Style Operation on Microprocessor

This is a general question about designing firmware for AVR microcontrollers, say, the AtMega16. I have a routine that I am running through several thousand times per second. The routine is entirely ...
0
votes
2answers
82 views

Atmel AVR cutting down the power

This might be a straight forward question: An AVR gets its power from a regulator which can be turned off with a digital low level input. However on a spike (digital high followed by digital low) the ...
6
votes
5answers
950 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 ...
1
vote
1answer
59 views

serial monitor error/crash

After typing C, microcontroller responds with # Next, I type k, microcontroller responds with #INFO: TWI master enabled Next, I type !, microcontroller responds with C after typing in the next ...
0
votes
0answers
60 views

Switch Like Microcontroller or Integrated circuit

I'm somewhat new to this, and just wondering what the best approach would be. I'm trying to make a device that would be put in the middle of 2 connectors with about 20 wires. Essentially I am ...
0
votes
1answer
57 views

Making UART between ATmega32A and the PC :

I used PL2303hx to connect my PC to the chip and I did the correct connections and installed the driver of the IC and the program I wrote was simulated succesfully on proteus: But when I do it on the ...
0
votes
2answers
41 views

Common resistor for pulling up unused pins of ATmega2560

I am designing a PCB with ATmega2560 MCU. I have 50 unused pins in my design. I was wondering if I can pull up these 50 pins using 5 resistors such that 10 pins have a common pull up resistor. Is that ...
1
vote
0answers
98 views

AVR - Timer0 is not firing if INT5 is enabled in EIMSK

I'm using an ATMEGA2560. Compiler: avr-gcc (AVR_8_bit_GNU_Toolchain_3.4.5_1522) 4.8.1 I have setup TIMER0 for periodic tasks: ...
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 ...
2
votes
1answer
46 views

How to include paths for the C compiler in atmel studio?

I have a folder project and it consists of multiple folder and .c and .h files what is the best way to include them all without including the individual folders?
0
votes
0answers
40 views

MEGA2560 only starts program after pressing RESET button multiple times

I am working on a program where I am controlling an MP3 player by using UART between my MEGA2560 and the MP3 player. The MEGA2560 sends serial commands to the MP3 player when external interrupts are ...
0
votes
2answers
113 views

Why SS pin must be set to OUTPUT for SPI master?

In SPI, SS pin is used as latch, which means that it must be set as OUTPUT. The matter is that on arduino micro a LED is attached to the SS pin (aka PB0), so I cannot use it for the latch in SPI. ...
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
1answer
89 views

SPI and UART of atmega32 were not working when atmega32 was interfaced with ad7705

I was trying to read 16bit ADC ad7705 by atmega32 and send the value read through SPI communication of atmega32 to real-term software by using UART of atmega32. I found that there was no transmission ...
2
votes
1answer
91 views

How to upload code to AtMega2560 using JTAG ICE 2.0

Background : I'm used to code in Arduino(Uno, Mega, Esp32, Esp8266). But this time i have to code directly on AVR Atmega 2560 Chip. I have AVR JTAG ICE 2.0 (like this one) and download several ...
0
votes
0answers
23 views

Voltage drop on system activation

My question is generic in nature about electronics system design. I am trying to put together an RC car which is powered by an AVR Atmega168 chip. It communicates through an HC-12 module and has a ...
0
votes
1answer
49 views

AVR ISP not working, strange signal level [closed]

I can't read the chip ID of the ATMega16m1 MCU using a AVRISP mkII programmer. The ISP pins are connected directly to the MCU, the reset line has a 10k pullup to Vcc (3.3V). When measuring the ISP ...
0
votes
1answer
123 views

What could cause a microcontroller on a board not to accept programming?

EDIT: To summarise - when I take the microcontroller off the board, it works. But when I leave it on the board and try to program it, I cannot. I have designed a PCB and had it fabricated. This PCB ...