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.
1,910
questions
3
votes
0
answers
52
views
PID H-bridge random current spikes
My H-bridge consists of 4 n-channel MOSFETs. The high side is driven by a basic bootstrap circuit, and the low side is directly driven from the MCU.
Using a PID function to control the motor by its ...
1
vote
1
answer
387
views
How do I measure distance of Ultrasonic Sensor HC-SR04 using the ATmega328P Timer Input Capture?
I am using an ATmega328P MCU with an 16 MHz external oscillator. I need to measure distance of Ultrasonic Sensor HC-SR04 using the ATmega328P Timer 1 Input Capture interrupt. I have to measure the ...
0
votes
1
answer
83
views
Software serial not sending the first byte correctly
I implemented the following program to send data to a serial monitor.When I run it, I expect to see abcd but I always see ⸮bcd:
<...
4
votes
3
answers
428
views
Are ATmega48/168/328 suitable for automotive applications?
I'm trying to figure out if it's ok to use ATmega48 in a homemade project involving some safety-related aspects with moving vehicles. (the project will be a control board for excavator joysticks)
...
0
votes
1
answer
142
views
ESP8266 responds with gibberish and 'ready' to AT commands from C program
I have gotten the ESP8266 working by sending commands manually from the TTY. Now, I'm trying to connect to wifi using the following C program:
...
6
votes
1
answer
460
views
How does USART know which port to use for IO?
I'm trying to learn to use USART on an ATmega328P. I'm using this datasheet.
I'm using the following code to echo characters I type on my terminal:
...
1
vote
1
answer
156
views
avr-gcc optimization deleting register writes on ATTiny402
I'm using avr-gcc (12.1.0, built with this script: https://github.com/ZakKemble/avr-gcc-build) to compile for the ATtiny402 and encountering problems with code optimization. Specifically, the compiler ...
0
votes
3
answers
358
views
What is the GPIO voltage level of a ATMega32U4 when powered from USB?
I found a nice little device that utilizes the ATMega32U4.
Although I tried to find this particular information in the datasheet, I couldn't (more than 400 pages):
When this tiny chip is powered ...
2
votes
1
answer
154
views
E-Ink with Atmega and avr-libc
I am trying to understand how to drive an E-Ink display like the Adafruit 4196 with i.e. an Atmega328 with avr-libc.
From what I could learn so far, I would write the image/text to a frame buffer and ...
0
votes
0
answers
92
views
What are the control lines in the ATmega328P for?
I'm trying to understand the block diagram for AVR architecture in the datasheet for ATmega328P on page 9. In it, I see that instruction decoder is connected to control lines. What are they in terms ...
1
vote
1
answer
476
views
Understanding assembly code for LED blink with ATmega328P
I wrote the following program to turn an LED on and off at 1-second intervals:
...
0
votes
2
answers
169
views
How do I get started with ATWINC-IC from Microchip?
I want to get started with ATWINC-IC from Microchip. It's a WiFi IC that I'm going to implement onto a PCB.
I have installed Microchip Studio and now I'm looking for how to start a project with that ...
0
votes
1
answer
150
views
Proteus ATTiny85/ATMega328P CLKOUT not sending any signal at all - Why?
I set all the fuse bits correctly according to the datasheet, It seems like I just need to set the CLKOUT bits correctly, and I should get a signal of some sort. I can still send signals to the GPIO ...
1
vote
1
answer
51
views
Could an AVR ISP connector be reused to add SPI-Interfaced memories without programing the controller?
I have no previous experience designing AVR-Compatible hardware.
I have a board which uses an ATMega 2560 and has a SPI bus which is already used by a SD adapter. After some datasheet reading, I ...
0
votes
0
answers
251
views
ESP32 UART TX slow response rate
I`m having issue with UART communication between AVR and ESP32. Issue is with TX response rate.
Here is what I`m sending with AVR, first 2 bytes are command, last 3 are data:
...