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
1answer
427 views

atmega32u4 reset, bootloader and fuses

I have a atmega32u4 from factory with dfu inside. The HWB is pull down, and RESET pin is pull up. The first USB plug, dfu programmer appears on my Linux box. I upload the firmware without problem. ...
3
votes
1answer
121 views

Why does AVR-GCC apparently waste 6 cycles here?

This line... if (thisWindowsSinceLastFlash <=1 ) { ...complies to this code... ...
0
votes
1answer
52 views

USART Communicatior AVR

I want to establish a communcation between my ATmega32A and PC but there's a line that I don't understand. The datasheet says that:"When data comes in,the RXC0 bit in UCSR0A will be set,and you can ...
1
vote
1answer
233 views

USART Programming AVR microcontroler

I want to establish an USART communication between my Atmega32a chip and my computer but there's something I don't understand. As I read the datasheet the UBRR register is a 12 bit register but is ...
-1
votes
2answers
74 views

Problem With Power Supply of ATMEGA328P and USART Peripheral

I am learning Atmega328p USART peripheral. I wrote a simple code to send and receive data from a computer through a FTDI chip. In my code I actually use two led for indication of working. 1st LED ...
0
votes
0answers
52 views

Atmel AT90USBKEY2 delay wrong before dropping power

When I program my AT90USBKEY2 with dfu-programmer, the delays are wrong until I restart the board by unplugging it. ...
4
votes
1answer
94 views

When power is lost on an AVR chip (4313 and 8535) why does the mcu run slower?

I have an AVR circuit for which I have connected its clock-out pin some other circuits external clock and the other pins operate various other things. By using an oscilloscope, I have found that the ...
2
votes
2answers
129 views

How much will a switching regulator influence my RF transmission?

Making a project using an ATMega328p and an RFM69W 433mhz radio module. I want to run the AVR at 3.3v to make interfacing with the RFM69W (which runs at 3.3v) possible without bidirectional logic ...
2
votes
1answer
693 views

Driving inductive load from IC with MOSFET

I am designing a driver circuit to drive a hydraulic proportional valve from an IC's PWM output. (IC is ATmega 2560). The coils on the valve draw approx 3Amps at %100 duty cycle with a power supply of ...
0
votes
2answers
158 views

External influences with ADC

I use atmega328p. I'm trying to read data from a variable resistor using an ADC. The microcontroller also has LEDs connected. If I ignite them, the data from the ADC increases noticeably. ...
6
votes
1answer
1k views

Software SPI implementation for AVR

I am trying to implement SPI in software for ATtiny45 (which does not have support for SPI natively). To test one I'm using the digital potentiometer, ...
3
votes
1answer
156 views

Why does ATtiny85 example code bit-shift zeros?

The ATtiny85 datasheet provides the following example C, on page 18. ...
7
votes
2answers
1k views

Why does AVR code use bit shifting [closed]

In AVR programming, register bits are invariably set by left-shifting a 1 to the appropriate bit position - and they're cleared by a ones' complement of the same. ...
5
votes
1answer
679 views

Why doesn't my VGA implementation using an AVR microcontroller work?

Problem I'm trying to generate the appropriate signal output for interfacing an AVR ATmega328P microcontroller with an LCD monitor, via the VGA specification. The VGA specification I am trying to ...
9
votes
3answers
1k views

Random and unpredictable analog comparator behaviour

I am working on a relatively "simple" project where I need to measure frequency of a sine wave that varies in amplitude and frequency. To simplify things, for now, I have only got a fixed frequency (...
0
votes
1answer
153 views

ATTINY84 cannot get PWM to work at all

I've recently been moving from Arduino environments to AVR, and I'm programming a Tiny84 with the Sparkfun USBTiny programmer and Atmel Studio 7. For the life of me, I cannot figure out why I can't ...
0
votes
2answers
153 views

Will this MOSFET Work in this circuit?

I have designed printed circuit board for a project that requires a (logic-level) MOSFet controlled directly by an AVR micro at 5 volts feeding a step-up transformer. The boards have already been ...
0
votes
2answers
71 views

AVR port transient characteristics

While writing software for stepper motor drivers and tinkering with AVR timers I've notice something interesting (to me at least). Enabling and disabling pin output on AVR port has strange transient ...
1
vote
2answers
146 views

Estimating the frequency at which your microcontroller is running

I have recently started programming an ATtiny85 microcontroller, which as per the datasheet runs at 10Mhz given 3v3 supply. So, to experiment, I have created a small program, as shown below. ...
-1
votes
1answer
63 views

Downloading program onto Atmega 16 using USBASP

I am trying to download program from laptop to my Atmega16. For this purpose I am using USBASP. The link for the USBASP is: https://robu.in/product/usbasp-avr-programming-device-for-atmel-...
0
votes
2answers
454 views

Are internal pull-up resistors in microcontrollers connected to Vcc internally?

I'm partly on my way into my first project with the ATMega32U4 and Im trying to understand the internal pull-up resistor. After lots of research, Im struggling to find an outright answer to my ...
0
votes
1answer
299 views

atmega328p keeps resetting

i program my atmega with USBasp ,and i set the fuse bits hfuse:0xC9 and lfuse :0xff. when i upload my simple code ...
0
votes
2answers
703 views

Simulation of sensor in proteus using Atmega16

I have trouble reading data from sensors using ATmega16 in Proteus. We use either light sensors for which I use LDR in proteus, or LM35 temperature sensor for temperature reading. The problem is, ...
1
vote
1answer
2k views

Controlling Servo motor with ATmega328p microcontroller

For a while, I've been working with Arduino, but about a month ago, I switched over to using solely the ATmega328-PU microcontroller. I use the Atmel Studio IDE. So far, I have successfully blinked an ...
0
votes
1answer
105 views

PWM controlled H-Bridge

I'm trying to drive symmetrical voltmeter with not-so-symmetrical voltage divider. PWM is working as a charm, but I have problem with rest of the circuit. I can't really control voltage in a voltmeter,...
-2
votes
2answers
260 views

Bidirectional TTL to CMOS

Is there a way to have bidirectional ttl logic levels to cmos logic levels conversion in a unique IC. Because right know im trying to create a z80 computer but using a avr as a peripheral as serial ...
-1
votes
3answers
236 views

How is the memory allocated in an AVR?

I'm writing a program for the AVR microcontroller, and my code experiments has led me to both confusion and discovery. Here is first code: ...
1
vote
1answer
170 views

Arduino Nano ISP turns into the target program (as well as target MCU)

I'm trying to use a Nano V3 clone as an ISP to program atmega328p's because I have not dedicated programmer yet. As part of troubleshooting I'm just trying to program another breakout board with ISP ...
3
votes
0answers
185 views

Why accessing the SRAM is slower with AVR XMega load instructions?

The AVR XMega has 16 GPIO registers in I/O space in addition to its internal SRAM. Interestingly the timing of LD instructions differ to these locations: Accessing the (rather large) I/O space is ...
0
votes
4answers
2k views

How to lock ATMEGA328p-au to disable sketch read

How to lock ATMEGA328p-au to disable sketch read from Arduino IDE? Is there a hardware way too? What are the chances it can go wrong? What will happen if it goes wrong? Notice: I am a computer ...
0
votes
3answers
74 views

FOSS-base AVR ISP programming with USB

I've been using a free software stack for AVR programming - AVR GCC + avrdude on Linux, with parallel DIY programmer cable. Since the parallel bitbang programmer doesn't work with USB printer cables, ...
0
votes
2answers
81 views

UART in AVR Microcontrollers

If an UART is receiving data continuously, can I also send data using the same UART while receiving data at the same time?
1
vote
2answers
293 views

connecting more than one Lm35 sensor to ADC pins of Atmega32 micro-controller in Proteus software

I am trying to simulate a heating system using an atmega32 microcontroller, 4 lm35 sensors, and Proteus software for circuit simulation. Unfortunately, whenever I run the simulation I encounter the ...
1
vote
1answer
513 views

AVR pin change interrupt

I want to turn on LEDs 0, 1 and 2 when pinc1, pinc2 and pinc3 are triggered. Also, I want to use a pin change interrupt. Problem: only LED 1 is on. This is my code and I am using atmega328p and ...
0
votes
1answer
302 views

AVR Program doesn't start running sometimes

I've written a little watchdog firmware that runs on an ATtiny85. The idea of the firmware is to: wait 10 seconds after power up and ignore signaling during that time after that expects a signal to ...
0
votes
1answer
185 views

AVR C 74hc595 rgb matrix multiplexing and brightness

I have built a test matrix 2*2 rgb LED's, common Anode. Connected the anodes into columns, and the Cathodes trough 220R resistors into R,G,B rows. Both go to two different 74hc595 shift registers. I ...
0
votes
1answer
167 views

Why am I getting the error: “`WDRT' was not declared in this scope” trying to turn of the WDT on my AVR?

I am clearing the Watchdog System Reset Flag on my ATMEGA168 after a WDT reset... ...using the code... MCUSR &= ~_BV(WDRT); ...but the compiler complains... ...
1
vote
3answers
170 views

Arduino like circuit verification

Because I am a software dude, I would like some help verifying this minimal Arduino based circuit which I designed with some changes. It is single AAA cell operated (NiCd or Alkaline), needs to be ...
5
votes
2answers
369 views

USIBR loses the MSB of the received byte in ATtiny45/85 of AVR family

Update: Dec.06.2017 I've just received an answer from Microchip for this bug report. They also could reproduce this symptom and they will inform me about their further investigation. Original ...
0
votes
2answers
356 views

Programming an AVR microcontroller with multiple SPI channels

I am trying to design a PCB which will make use of the ATmega324PB microcontroller [Datasheet here]. I have previously worked with smaller AVR chips such as the ATmega168PB, and programmed them ...
-4
votes
1answer
125 views

why isp avr MCU doesn't need ground? [closed]

Few days ago, while making my ic burner, I notice one thing very interesting and weird. It's that AVR MCU ISP interface really doesn't need to be connected to ground at all. Why does AVR-ISP work ...
5
votes
1answer
639 views

Strange behaviour of Attiny's ADC

...
1
vote
2answers
1k views

Control PWM with potentiometer using atmega328p

I'm using an atmega328p and I want to control the PWM duty cycle with a potentiometer. The frequency is 20ms and the duty cycle is between 0 ms and 2 ms. Problem : when I simulate this in Proteus ...
-1
votes
1answer
176 views

AVR ATmega32 program execution stops on function call

I'm doing an embedded electronics project, and my code stops executing at function calls whose respective functions have several instructions. My MCU is an Atmel ATmega32L-8PU. It runs at 8 MHz, which ...
1
vote
1answer
755 views

20Khz 50% duty cycle PWM generation Problem in atmega 328p

I wanted to create a PWM of 20Khz with 50 percent duty cycle(can be varied within while loop) in timer 0 of atmega 328p with MOODE 7:fast PWM mode with top value as OCROA.I used OCROA register to make ...
1
vote
1answer
4k views

AVR ATMEGA328p LED Example

I have the following code for testing an LED: configGlobal.h ...
0
votes
0answers
64 views

QT600 Under Atmel Studio 7

Using the QT600 development kit under Studio 7 in order to develop a touch interface, I can not get the kit to show up when not in programmer mode. I've managed to write the example HEX onto the ...
0
votes
2answers
125 views

Bi-Directional MOSFET level converter problem

I am using standard schematic of level shifter. It is used to communicate with avr and sometimes reset it. Everything works fine except for reset line. After the first pulling down I am not able to ...
1
vote
0answers
168 views

AVR ADC multiplexer odd behaviour

I noticed strange behaviour, for which I cannot find any documented confirmation. In my program I measure two ADC channels: ADC0 Internal 1.1 V bandgap reference (in order to know the value of ...
6
votes
3answers
2k views

My first AVR C program- LED not blinking

I created a simple program to be put onto a ATMega328P chip (Datasheet). I wrote my first program in ATMEL studio that I wanted to use to Blink an LED at a rate of 0.5Hz with extremely low power usage....