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
0
votes
1answer
19 views

Problem or misunderstand of ADATE bit on ATTiny45

I have 2 buttons connected to pulled-down ADC input. I want to trigger ISR(SIG_ADC) when ADC finishes conversion - this is working. If I start ADC using ...
0
votes
0answers
19 views

Change simulator fuses in Atmel Studio

I have been test the example. AVR1316: Using the XMEGA Self-programming driver on ATxmega128D4 device through the Atmel Studio simulator. The program executed fine but does not modify the content of ...
-4
votes
1answer
85 views

Making a simple calculator with ATMEGA32

I try to create a calculator with ATMEGA32 but it did not work correctly! For example it do operations like this (2/1=0),(5*6=12808),(22+88=12746). I know that something is wrong but I cannot find it ...
0
votes
4answers
70 views

How to determine which connectivity and peripherals are needed in a microcontroller?

This post goes a step beyond my previous question about microcontroller selection here. In short, I am a moving away from AVR for product development and I want to stick with popular manufacturer uC ...
5
votes
7answers
1k views

Is auto generated projects for embedded system the future?

I'm using CubeMX for auto generate projects for the STM32 micro controllers. I really like CubeMX because it's fits both STM8 and STM32 micro controllers. One thing that I'm wondering about is if ...
0
votes
1answer
64 views

Uncertain of 8-bit vs 32-bit alternatives to AVR32 [closed]

I was browsing a distributor to find options for simple 8-bit and 32-bit RISC uCs and came across AVR32. After some searching on the web, it seems that AVR32 is a bit dated and possibly not a good ...
0
votes
0answers
21 views

APDS-9253 reads all data registers as 0

I'm trying to read data from an APDS-9253 with an xmega. My i2c bus is working because I'm reading other devices without any problem. From the datasheet it seems at power-up the sensor is not ...
0
votes
1answer
44 views

temp1:12:3: error: 'DDRA' was not declared in this scope DDRA = 0x00; /* Make ADC port as input */

Trying to upload code on atmega328 to display temp but throws me this error : temp1:12:3: error: 'DDRA' was not declared in this scope DDRA = 0x00; /* Make ADC port as input */ ^~~~ Here's ...
0
votes
1answer
46 views

AVR Atmel MCUs with 12bit ADC and ArduinoIDE support [closed]

I am searching for more powerful MCUs than the ATMEGA1284p that I am currently using, in particular I want to have better ADCs and switch from 10 to 12bit resolution. My constraints are the following: ...
0
votes
0answers
36 views

BLDC Motor Driver with ATMEGA2560

I have basic knowledge about AVR microcontrollers and AVR programming.In this days i am trying to design bldc motor driver.I want to use atmega2560 for controller of this driver.For this purpose i ...
0
votes
0answers
12 views

pyupdi 1s timeout in readline

