Questions tagged [avr]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
26 views

HDMI ground loop from gaming PC to AVR

I have a ground loop from my HDMI from gaming PC to AVR. It's very annoying. Aside from getting an expensive ground loop isolation transformer for 1000 W, is there any other way? Is there an HDMI ...
0 votes
0 answers
49 views

Using ATmega AVR8 comparator as an earth leakage circuit breaker to detect up to 70 V leakages

I've created aluminum fixtures for VFD tubes, which means that many small wires running voltages up to 70 V are inside these metal tubes. I can connect these metal fixtures to GND, but maybe a better ...
  • 35
0 votes
2 answers
97 views

Why is this DC motor control software not working? [closed]

I want to control a DC motor with an Atmega16. I have connected a motor driver to port B pins PB0 and PB1. When I try this code, it works great. ...
  • 57
1 vote
0 answers
55 views

Three phase brushless DC motor driver using Three current sensor

I wrote a program for a brushless DC motor using three Hall effect sensors. Now I want to rewrite the same program for another brushless motor without Hall sensors. Using three current sensor, I want ...
2 votes
1 answer
222 views

Why does this circuit ruin my AVR?

I have the following circuit attached to my ATTiny13A. More specifically, attached to its PB1: I'm doing this to initialize the port: ...
  • 499
1 vote
2 answers
90 views

ADC reading on ATtiny13, without dedicated clock?

