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 [avr]

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

0
votes
2answers
78 views

Garbage data when using UART on atmega2560

(updates at bottom) I am using an Arduino Mega with the SoftwareSerialExample sketch on it to send and receive bytes through UART on my ATmega2560 (which is actually on a Arduino Mega Board). ...
0
votes
1answer
49 views

AVR NRF24L01+ No Communication, No IRQ Activity

I've been scratching my head for a few days over getting the NRF24L01+ modules to work on AVRs (ATMega328/p). I followed Gizmosnack's tutorial, not changing very much at all from his code. I've also ...
12
votes
3answers
2k views

Is it safe to abruptly remove Arduino power? [closed]

If I have an Arduino, can I abruptly turn the power on and off without corrupting it? If I am designing a product that has an on/off switch, do I need to incorporate a delay before turning off the ...
0
votes
2answers
105 views

Using Arduino Mega as Atmega2560 AVR development board with Atmel Studio 7

(updates at end) Qualifier: I am posting this here and not on the Arduino Stack Exchange because my question is about firmware development and not Arduino development. Project: I am designing a PCB ...
2
votes
5answers
122 views

Are the AVR GPIO registers used by AVRGCC?

Most (all?) of the AVR family controllers provide some special GPIO registers. 4.8.1 General Purpose I/O Registers The lowest 16 I/O Memory addresses is reserved for General Purpose I/O Registers....
0
votes
0answers
39 views

I have tried serial communication code.İt is working in arduino ide but it doesn't working in atmel studio

I have found code of serial communication for attiny84.https://electronut.in/serial-communications-with-the-attiny84/ If I compile this code in Arduino Ide then this code is running.I see hello world ...
0
votes
3answers
85 views

Disable RC oscillator in ATmega328 for FCC compliance

With respect to the topic below, I was trying to find where in the AVR documentation does it say the 8 MHz RC internal oscillator is "disabled" when CKSEL is selected to a different source? I am ...
0
votes
0answers
19 views

Issue with programming Atmega32u4 (lfuse memory not accessible using FLIP)

From my last question, I've managed to connect my Atmega32u4 to my computer. Now, when attempted to initialise the bootloader using avrdude, I get the following error message: ...
2
votes
2answers
75 views

How can I program an Atmega32u4 over USB with this schematic?

This is my first time trying to program an Atmega32u4. I made a PCB with the following schematic: Now I've soldered all the parts onto the PCB, and I've plugged a micro usb cable from my computer ...
0
votes
1answer
40 views

Avrisp mkii not recognizing atmega 328p chips

I have three different sets of chips, the attiny85, 328p, 328p-au. Initially, the avrisp mkii, was programming the atmega328p, however now it is not recognizing this chip (i.e. 328p) or the 328p-au. ...
0
votes
1answer
47 views

Sending data over UART when data has been received over I2C on AVR

So I'm receiving data from an ESP module via I2C. I then need to send this data immediately over the UART. Not sure how I should do this. Would it be ok to place the UART sending inside the i2c ...
1
vote
1answer
61 views

Regulate an RGB LED via PWM, both in brightness and in hue

I am looking to regulate programmatically an RGB LED both in terms of brightness and in terms of hue. So far I have learned that I can use PWM to do this, but I am unsure as to what the details are. I ...
10
votes
2answers
967 views

Is there a way to not have to poll the UART of an AVR?

I'm receiving data over UART from another AVR. However I'm doing other stuff so don't want to have constantly keep polling the UART. I know there are interrupts but I can only see one for receive ...
2
votes
1answer
62 views

Bricked ATMEGA328PB by setting low fuse to 0xF5 - How to recover?

While programming an ATMEGA328PB via ISP, I wanted to set the efuse to 0xF5. By accident, I didn't write the efuse but the lfuse instead. Since then, I cannot communicate with the chip via ISP ...
0
votes
0answers
12 views

AVR Qtouch Composer project failed to compile

I have the latest Studio 7 + Qtouch library. After creating a project (tried both attiny44 & atmega168) I get an error touch_aip.h is not found and indeed I can not find this file on my HD. Any ...
0
votes
1answer
25 views

ATtiny icsp pins dual purpose

I am using an ATtiny88 in a pcb design. It is directly driving a LED matrix. I am only driving half bytes at a time, so the max current limit will be followed. It is my understanding that I can dual ...
1
vote
1answer
41 views