I just installed pyupdi and it works, but is very slow. I googled this and AVRfreaks says something about delay settings which seems irrelevant in my case (while ...
0
votes
0answers
9 views

pymcuprog AvrCommandError: AVR response DAP command failed

I am trying to use pymcuprog with Atmel-ICE and a trivial ATtiny406 board. The Atmel-ICE and ATtiny406 board are working fine together in Atmel Studio. For Linux, I ...
0
votes
1answer
24 views

How do I invoke pymcuprog?

I have successfully created an ATtiny406 binary using avr-gcc in Linux, and I can program it to the device via Atmel-ICE under Atmel Studio in Windows, and it ...
0
votes
2answers
83 views

ESP chips vs AVR [closed]

I recently got an Esp32 module and I was wondering how does Esp chips differ from AVR chips in general. What I know is there is a huge difference in specs and peripheral of the two, as the chip's ...
2
votes
2answers
115 views

Moving Data, Bss and heap memory to external SRAM Atmega2560

This is my first question here, sorry if I miss something. I’m using an Atmega2560 as main processor for my project but I’m running out of ram so I have connected an external 64 KB (64 x 8) SRAM to it....
0
votes
1answer
70 views

Does a firmware (flash memory) in atmel mcus change on runtime (to store variables for example)?

EDIT: I am purposely trying to corrupt my ATxmega32E5 flash memory. I am disabling my BOD level on my ATxmega32E5 and checking how it affects my MCU by switching the power on the mcu on and off with a ...
0
votes
1answer
81 views

Choosing the right Brown-out level

I'm working with ATmega1280 (Datasheet link) Currently I'm using the internal RC-oscillator at 8MHz I'm also using Telit LE910 for sending data that can take up to 2A (from the Telit hardware user ...
0
votes
1answer
53 views

Controlling WS2818B matrix with ATTiny85

I am working on a small LED board project. The LED board is a 16x16 panel of WS2818B LEDs; they are also known as Neopixels. Controlling these thing is a bit of a pain, and I thought I would look ...
0
votes
1answer
56 views

What to consider when choosing a crystal

I'm working on a Datalogger project power by a battery that needs to take sensor measurements and broadcast the parameters to a server. The power source to the CPU is 3.3Vcc from the battery. The ...
0
votes
2answers
74 views

485 does not work some times

in fact i have several boards like Analog barrier, digital barrier, uart barrier and power control. they are connected to together by RS485. but some times when some of 485 don't work of the RX led ...
0
votes
1answer
34 views

ATXMega ADC - What is bandgap reference and temperature?

On my ATXMega128A1U, I am using ADCA to measure an input voltage (roughly ~1.70V) and I plan to use a VREF of 2.5V. I was reading the XMEGA manual, specifically for the REFCTRL register where I would ...
1
vote
0answers
27 views

atmega328p UART rx pin

I have simple co2 meter using atmega328p as uC (Arduino mini Pro board actually). Microcontroller is sending measurements over FT232RL to a PC host (one way communication from AVR to PC), but this ...
0
votes
0answers
56 views

How to assess worst case runtime and correctness of an assembly implementation?

Set off by a question on CodeReview, I revisited "8-bit AVR unsigned division". Trying much the same as for below 8 bit/8 bit → Q, R implementation, I found assessment of cycle counts of an &...
0
votes
1answer
40 views

Controlling AVR reset via voltage divider

I have an AVR atmega32u4 which is being run on 3.3v. I program it using a avr usbisp, which runs at 5v.. The problem i'm having is driving the reset pin.. I currently have this schematic where ...
0
votes
0answers
30 views

How to flash ATtiny85 with clock quartz (32khz) again?

I flashed ATtiny85 once with simple program blinking for 1 second. F_CPU = 32768. I set low fuse byte to 0xe6 with avrdude. According to datasheet 6 = 0b0110 CKSEL is intended for low frequency quartz ...
0
votes
0answers
49 views

How to implement `analogRead` (Arduino) on AVR?

I'm trying to implement Pin class in C++ with digitalRead, digitalWrite, ...
0
votes
1answer
30 views

UART doesn't transmit all characters when using UDREn interrupt

Note: I am beginner :) MCU: Atemega328p In Method 1, I am using a UDRn data register empty interrupt once the transmit buffer is empty and inputting characters from ...
1
vote
2answers
63 views

Does this interrupt improve performance even with while loop in ISR?

Note: I am a beginner :) MCU: Atmega328p Which program below burdens the CPU the least? Would it be a significant difference? Objective: to make a more "efficient" serial monitor by ...
0
votes
2answers
62 views

Checking and reading bits using while loops

Note: I am a beginner :) MCU: Atmega328p I am struggling to understand how reading registers using while loops work in Embed C: For example AVR-C USART Protocol: ...
1
vote
2answers
108 views

Why would you right shift 8 bits for 8 bit register?

MCU: Atemega328P Datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf (Page 143 - USART) Note: I am beginner :) Using the BAUD ...
0
votes
1answer
41 views

Unsigned int values gives negative number above the halfway point of max byte value?

MCU: Atemga328P: Datasheet:https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf Note: I am a beginner :) Considering a 2 byte ...
0
votes
1answer
37 views

Error Real Time Clock implementation AVR microcontroller

I want to create a real-time clock using ATmega328p microcontroller. The microcontroller's frequency is 1 MHz. So, I think I should use timer interrupts in CTC mode to generate interrupt every second. ...
1
vote
1answer
75 views

C++ AVR big code size & excess unused symbols in build file

I'm developing the program for the AVR microcontroller in C++. I have created a class that contains 8 methods(with constructors) but used only 3. Class code: ...
2
votes
1answer
102 views

C++ AVR microcontroller optimization problem

