Skip to main content

Questions tagged [avr]

AVR is the family of microcontrollers used in Arduino boards.

Filter by
Sorted by
Tagged with
0 votes
1 answer
42 views

Why does the ADC report 0 in this sketch?

This sketch always reports 0 for the ADC reading. I think this is going to turn out to be something silly, but I cannot find the source. I've reviewed the sketch ADC lines carefully and they seem ...
Bryan Hanson's user avatar
1 vote
0 answers
217 views

I just downloaded the Arduino IDE and it doesn't compile any code

FQBN: arduino:avr:uno Using board 'uno' from platform in folder: C:\Users\Kareem\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6 Using core 'arduino' from platform in folder: C:\Users\...
kareem's user avatar
  • 11
1 vote
1 answer
120 views

Need Digistump library for QWERTY keyboard and Fixes for my issues!

Hello there🖐 I am trying to install Digistump library to support ATTiny85 by digispark. But I am encountering a problem when trying to install Digistump AVR boards after adding an additional board ...
Arun Jothi's user avatar
2 votes
2 answers
350 views

How .data + .text section can be = How much flash the final program will consume

I could not understand one point related with Arduino code. Let's say i have following code void setup() { Serial.begin(9600); Serial.println("foo"); } void loop() { } When i ...
embeddedstack's user avatar
5 votes
1 answer
242 views

Pin Change Interrupt Flag timing on 1284P

I want to ask about pin change interrupts on a 1284P chip using MightyCore. I have a question about the timing of multiple interrupts on one port. Specifically, if I am servicing a PCINT vector and ...
Delta_G's user avatar
  • 3,270
3 votes
1 answer
440 views

Arduino Uno R3 assembly code to push a button and turn on a LED

I've been trying this for days without success... I need to turn on a LED on portb when a button in portd is pushed. Cabling works, I've tested it with Arduino IDE and it works like a charm. This is ...
mcflurry's user avatar
2 votes
2 answers
233 views

Barebones AVR - Connecting RESET pin to Vcc

I want to build my first barebones AVR circuit. I plan on NOT having a RESET button. For this reason, is it valid if I connect the ATMEGA's RESET pin to Vcc directly? What I mean by this, is that in ...
user1584421's user avatar
  • 1,395
1 vote
0 answers
218 views

fatal error: avr/io.h: No such file or directory (on Windows 11)

So I'm using arduino 1.8.18 installed on zip file. I am using the HardWire library. The project is the STM32 quadcopter by joop brokking. http://www.brokking.net/ymfc-32_downloads.html complete error -...
IshA's user avatar
  • 11
1 vote
2 answers
135 views

What's Memory Allocation technique in Arduino

I am currently working on an assignment for my embedded systems course, and my professor has asked us to determine the memory allocation technique employed in Arduino. Specifically, I need to identify ...
Noran Hany's user avatar
1 vote
1 answer
114 views

Checking a thing about interrupts

If I disable interrupts (for example noInterrupts or cli) and enable them (interrupts or sei for example) later, would interrupts which would have executed in the window in between fire by the ...
markoj's user avatar
  • 43
1 vote
0 answers
35 views

Atmega328P constantly restarting when defining a function

I wanted to make a simple led on/off program using USART interface. When the code doesn't have any functions other than main it runs fine, however Arduino keeps resetting when one is included. At this ...
L1RG0's user avatar
  • 19
1 vote
2 answers
363 views

Timer 1 "Set on Compare Match" in Normal Mode - Not working

I'm using the hardware timers on the 328 for phase angle control of a triac with zero-crossing detection. I am encountering some strange behavior with the "Set on Compare Match" feature not ...
saustinp's user avatar
0 votes
2 answers
216 views

slower clock frequency than expected on attiny202

I am programming an attiny202 which as per datasheet can run up to 20Mhz, but after compiling/uploading this simple code to the attiny202 and watch the PA2 pin on the oscilloscope, I see that the pin ...
Joe Cabezas's user avatar
2 votes
1 answer
138 views

Issues Uploading Code to ATTiny84 with Sparkfun AVR Pocket Programmer and ATTinyCore