LED-strip PWM works with Raspberry Pi, doesn't work with Attiny45

I'm trying to control an RGBW analog LED-strip by PWM modulation. When using an Attiny45 the LED-strip just blinks at a low frequency (approx. 2-3 hz). However, using a Raspberry Pi 3 to control PWM ...
0
votes
1answer
59 views

Parameter is incorrect error with usb 2.0 but not with usb 3.0 with C# serial program

I've been struggling to understand an error that is happening. I've got a simple program that sends/receives bytes over serial, and up until yesterday I figured was working 100%. Basically, the issue ...
0
votes
1answer
40 views

ADC with PWM glitch [duplicate]

This code is for PWM works as long as the line ADCSRA |= (1 << ADSC); is commented out. But when I remove the comment, it doesn't work. I don't know why that ...
0
votes
1answer
28 views

AVR DMX Transmitter outputs constant squarewave, not the form of a DMX packet

I'm using an ATMEGA328, with an external 20MHz crystal and fuses set by avrdude as -U lfuse:w:0x46:m -U hfuse:w:0xdf:m. I want to send DMX with it. Using the code ...
2
votes
1answer
51 views

How to programm AVR ATmega48 in TQFP32 soldered onboard?

I have a board (actually - many of them) with ATmega48PA (TQFP32) soldered in and no ISP connector. Some of the ISP lines are even not routed. I used Hobbyking programmer to connect to the processor ...
1
vote
2answers
121 views

Using 2N7000 with 3.3V signal

I have attached a 2N7000's gate to my AVR chip output pin. I am sending a PWM signal to it. I am powering my AVR chip from 3.3V power source so the maximum voltage it can output at G is 3.3V. Then ...
0
votes
0answers
45 views

AVR: SPI write collision

I was learning SPI protocol using this tutorial. I am simulating code in Proteus using Atmega168. I was able to get the code working. Then I tried to implement UART, so that I can view recived data in ...
0
votes
2answers
54 views

Setting DDRx register before PORTx register or after AVR cores?

Please explain me why DDRx register must be set in some situations after setting PORTx register.
0
votes
0answers
43 views

ENC28J60: Controller loses it's configuration after a while

I have written my own driver for the ENC28J60 Ethernet controller from Microchip for education purpose. But the Controller lose it's configuration (register ...
0
votes
2answers
77 views

DS18B20 temperature sensor with Attiny25

I would like to make a simple thermal switch with attiny25 but first I need to read the temperature values from the ds18b20 sensor. I found some codes, here are the sources: DS18B20 lib UART lib I ...
0
votes
1answer
39 views

USART ISR on TXC breaking delays from <util/delay.h>?

I am trying to work out USART ISR's on the ATmega 328P. So far I have got the USART rx and tx working. I have come across a strange issue when it comes to the UART ISR's, though. The ISR seems to ...
0
votes
1answer
55 views

How do you add an onboard ISP for an ATTiny85?

I've taken a liking to building circuits around the ATTiny. Typically I add 6 headers and use an AVR programmer or an Arduino to program the ATTiny in circuit. I'm trying to figure out how move that ...
0
votes
1answer
93 views

Easiest (or cheapest) way to get both 5V and 3.3V on one circuit

I'm working on a circuit based on an ATTiny85 and I need accelerometer input. I was looking at using an analog accelerometer (KXTC9-2050 that runs around 240 uA) because I have the extra pin and I'm ...
0
votes
1answer
42 views

AVR Bootloader write: How to write a bootloader page address and execute SPM instruction in C code

I want to write bootloader for avr atmega328p in C language. I want to perfom a page erase: So I have to write the address of the z pointer. // Don't know how to implement in c code; Then make SPMEN ...
1
vote
2answers
77 views

How to disable arduino Hardware Serial Rx Interrupt Properly

Intro: I have an Arduino mega doing multiple tasks , from which A function Reads data from a sensor using SPI . Every like 10,000 read or something , i get 1 error bit in the SPI data . and I have ...
0
votes
1answer
6k views

AVRDUDE does not recognize USBasp device

I'm am having issues with my USBasp programmer (Windows 10). I installed the WinUSB driver using zadig 2.4. When I run AVR dude with the following parameters ...
0
votes
1answer
57 views

32khz crystal for AVR. Caps needed?