I'm faced with a weird problem. I'm developing a program for AVR. Microcontroller ATtiny85. Frequency 1 MHz. Programmer ...
1
vote
2answers
84 views

Tact switches only work once

I am trying to do a digital clock using an Atmega8A, LCD display (2x16) and four tact switches. Key number 1 is connected to pin PD2, number 2 to PD3, number 3 to PB6, number 4 to PB7. When you press ...
0
votes
0answers
41 views

How to replace AVR _delay_ms() with timer

Good day. I need problem with replacing _delay_ms() bultin function with timer. MCU: Atmega644@16Mhz My code (simplified): ...
0
votes
0answers
38 views

How to change LUFA default 8MHz crystal setting?

I have an Atmega32u4 micro controller with minimum hardware design. It has an embedded USB compatibility which can be enable/used with some software like LUFA. Everything works fine (the computer ...
0
votes
3answers
67 views

How to write own ISR handler

I am learning about avr programming and i know we have to use avr/interrupt.h library to use interrupt but my main reason to learn avr programming is to program without any library so i want to know, ...
0
votes
1answer
94 views

What is the fastest (in clock cycles) 16-bit x 16-bit unsigned integer division algorithm that will run on an ATMEGA1284?

What is the fastest (in clock cycles) division algorithm that will run on an ATMEGA1284? The dividend is an unsigned 16-bit number passed into the algorithm in a pair of 8-bit registers. The divisor ...
0
votes
1answer
32 views

Attiny861 programming current

What current does it consume during serial programming? According to datasheet it’s about 6000uA at 3.3V. I have to power it from a 10mA ldo, but now I’m not sure that it will be enough. To keep ...
1
vote
0answers
37 views

ATtiny85 Yikes Error While Burning Bootloader

I'm using an Elegoo uno to burn the ArduinoISP example code on to an ATtiny85 SMD. I wired the board according to the "#define USE_OLD_STYLE_WIRING" using pins 13/12/11/10. The wiring ...
0
votes
1answer
33 views

ADIF is set first or ADSC is cleared first?

I am using an ATmega8A for ADC conversion. I start ADC conversion by setting ADSC bit and wait till it clears by hardware to detect the end of conversion. I saw some people checking the ADIF bit to ...
0
votes
1answer
29 views

Use attiny as an external watchout timer

I like to failsafe an Atmega8 mcu despite having its own WDT. does it make sense that if I add an attiny to the circuit to check if each loop is taking a specific time, if not reset the Atmega chip?
1
vote
1answer
68 views

Execution of a piece of code in embedded

Can anyone explain to me step by step What is the result of executing the code below: DDRB = 0; unsigned char temp; temp = (PINB & (1 << 4)) >> 4;
0
votes
1answer
56 views

USB device detection problem on a Raspberry Pi

I have a device constructed from a Raspberry Pi 3 B and an AVR based USB device. The interconnection of these components is depicted in this picture. When RPI is on, data lines of keyboard will be ...
3
votes
0answers
115 views

ISR won't modify a global variable (IAR)?

First, some background on what I'm working on. I have a custom board with ATmega324A that I designed as part of a project I'm working on. Originally, software for the uC was written for GCC in Atmel ...
1
vote
0answers
72 views

ATtiny10 not running program

Im using an arduino uno to upload code via TPI to an Attiny10-TSHR on breadboard. Communicating with the chip works fine and uploading code but it never runs the code. By dumping the chip memory I can ...
0
votes
0answers
78 views

Chosing a small microcontroller

My IO/peripheral requirements are extremely minimal (I2C, a timer output, 2-3 GPIO). Problem is, I'm not sure how much "compute" I need, especially since there's not a lot of straightforward ...
1
vote
1answer
58 views

Why does the AVR Assembler linker think my data table is at the wrong address?

MCU: ATmega1284 Programmer: JTAGICE3 IDE: Atmel Studio 7.0.2397 Language: AVR Assembler I have a constant data table in flash memory. The linker thinks it is located at address 0x0090, so when I ...
2
votes
2answers
166 views

Accuracy problem with simple thermometer project

I have built a simple circuit that should send temperature mesurements using a radio module. The main component are: Attiny84a microcontroller RFM69HW transceiver LMT86 sensor The project is powered ...

1
2 3 4 5
36