Questions tagged [avr]

AVR is the family of microcontrollers used in Arduino boards.

Filter by
Sorted by
Tagged with
0
votes
1answer
24 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) ...
0
votes
2answers
40 views

Atmega collecting and relaying interrupt calls

I like to collect all possible interrupt and relay them to an alternative handler interrupt table what the user can set. In order to do this i have to: 1) collect all/any interrup request 2) ...
2
votes
2answers
864 views

programming arduino in pure c

I'm trying to flash pure c-code to arduino Mega2560 board from linux using avr-gcc & avrdude. Compilation is done , now trying to flash using avr-dude, getting error as "avrdude: stk500_recv(): ...
0
votes
3answers
63 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 ...
0
votes
1answer
53 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 ...
0
votes
0answers
186 views

AVR-Toolchain for Arduino crashes on Mac OSX 10.11.6: Hints or debugging help needed

My Arduino IDE does not compile any project since I updated from Mac OSX 10.6.8 to 10.11.6. I even tried reinstalling and also manually installing the original AVR-toolchain. But the behaviour did ...
0
votes
2answers
524 views

Use Arduino Uno to program the on-board Atmega328 in C

I have an Arduino Uno board. I have seen how it is possible to program external AVR's through the Arduino Uno board, for instance an ATtiny. But I'm starting with c for atmel µc and I just want to ...
2
votes
2answers
5k views

Since double and float represent the same data type (usually), which is preferable?

It looks like on ATMega based boards, float and double are equivalent 32-bit (4-byte) data types. However, on the Arduino Due, doubles are 64-bit (8-byte) where floats are 32-bit (4-byte), same as ...
0
votes
1answer
353 views

BASCOM-AVR stk500_2_ReceiveMessage(): timeout: -1

Arduino Uno R3 Windows 10 Bascom AVR The ON is alright. The LED flickers now and then. The RX and TX flickers when I press the program button on Bascom but then disappears almost immediately. ...
2
votes
1answer
123 views

AVR-GCC can't call function located on fixed address

I wrote the following code: #include <avr/io.h> __attribute__((noinline, section(".app_start"))) void app_start() //app_start section starts at 0xFA0 { //register_packet_dispatch(...
0
votes
1answer
111 views

avr-gcc -D is ignored

Im trying to use XCode to compile avr program with arduino libs but seems like something wrong with my Makefile because it throws me warnings like # warning "F_CPU not defined for <util/delay.h&...
0
votes
0answers
24 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 ...
0
votes
2answers
6k views

Can't burn bootloader through Arduino Nano clone ISP to atmega328p

I'm trying to use a Nano v3 as ISP to program an atmega328p on a board with ISP headers: I followed the instructions under https://www.arduino.cc/en/Tutorial/ArduinoISP which I think have been ...
0
votes
1answer
99 views

Uploading Firmware to Atmega1284p using ESP8266 with AVRISP as programmer

I am trying to flash a new Firmware to my Ender 3 Pro. I am using the ESP8266 as an ISP via AVRISP over Wifi. I have a 10mF capacitor between the ground and reset of the ESP8266 I followed this ...
0
votes
0answers
38 views

AVR program upload overrides unrelated program area

I develope a new bus system (uartbus) which includes a host application that can handle new program uploads throught the bus. How it's work in short: The host application flashed to the AVR. This ...
-1
votes
1answer
85 views

About UART one transmitter multiple receivers

I have vector nav vn100 IMU that sends data serially rs232...I want to drive 4 servo motors using atmega32 upon roll angel from vector nav vn100..atmega32 can only drive 2 servos using hardware fast ...
0
votes
2answers
49 views

Using an Arduino Nano to program (as ISP) a standalone 328p

I uploaded the ArduinoISP sketch to an Arduino Nano to use it as a programmer for other chips. It worked successfully to program an ATtiny45, I did the usual wiring between them, and added a 10uF ...
2
votes
2answers
74 views

Change the fuses of an Arduino Uno (can an Arduino Uno change its own fuses?)

For now, I'm using an Arduino Uno alone including its 328p (no other external chip to program). I would like to change its fuses to internal 8 Mhz clock (because then I'll move the 328p out of the ...
0
votes
0answers
49 views

about required memory size in ATmega32 to execute a certain program

