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
1answer
111 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 ...
1
vote
0answers
42 views

AVR SPI stops clocking if the main loop contains a delay

I have a weird issue here using an ATMega48: ...
0
votes
0answers
48 views

Display sine wave on oscilloscope with avr atmega164

I want to display a sine wave on oscilloscope using AVR Atmega164, but when I put the oscilloscope on the pin OCR0A, it takes me an rectangular pulse. How can I display a sine wave? I will put my code ...
0
votes
0answers
37 views

ATTiny84 is not working and freezes [closed]

I have uploaded the program for several ATTiny84, some of them working perfectly and the rest are not sending any signals. I checked the Fuse sitting, it is right because I compared with the other ...
-1
votes
1answer
29 views

Issue with timer_func() and delay_func() in generic library for R551 Fingerprint Sensor - ATMega328p

Apologies for the long-winded question. I've recently stepped outside of the Arduino realm for hardware programming. I'm working on a project that interfaces a R551 Fingerprint Sensor with an ...
-1
votes
0answers
50 views

ATtiny85 ADC always reads 1023 in ADC channel 3

I am trying to measure the voltage of a potential divider using an ATtiny85. When measuring the voltage, ADC channel 3 always reads 1023. I have changed the prescaler settings and reference also, ...
0
votes
1answer
59 views

Atmega32u4 constant `1023` reading on ADC Channel

I can't share the schematics as they are not mine, I'm trying to add an analog thumbstick (4 pins, Vcc/GND/x/y) to my atmega32u4 powered keyboard. The thumbstick pins are connected to pins PB4 (ADC11)...
0
votes
0answers
30 views

Custom Arduino Due Random Lock up [migrated]

I have built my own Arduino Due Circuit board. I am having issues with it randomly locking up. I have researched the libraries and have ruled out any issues with them such as the Wire library. I am ...
0
votes
0answers
34 views

Cannot Disable AVR ATmega32 Watchdog

I'm writing a code to enable and disable the watchdog timer in ATmega32. I'm using the function in the datasheet that disables the wdt. Also, I'm toggling led in the beginning of the code to know if ...
3
votes
0answers
128 views

Can I program a factory fresh Atmega328P through ICSP pins without burning a bootloader? [migrated]

Can I program a factory fresh ATMega328P using the ICSP pins without burning a bootloader? These pins are TX, RX, VCC, GND, and DTR pins in the schematic below. They are not the ISP/SPI pins 10-13. ...
0
votes
3answers
62 views

Transmission from atmega32 to PC using max232 not working

Transmission from atmega32 to PC using max232 not working. When I checked the data from the Tx pin (in the realterm software) of atmega32 it was fine. But there was no output data from max232, when I ...
0
votes
1answer
53 views

How to detect the phase sequence of a 3-phase ac (R-Y-B or R-B-Y) using Atmega32?

I am using an 8-bit AVR microcontroller in my project to detect the phase sequence of a 3-phase AC supply. Which method shall I use to do the work with the least number of components required along ...
0
votes
2answers
46 views

HCPL3700 - 220V sensing circuit

I want to use HCPL3700 optocoupler for sensing 220V (line). I design a circuit but I want to ask some questions. HCPL3700 is an open-collector output so I pull-up Vout. In AC voltage sensing some ...
6
votes
1answer
266 views

Why is the AVR GCC compiler using a full `CALL` even though I have set the `-mshort-calls` flag?

I have set the -mshort-calls flag which is documented to replace the 4 byte long CALL instruction with the 2 byte long ...
0
votes
2answers
75 views

Can I use one pin as I2C clock or data AND as GPIO?

It happened to be that I run out of pins on ATmega48PA. So I have a pull-down buttons on the pins dedicated for I2C: And now I need to add I2C bus to this device with as much backward compatibility ...
0
votes
0answers
24 views

atmega128 doesnt return from function even if Extended.M103 fuse bit is disabled

Hi I know i should n't be using atmega128 but it will take some time to replace besides there are 100's of PCB already in making. my problem is, if you look at the main() i have declared each function ...
0
votes
0answers
55 views

using multiple shift registers

I am using Atmega128 and 8 shift registers 6D595 the ser_out of each register is connected to the next shift register's ser_in so they form a chain. There is no issue with the hardware it has been ...
0
votes
1answer
26 views

ATMega328P Timer Problem in Proteus

I have an ATMega328P microcontroller, and I'm learning how it is programmed. I wrote an example for Timer0 and uploaded it into the microcontroller. It works and a led blinks once a second in while. ...
0
votes
2answers
25 views

Which pins should i use to connect watch crystal for powering Low Frequency Crystal Oscillator in ATmega328p?

If i want use a watch crystal(32KHz) with Low Frequency Crystal Oscillator of ATmega328p,Which pin should i connect the crystal to? Should i connect the crystal to XTAL1,XTAL2 pins of ATmega328p or ...
6
votes
2answers
195 views

ATmega328p sine wave generator, frequency capping at 1200Hz

I'm currently implementing sinewave generator on ATmega328p (16MHz). My project is mostly based on this article https://makezine.com/projects/make-35/advanced-arduino-sound-synthesis/. In brief, I ...
0
votes
1answer
80 views

How to control brightness of high power LED with PWM microcontroller (ATMEGA16)

Hi I am entirely new to the PWM concept. I have an AVR based ATMEGA16 microcontroller (https://robokits.co.in/control-boards/rhino-robot-control-board/rhino-robot-control-board-avr-based-with-quick-c-...
0
votes
2answers
55 views

Is my simple atmega2560 based product exempt from EMC testing?

I have designed a product that is essentially a USB HID device for a computer game. It consists of several on off switches and 5v servos run by an atmega2560, all sealed and enclosed in a plastic case....
0
votes
2answers
117 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
57 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
3k 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
140 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
143 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
44 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
90 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
48 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
154 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
58 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
56 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
80 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
1k 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
101 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
14 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
28 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
46 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
62 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
43 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
2answers
45 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
57 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
207 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
59 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
59 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
45 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
90 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
46 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
59 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 ...