I remember reading long ago that I don't need filter caps for a watch (32768 Hz) crystal. Is this true? Or will I need to put some capacitors to ground on either end of the crystal? I will be using ...
0
votes
0answers
44 views

AVR ATmega328 low fuse wrtiten and issue

I am using an Arduino Uno as the hardware programmer together with avrdude as the software programmer for flashing an Atmega328. I have noticed PB0 was set to ...
-6
votes
1answer
83 views

Recovering a program from a locked AVR [closed]

How can a program from an AVR be recovered when its lock fuse bits are set?
2
votes
1answer
99 views

RS-232 interface chip problem - why is the voltage level so wrong?

1. What I want to do: I have a PCB with an AVR microcontroller (ATmega16U4) on it. I want the microcontroller to communicate with my computer through an RS-232 cable. 2. What I did: I added an ...
4
votes
1answer
367 views

AREF above operating voltage of the microcontroller

I’m operating an ATMega32 at 3v3 through USB and a LDO. Is it possible to connect the AREF pin directly to the USB voltage of 5V so that I can read voltages between 0 and 5V when reading from the ...
0
votes
2answers
65 views

Atmega328 doesn't respond after power loss while uploading program

While uploading program to atmega328 I accidentally disconnected it from power. After that I get "target doesn't answer" message while trying to upload. I am using USBasp programmer, connections are ...
2
votes
1answer
62 views

Multi-tasking on an 8bit AVR -

I'm using an ATTINY816 (the new series AVRs) to manage a system that includes the following tasks: Simple audio "effect processing" (delay, pitch up, pitch down...) using internal ADC + DAC Storage ...
0
votes
0answers
48 views

Attiny 841 dev board schematic review

I am about to send a custom Attiny841 dev board (aimed at Optiboot) to production and I thought, since I never used netiher this microcontroller nor the USB-UART converter before, I'd come here and ...
0
votes
0answers
37 views

Translate from AVR pgm_read_byte to normal C array manipulation in STM8

I am trying to translate a couple of lines of code from AVR space data to STM8 normal C data manipulation. As you should know, AVR has a program space which can storage data for read only operation, ...
0
votes
2answers
59 views

Use ADC as Analog Comparator (AttinyAVR)?

I have recently been trying to transition from Atmel's Atmega 328p avr to the newer (and much smaller) attiny416. The trouble is, the 416 only allows you to choose between two positive inputs and two ...
6
votes
2answers
666 views

LED- Resistor, does the position matter? [duplicate]

I was reading the MAKE AVR programming. One of the chapters suggests to solder resistor to the cathode side of an LED. But in our uni labs it's said to connect the resistor "before" the LED; that is ...
0
votes
0answers
65 views

Receiving data from SIM808

I am trying to use SIM808 module but I have no response even after sending only "AT". I am using 5V/2.5A AC/DC adapter. The board (ecb-v3.2) is rather connected well because two diodes are on all the ...
1
vote
1answer
111 views

MAX7221 not always powering on

I have a MAX7221 SPI 7-seg. LED driver linked to an AVR168P microcontroller. Sometimes when powering on, everything works as expected. Other times the display blanks and remains blank. Other times ...
1
vote
1answer
72 views

AVR SPI slave first byte problem

I have written a simple SPI slave on an ATMEGA328PB. It mostly works, however, I can't seem to get the first byte to be what I want. The difference between the first, second, and all other attempts ...
31
votes
5answers
12k views

How do devices like the Game Boy Advance achieve their frame rate?

I've been designing my own handheld gaming device based around an AVR microcontroller and a small OLED display. I started off with a monochrome display 128x64 pixels and can comfortably draw to it at ...
0
votes
3answers
79 views

Burning hex files into multiple micro-controllers at a time. [closed]

I am using attiny88 and the usbasp programmer. Right now I am burning 1 micro at a time. But it is a time-consuming process during the production. Is there any way to burn multiple microcontrollers ...
2
votes
2answers
213 views

Can't trigger AVR ADC Interrupt

I am using an Atmel's XPlained mini board with Atmega328PB. I am trying to use ADC interrupt, however I can't get it to fire. Here's the code that I have a problem with: ...
0
votes
1answer
59 views

Arduino and DAC

I have programmed an Arduino to control a DAC, generated signal control the current of an LED via a LT1206. Whenever I plug in the power, before Arduino starts, the LED starts to blink because it ...