If I want to add two numbers and print the output on LCD char answer[8]; float a=5.1,b=3.2,c; c=a+b; dtostrf(c,8,3,answer);//convert float to ASCII to print it on LCD for(i=0;i<8;i++) ...
0
votes
2answers
87 views

Help - Atmega328p, converting a PWM servo code from pin9 to pin6

I found a working code that uses pin9 (PB1) on my Arduino for controlling a Servo, but in my project, an ultrasonic sensor is already using that pin/timer. I want to convert the code to use pin6 (PD6),...
0
votes
1answer
46 views

How to set PC (Program Counter) register to another function (for scheduler)

I am trying to implement a scheduler for Arduino Mega 2560. I think I lack understanding of how to set the PC register to another instruction. Here is my simple approach so far: void dummy(){ ...
0
votes
0answers
69 views

Program uploads, but outputs flash reading error?

I'm new to Arduino, and I recently got 3 off-brand Nanos, and soldered pins for all three. Initially, none worked (I always received avrdude's errors when uploading). Based on my research, I ...
1
vote
0answers
682 views

Does Proteus simulate external interrupts properly using Arduino? I can't get them to work

I am trying to simulate an interrupt with an Arduino Uno in Proteus. This is the simple test code that I'm using: void introutine() { digitalWrite(13,HIGH); } void setup() { pinMode(13,OUTPUT); ...
1
vote
1answer
40 views

about how to share one External serial EEprom using two microcontrollers?

strong texti have Vector nav100 IMU sensor that sends data serially UART.I want to receive data from it using ATmega32 and then store data in AT24c1024 EEprom using I2C,then using another ATmega32 to ...
1
vote
1answer
46 views

about how to write data in the whole EEprom?

I have interfaced AT24c1024 EEprom with ATmega32.AT24c1024, which has 512 pages each of 256 bytes. There are two mode of writing (byte write and page write). In page write mode, it is capable of ...
-3
votes
1answer
49 views

Rate of serial communication (UART) of a sensor is faster than speed of processing of microcontroller

I have a Vector Nav VN100 IMU sensor that sends data serially UART. I have interfaced it with ATmega32. It receives data (ROLL angel) from the sensor and according to the ROLL angel, it controls a ...
0
votes
2answers
495 views

AVR software reset without watchdog

I wrote a generic avr program wrapper which already use the watchdog timer to restart - and after the watchdog reset - recover the the bad situation. After this recover process i have to restart the ...
1
vote
1answer
45 views

Arduino Timer0 Piggyback

As described here https://learn.adafruit.com/multi-tasking-the-arduino-part-2/timers I use timer 0 to get my own timer with a milliseconds resolution. It is setup like this: void setup (void) { ...
0
votes
0answers
40 views

MEGA2560 only starts program after pressing RESET button multiple times

I am working on a program where I am controlling an MP3 player by using UART between my MEGA2560 and the MP3 player. The MEGA2560 sends serial commands to the MP3 player when external interrupts are ...
0
votes
2answers
52 views

About ATmega32 event system

From my reading on internet i found that the Event system allows peripherals to trigger each other without involving the CPU...does the event system is software or hardware?also does ATmega32 support ...
0
votes
0answers
26 views

freeRTOS tasks never run on Lightblue Bean

Although Punchthrough no longer supports the Bean and Bean+ they still maintain the online compiler and reference materials: Bean Github Bean reference One of the external libraries they've included ...
0
votes
1answer
90 views

Help understanding how avrdude works with ArduinoISP and why its not working for me