I am getting back into programming with Arduino and built a POV fidget spinner inspired by an instructable by MakersBox. I am using the SparkFun AVR Pocket Programmer and an ATTiny84 (8MHz internal ...
fmarquet's user avatar
-1 votes
1 answer
357 views

How to correctly set PWM to control servo angle in AVR?

I've stumbled upon timer configuration to handle my sg-90 servo and my Arduino UNO. What I did: Set the prescaler to 64 and mode to fast PWM of 16-bit timer. The frequency is 50hz so the ICR1 is set ...
ErnestW's user avatar
  • 109
-1 votes
2 answers
375 views

Upload to board with no USB connection

I have a Spark Fun Pro Micro (ATmega32U4) without a USB connection (it was broken off at an earlier point) that I want to use to duplicate a prototype running on another Pro Micro. How can I upload a ...
InkyDigits's user avatar
2 votes
0 answers
83 views

STK8231 accelerometer, getting two axis (x & y data) but not z, also in 0-255

Here is the datasheet I followed: https://lcsc.com/product-detail/Motion-Sensors-Accelerometers_SENSORTEK-STK8321_C966924.html We are trying the following code: #include <Wire.h> int ...
narendok's user avatar
0 votes
2 answers
1k views

How does erasing the EEPROM work?

The datasheet for the ATmega328P contains this table, which describes bits 4 and 5 of EECR: EEPM1 EEPM0 Programming Time Operation 0 0 3.4ms Erase and write in one operation (atomic operation) 0 1 ...
glibg10b's user avatar
  • 317
1 vote
1 answer
259 views

How do I build and upload a C++ program without the Arduino Library or IDE?

Note: This is a reference question (but feel free to write answers of your own!) I want to use the AVR tools directly -- no arduino-builder or arduino-cli. I would also like compilation and uploading ...
glibg10b's user avatar
  • 317
0 votes
1 answer
355 views

Working with two analog sensors, ATmega16

I want to work with two analog sensors connected to ATmega16. The first one is the temperature sensor (LM35), connected to PA0. The LED should be ON when the temperature goes high. The second one is ...
cerouno's user avatar
1 vote
1 answer
885 views

How to pass non-static class member to callback on avr platforms?

I am using the PubSubClient library in my own Arduino library. I'm having trouble with trying to assign a class member as the client library setCallback callback function. MyClass.cpp: #include <...
Hemant Bhargava's user avatar
1 vote
0 answers
808 views

I2C / TWI: set up atmega328p as slave

I try to run an atmega328p as a i2c slave. even with the bare minimum the slave acts as its not wired at all: NACK is transmitted after request (see logic analyzer). The master should read a constant ...
micro_'s user avatar
  • 21
1 vote
0 answers
685 views

ESP32 + Attiny85 AC Dimmer

I am working on an AC Dimmer project using ESP32 and Attiny85. Note : I know ATtiny85 is overkill for this project, And it can be done without Attiny85, I have already done this using ESP32 alone. ...
Mayoogh Girish's user avatar
2 votes
0 answers
552 views

Attiny85 uploading error

I am getting an error while trying to upload programs to the Attiny85 through a USBTinyISP programmer, found here. Unfortunately, it isn't working. Following this tutorial for connecting the board and ...
user76915's user avatar
1 vote
0 answers
58 views

Fresh install getting Assembler Error

I am using Raspberry Pi 4 to connect via usb to program ardino Nano, I intend to communicate with the nano via i2c, but this is irrelivant. With a fresh install of Arduino for ARM 32 bit I get this ...
Arcanist's user avatar
1 vote
1 answer
273 views

Why do I get different results when compiling the same code with different ide?

I have a basic code about reading true rms.I compiled the same code with arduino ide and atmel studio, then ran it in a proteus simulation.I'm trying to measure how long the read_rms() function takes. ...
harun caliskanoglu's user avatar
1 vote
1 answer
214 views

ISP Programmer with Serial and 5v/3.3v power

I currently use a Pololu USB AVR Programmer v2.1 for programming 328p chips and I really like it. The ability to have ISP and Serial in one physical device, enumerating as two separate COM ports on ...
Kevin W's user avatar
  • 21
1 vote
1 answer
773 views

How to add two assembly arrays in arduino

Hey guys what I'm trying to do is to sum two arrays and return a new array; for example if given uint8_t a[] = {2, 4, 6}; uint8_t b[] = {1, 2, 3}; I should get { 3, 6, 9} What I'm trying to do is ...
John Rawls's user avatar
1 vote
1 answer
3k views

Assign an interrupt to any pin of the atmega328 microcontroller

I need to record the appearance of a signal from the sensor on the PD0 pin. This is the first time in my life that I want to use an interrupt for this. With your help, I configured the sketch for my ...
Антон's user avatar
1 vote
1 answer
53 views

Is it possible my ATMega is burnt due to bad wiring?

While working on a project I tried sending data from my Arduino NANO to ATMega64 placed on AREXX Robot arm PCB via TXD/RXD. After plugging in VCC, GND, TXD and RXD to UART socket it didn't work so I ...
FewArc's user avatar
  • 13
1 vote
1 answer
354 views

Problem with programming digispark ATtiny85 board with Arduino IDE

I have bought a Digispark ATtiny85 board to learn about that microcontroller. So I tried using internal register names in the code rather than using Arduino in built functions. I can get the board to ...
Frank Donald's user avatar
1 vote
1 answer
48 views

About maximum length of matrix can be use for matrix invertsion on atmega32

what is the maximum length for matrix can be used for matrix inversion on atmega32,for example,can we implement matrix inversion for 15x15 matrix on atmega32? And if it can be done on atmega32..does ...
user255471's user avatar
1 vote
0 answers
930 views

Digispark green led being the only one to turn on

I was doing some tests with an ATtiny85 Digispark module using Arduino IDE on my Windows PC. I was testing some stuff with the DigiKeyboard library from Digistump. Everything was going fine until ...
Vile's user avatar
  • 21
1 vote
0 answers
83 views

Is it possible to implement old AVR library onto arduino (specifically, NodeMCU esp8266)

I am a Computer Engineering Undergrad, currently in a cryptography(computer security) course, and I was assigned to do projects about implementing µNaCl library onto Arduino. I currently own a nodemcu ...
Nobel Edgar's user avatar
1 vote
2 answers
4k views

Attiny85 microcontroller programming without arduino

I have decided to make a simple project so thinked about arduino but that seems very worthy so i decided to use attiny85 ic for my project,but i don't have arduino or avr to program it. Is there any ...
johnson veigas's user avatar
2 votes
1 answer
100 views

3-instruction remote machine coding Arduino Atmel chip over a serial line from a tethered (host) PC

I'm trying to write a program for AVR Atmel 328 chip on Arduino Nano board that will allow me to send machine code instructions to the chip over a serial line, run/execute them on the chip, and ...
Assad Ebrahim's user avatar
5 votes
4 answers
1k views

How can a function/method determine if a const array passed in is PROGMEM (flash) or not (RAM)?

Is it possible for a function/method to know if a constant array that has been passed in is in flash or RAM? If I have a method or function that receives a constant array that is in RAM, the array is ...
Casey's user avatar
  • 151
0 votes
0 answers
236 views

how do i convert to assembly code (AVR assembly) from arduino

i have code in the Arduino ide for a temperature sensor that shows the temperature on three 7 segment displays, it shows the temperature to one decimal point. using an arduino uno. I am struggling to ...
dirshan ramlall's user avatar
1 vote
0 answers
109 views

Trying to use Timer0 on Arduino Mega

I've recently been looking at Timers and I'm trying to generate a PWM frequency at 250000Hz using Timer0 on PIN 4. When I set OCR0A = 63 I get nothing from the light however when I set OCR0A = 125 it ...
DaveS's user avatar
  • 11
3 votes
2 answers
2k views

AVR & PIC 8-bit Microcontrollers - Can you add: external flash memory, external RAM, video & audio output, more address busses?

so I was planning on creating a mini PC out of basic ICs and 8-bit microcontrollers such as ATTinys and/or PICs and I have several questions regarding those: Can you add external RAM, say with SRAM, ...
Shimon Pokrivka's user avatar
-2 votes
1 answer
155 views

Reading PROGMEM results in an incorrect hex value [closed]

I'm sure I'm doing something stupid here, but the code below is supposed to write the test hex values to a I2C EEPROM, however when I attempt to read the EEPROM it has the wrong values. Directly ...
Ryan Rife's user avatar
0 votes
1 answer
2k views

Use of progmem in ESP8266 vs AVR and also how to handle large dynamic strings

This is a somewhat tricky question dealing with implementation and best-practices of the ESP8266. I'd ideally hope that it's answered by people with in-depth knowledge on the problem. As you are ...
user avatar
1 vote
0 answers
33 views

about receiving float on Atmega32 from matlab

I want to receive a float on Atmega32 from matlab. I display the output on an lcd, but i receive 0.000, can any one help me? Please ... matlab code s=serial('COM1','BaudRate',9600); fopen(s) fwrite(...
mohamed's user avatar
  • 75
1 vote
2 answers
75 views

about receiving float on matlab from ATmega32 Avr

****i am using ATmega32 to send float and want to receive it on matlab,i send 4.85 from ATmega32 but on matlab i receive 4.260233679216239e-31...can any one help me..thanks in advance** ** //...
mohamed's user avatar
  • 75
1 vote
0 answers
58 views

default in switch doesn't appear to execute

I have a situation where the default case in my switch statement doesn't appear to execute as expected. I wonder if there is some subtlety I'm missing here? Given the following enum: enum ...
Tim Long's user avatar
  • 305
0 votes
1 answer
1k views

Cannot write to HID USB device (Arduino, V-USB, HidSharp)

I am currently prototyping an HID USB device using Arduino Nano and V-USB library. The problem is that although I can read from the device I cannot write to it. Here is the schema: As for the ...
Pawlakov's user avatar
1 vote
1 answer
315 views

Atmega328p Uploads via ISP but not bootloader

I'm trying to upload a bootloader to my atmega328p on a custom pcb containing external oscillator at 16MHz. It is possible to upload program via ICSP pins using Arduino as ISP (Official Arduino Uno) ...
Deniz da King's user avatar
-1 votes
3 answers
2k views

Why are embedded C codes are ending with "while(1)"?

I always see while(1); at the end of the C codes such as: #include <stdio.h> int main(void) { //Some code here... while(1); } If I'm not wrong that it always exists, what is the ...
GNZ's user avatar
  • 97
0 votes
1 answer
251 views

C++ State Machine / Wpmf-convesion

I'm quite a newbie using C ++. I am trying to implement in C ++, the state machine described in this link for C language: https://barrgroup.com/Embedded-Systems/How-To/Coding-State-Machines. I have ...
ezeg's user avatar
  • 18
1 vote
0 answers
38 views

Custom bootloader for battery level indicator

For a project I need to be able to read the battery level of the device regardless of the sketch currently running. For this I plan on adding a custom routine in the Arduino bootloader that reads the ...
KhouryAbdo's user avatar

1
2 3 4 5 6