I am in a design phase of a small circuit which is intended to measure an external voltage, with an ATtiny13. This AVR has a dedicated ADC hardware, which is suitable for my needs (need to detect ...
  • 499
3 votes
2 answers
102 views

ATMEGA328P reset circuit, not pulling down fully

Attached is the schematic of a reset circuit. When I press the reset button, the voltage on the reset pin is 2.5 V. Rmoving R13 naturally solves the issue, but I'm unclear as to why the ...
1 vote
0 answers
46 views

Best frequency for ATmega328P using internal oscillator?

I wonder what frequency I should set for the internal oscillator of my ATmega328P. I'll only be reading and outing digital signals, 1s and 0s. I'd like for the processing to be as fast as it can get, ...
0 votes
1 answer
57 views

Simulator of microcontroller runs so slow in Proteus

I am trying to implement a simple program with ATmega128, which display numbers from 0 to F. The problem is when I set the delay time at 500ms, the simulation runs slower, at around 8 seconds for each ...
  • 33
0 votes
0 answers
71 views

SPI interfacing a sensor doesn't seem to work

I'm trying to get a feeling for how the SPI protocol works. I built this cirucit using Proteus simulator. simulate this circuit – Schematic created using CircuitLab And then according to the ...
0 votes
1 answer
76 views

Is there a way send pulses over a DC line?

more details : we have 12V dc & we have master mcu board supply voltage to other slave mcu board the length of 12v dc cable between two boards can reach 50 meters so what is suggestion communicate ...
  • 9
1 vote
0 answers
61 views

Level shifting with 74HC541

I found this schematic for an AVR programmer with a level shifting buffer: The Vcc of the target is supplied at the VCCIO pin and the 5V levels of the ATmega8 need to be converted to logic levels ...
0 votes
0 answers
40 views

Using SUB with values higher than 128 in an 8 bit system

how does the SUB instruction work in AVR assembly? does it take the twos compliment and add it or does it function differently? If I subtract two 8- bit numbers, say 1 - 2 and the answer is -1, should ...
  • 19
1 vote
1 answer
67 views

How to make DHT22 shut up while I talk to another device on the same bus

I have a project where multiple devices have to be connected to the same bus. One of them is a DHT22, another is another controller. With the second controller I can communicate which ever way I want ...
1 vote
2 answers
135 views

Reading LM35 temperature sensor with atmega328p [closed]

I want to read the temperature using LM35 and atmega328p so when the temperature equals or less than 30 a red LED (PINB0) will be turned ON, otherwise a green LED (PINB1) will be ON but I did not get ...
0 votes
1 answer
64 views

Is the UPDI pin on AVR DA/AVR Tiny0/... 5V tolerant when VCC@3V3?

I've a project incorporating an AVR128DA28 which is used with 3V3 peripherals and should be programmed in circuit. For this I built a jtag2updi (GitHub) adapter using an Arduino Nano. Since ...
  • 157
0 votes
0 answers
44 views

What happens to an AVR UART's XCK pin when running in an asynchronous mode?

The question concerns AVR128DB32 but I don't happen to have a device available at hand to answer my own question by verify its behaviour on my workbench. Reading the data sheet for that ...
  • 190
1 vote
1 answer
42 views

Is the reference voltage for voltage control the RMS between the three phase voltages?

Suppose to provide voltage control with an AVR connected to a synchronous generator. A voltage reference is compared with the output terminal voltage of the generator, and the error between them is ...
2 votes
1 answer
134 views

What does LSB mean in PWM?

I have this PWM exam preparation question in Computer Engineering where it says "What is one V_LSB?". However we've discussed nothing about LSB in the PWM section. What does it means?
-2 votes
2 answers
70 views

Is my microcontroller damaged?

I tried the simplest code with a blinking LED, but it is not working. I connected the LED to PB0 through a 1k resistor. The software (AVRDUDESS) is detecting the microcontroller (ATmega16) fine, but ...
  • 57
0 votes
3 answers
132 views

Generate a signal with 8 fixed-width pulse with varying interval

I am working on an ultrasound device. We want to generate a particular signal to drive the 1 MHz piezoelectric transducer at various resonance frequencies point. The goal is to write a code using ...
1 vote
1 answer
117 views

Simple AVR interrupts in C - How to cleanly stop and restart "INT0"?

I'm trying to use an ATTiny84's INT0 pin to detect a falling edge event on a 1 kHz signal. What is the correct way to temporarily halt this interrupt INT0, and then resuming it at a later time, ...
0 votes
1 answer
78 views

Help with AVR ADC and Serial port programming and integrating with python

I am a 2nd year electrical engineering student. I was stuck at this: Why do both seven segment displays show only 8 even when simulation is not running? Basically I am trying to take temperature data ...
  • 11
0 votes
1 answer
270 views

How to connect USB to an ATmega328p?

I'm making a board that requires an ATmega328P to respond to commands from a computer. It needs to be connected with USB. I am new to this and trying to figure out how to best do this. I know I'll ...
  • 31
1 vote
0 answers
48 views

AVR MCUs parametric search shows number of USB modules but no USB interface

I am looking for AVR MCUs that have USB 2.0 (or greater) capabilities. Using their website for Parametric search, I see that some MCUs have USB modules, but they are not listed as MCUs that have a USB ...
1 vote
1 answer
98 views

AVR-libc `uart_putchar` implementation

In AVR-libc page 143 the implementation of the function uart_putchar() is typical as the following: ...
  • 488
2 votes
2 answers
137 views

ATmega32U4 without USB: how to handle usuned pins

On the ATmega32U4 MCU there are several pins related to USB: VBUS D+ D- UCAP UGND UVCC In the datasheet and in almost all reference schematics I find on the Internet, it's explained how to connect ...
  • 957
1 vote
0 answers
72 views

AVR self-reset / hardware reset from own own pin

Can I use a capacitor to perform a self-reset / hardware reset of an AVR microcontroller? The capacitor would be driven low by a pin on the microcontroller. Arduino uses this mechanism for programming ...
2 votes
2 answers
62 views

Are there any ramifications of leaving an AVR in debugWIRE mode?

I have a product with an external connector with the intentions of using this for applying updates to an ATMEGA328P later on down the road. There are limited pins available, so I can't use SPI for ...
  • 161
1 vote
3 answers
398 views

RS-485 communication with slave microcontrollers driving addressable LEDs?

I am trying to figure out how to achieve the master-slave configuration shown below. The aim is to individually address an array of 150mA LEDs, driven by the IS31FL3265A PWM driver. For this specific ...
0 votes
1 answer
56 views

Read MicroSD card with USB reader while it is connected to (powered-off) microcontroller

I have created a small breakout board, where a microSD card is inserted and I can access its signals. Now, when the necessary SD signals are connected to an AVR microcontroller via SPI, they ...
  • 363
0 votes
2 answers
136 views

How many times can a register bit be changed in AVR?

I am writing a program for an ATmega328P. I have a while loop inside which I am enabling the UART receiver complete interrupt flag using the command ...
0 votes
1 answer
133 views

Making duty cycle with CTC mode in AVR without using interrupt

I am writing a program to make an output with a 30% duty cycle and a frequency of 3 kHz using an ATmega32 microcontroller. My controller's frequency is 8 MHz and I am going to decrease it to 1 MHz by ...
  • 73
2 votes
1 answer
98 views

Strange ATmega32 behavior with assembly code

I posted a kind of similar question recently, but it was not that organized, so here I am trying again :) I wrote this short assembly code to blink an LED at different intervals depending on the state ...
0 votes
2 answers
63 views