I am trying to use avrdude with a Mega2560 running ArduinoISP Note: I have the 10uF cap on the Mega2560 RESET line as described by Ardunio. Also, I am using avrdude/6.3 on Windows 10. The Mega2560(...
1
vote
2answers
85 views

Use ATTiny as a battery-backed RAM?

So, I found an interesting article the other day, and I'm trying to build a project that could benefit from a battery-backed memory (no wear limits, but keeps data over power cycling). The article ...
1
vote
0answers
21 views

Custom Arduino Due Random Lock up

I have built my own Arduino Due Circuit board. I am having issues with it randomly locking up. I have researched the libraries and have ruled out any issues with them such as the Wire library. I am ...
0
votes
0answers
25 views

Moving timer-related code into a separate file causing timing inconsistencies?

I have written the following code, attempting to re-implement the Arduino micros function: main.c #include <avr/interrupt.h> #include <stdbool.h> #define CLOCK_CYCLES_PER_MICROSECOND (...
0
votes
0answers
235 views

how to fix USBASP Unknown USB Device (device descriptor request failed) - Win 10?

I just recently purchased Usbasp from Ali Express, when i'm connecting it to the windows 10 desktop in device manager its Unknown USB Device (device descriptor request failed). How to fix this error? ...
0
votes
1answer
214 views

Restoring all fuse bits on AtMega328P-PU

I'm worked with Low Fuse bits in AVRDUDEPROG 3.3. Fuses was non-inverted. And by mistake I enabled SUT1 and SUT0, when SUT0 was enabled. And when I programmed avr, it shows me error that avrdude.exe: ...
5
votes
1answer
154 views

Can I program a factory fresh Atmega328P through UART pins without burning a bootloader?

Can I program a factory fresh ATMega328P using the UART pins without burning a bootloader? These pins are TX, RX, VCC, GND, and DTR pins in the schematic below. They are not the ISP/SPI pins 10-13. ...
0
votes
0answers
21 views

What would cause fuses to be writeable but bootloader not to be writeable?

I am trying to burn a bootloader onto an ATmega328P-AN using an Microcenter knock-off Arduino Uno R3 as my ISP for several days with no luck. The farthest I've gotten is writing and reading a few ...
0
votes
0answers
34 views

can an ISR change the value passed by pointer while the subroutine is executing?

So I am working on a project where the board plays a song on a buzzer using PWM and I want the song to stop when i press an external button typedef enum stateType_enum{ waitPress, debouncePress, ...
1
vote
1answer
68 views

Force TCNT to stay below OCRxA on ATmega328P

I'm using a timer and the TIMERx_COMPA ISR to generate a signal in "the background". This ISR is triggered when the timer reaches a certain value (OCRxA), which in turn can be changed by the user. ...
0
votes
1answer
59 views

About possibility of implementing kalman filter on atmega32 [closed]

I have searched on the internet on how to get Euler angels from IMU measurements,I found that kalman filter and mahony filter are used...kalman filter has a drawback of complex computations,but mahony ...
1
vote
1answer
134 views

.elf and .hex equivalency? (code, eeprom, fuses, and lock bits all in one)

I have all configurations (eeprom data, fuses, lockbits) of my ATMega168A together with the code in my C files. The compilation creates an elf file that I use as an all-in-one programming file for ...
0
votes
0answers
22 views

Installed configuration won't show up on Board menu

So I was following these instructions on the official site. Download this hardware configuration archive: breadboard-1-6-x.zip, Breadboard1-5-x.zip or Breadboard1-0-x.zip depending on which IDE you ...
0
votes
2answers
124 views

where I can find ground? [closed]

there is AVR AVR ATmega32 and a board within. there is outputs for all ports (A, B, C, D) on board, and Vcc. the problem is - I have no external GND output. to watch current - I should search for ...
0
votes
3answers
626 views

How to check if a pin is set from bank?

How would you go about checking if an input pin has been set using the entire bank? I am thinking that I need to use bit twiddling with a bit mask but I have not used this enough to figure out how to ...
-1
votes
1answer
137 views

Can the IDE handle a 32khz main clock?

I read somewhere that having the main clock be 32768Hz messes not only with micros() and millis(), but with some other stuff too. Is this true? Will I have to forgo the Arduino IDE to program for an ...
0
votes
1answer
51 views

Lines not pulsed fast enough (?))

Should this code pulse the PB3 and PB4 pins (MOSI and MISO of an Arduino Uno) at 2ms interval ? #include <avr/io.h> int main(void) { // for (byte i = 0; i < 32; i++) // pinMode(i, ...
0
votes
1answer
63 views

noisy output lines when waking up from a sleep

Using code similar to these examples from AVR https://www.microchip.com/webdoc/AVRLibcReferenceManual/group__avr__sleep.html my program causes my Adafruit Feather 32u4 to often sleep. When the ...
1
vote
1answer
214 views

OpenOCD with FT2232H on Arduino Mega (ATmega2560)

I want to do on-chip-debugging on an Arduino Mega. According to its datasheet, the ATmega2560 chip supports JTAG. (IEEE 1149.1 compliant) Can I use a generic FT2232H interface to do on-chip-debugging ...