Problem interfacing stepper motor with Atmega 32

I have been trying to interface a bipolar stepper motor with an ATmega32 controller using AVR assembly, but it just keeps clicking without movement or just move back and forth in the same step. Here ...
0 votes
2 answers
146 views

AVR reset pin capacitor causes chip to enter bootloader on powerup

I have a circuit using an ATmega32U4 and am using the Arduino Leonardo/Micro Caterina bootloader (the one that comes with arduinoIDE v1.8.13). The problem I am having is on power-up (via USB ...
  • 151
0 votes
3 answers
204 views

How does one program for first time and reprogram microcontrollers that are mounted to a PCB?

Arduino Unos and Microchip Curiosity Nanos are for prototyping and easy and ready to program, but now I am struggling to find the resource material that would detail taking the chip off the breakout ...
  • 199
0 votes
4 answers
143 views

Is maximum/minimum voltage always compared as difference voltage for a microcontroller?

Let's take the ATmega328P for example. It has a minimum input voltage of -0.5 and maximum input voltage of Vcc + 0.5. But what ...
  • 915
0 votes
1 answer
125 views

Faster Timer0 overflow than 2 ms on Attiny85

I'm trying to get a Timer0 overflow with an overflow every 500us, but can't find a solution to get it so low. I'm running the Attiny85 on its internal 1 MHz clock, so I know it is not gonna be the ...
  • 309
2 votes
3 answers
426 views

Can I control IRFZ44N Mosfet directly from 5V microcontroller?

I know that IRFZ44N is not a logic level Mosfet, but I need it to control only 12v 1.2A (14.4W). Can I control it by applying only 5V on gate from an atmega microcontroller? I checked the datasheet ...
0 votes
2 answers
134 views

Linear and log sweep in AVR

My application requires a frequency sweep in a coil and measuring the resultant resonant frequency from the coil after it has settled. I can do the second part i.e. wait and count the rising edges of ...
0 votes
0 answers
205 views

Store Receive bytes from UART as a string in BASCOM AVR

I'm working on receive interrupt uart and I wanna store all of data as a string . I also catch data (one by one) byte until receiving ETX . When I catch ETX ,it means end of datas. unfortunately, my ...
0 votes
2 answers
144 views

Can battery levels ever be reliably read while it is powering an embedded system

I have an AVR microcontroller (atmega168pa) powered through two AA battery cells. When I read the battery voltage while it is not hooked up to the bread board, the voltage might read as 3.14 on a DMM. ...
  • 313
1 vote
0 answers
96 views

7-segment display communication

I have attempted to solve this problem making kmaps for the binary counter, mux and decoder however I'm getting stuck on the making them all talk to each other bit, I am using a ATmega32L and a ...
  • 11
0 votes
1 answer
83 views

How to make AT90USB646 run at 3.3v VCC?

[WHAT I DID] I've made one prototype of AT90USB646 running at 16MHz, 5V. The design is almost the same as Teensy++ (schematics can be found here https://www.pjrc.com/teensy/schematic.html). [WHAT I AM ...
  • 101
0 votes
1 answer
226 views

Confused about MAX6675 thermocouple sensor SPI protocol

I'm using an AVR microcontroller to take readings from a MAX6675 (SPI K-type thermocouple ADC chip). I am having difficulty understanding what is required by this chip's SPI interface. The datasheet (...
2 votes
1 answer
73 views

Strange behavior when splitting an AVR program across functions

I'm trying to run a very basic "blinker" program on an Atmega328P. Here it is in its entirety: ...
  • 147
1 vote
1 answer
133 views

Should I be worried about the possibility of a microcontroller failing?

I'm making a commercial product for the first time and I am worried about the stability of my circuit over time. The product is a door interlocking system. It locks and unlocks doors using solenoid ...
  • 310
1 vote
1 answer
168 views

Please confirm I can use this ATtiny's IO as I intend to

This is the first time I'm implementing a µController in a design (just have some experience with Arduino). So I just wanted to make sure that this will actually work instead of finding out once I ...
  • 417
2 votes
3 answers
937 views

Powering a Raspberry Pi Zero through a MOSFET

I have a Raspberry Pi Zero which I want to be able to power on/off via code, so I made this circuit: simulate this circuit – Schematic created using CircuitLab I would like to avoid powering ...

1
2 3 4 5
37