Questions tagged [avr]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
75 views

ATmega: Can one determine if an address is program memory or data memory?

On an Atmel ATmega1284 (or any of its AVR cousins), is there any way to determine at compile time or at runtime whether an address that is passed to a function belongs to program memory space or data ...
0
votes
0answers
31 views

How to store the last counting value in EEPROM in ATmega8 after power failure

I written a program to store the last counting value according to ATmega8 datasheet. but it didn't save the last value. The counter variable went to zero after power failure. Please check the ...
1
vote
0answers
44 views

Why can't I connect an external clock oscillator to an ATMEGA64A-AU?

I've decided to change my crystal oscillator for one of those smaller (and also expensive-er!) SMD clock oscillators on ATMEGA64A-AU. I've found this image on the web, which seems right: So I built ...
1
vote
1answer
47 views

Why UART voltage level on ATMEGA64A-AU are different?

Coming from this question I tried to measure voltage on RX1 and TX1 on ATMEGA64A-AU (the second USART) the RX1 voltage is about 3 volt and TX1 is 5 volt(straight out of the chip) which I've provided ...
0
votes
1answer
40 views

Why port B5 on ATMEGA64A-AU mailfunction after enabling USART function?

I've wire up ATMEGA64A-AU based on this schematic from here: I've tried to program a blink on pin B5 which has a LED on it: ...
2
votes
1answer
68 views

Why do I need to make an intermediate step on switching a pin from input to output On Atmega328p microcontroller?

On the Atmega328p datasheet p.99 The following was mentioned. Switching Between Input and Output: When switching between tri-state ({DDxn, PORTxn} = 0b00) and output high ({DDxn, PORTxn} = 0b11), an ...
0
votes
1answer
39 views

About Mahony filter for euler angles estimation

I have read some papers about mahony filter design..the filter corrects the error in gyroscope measurement using PI compensator....the error in gyro reading is calculated using the gravity vector.....
1
vote
0answers
58 views

ATmega328P presumably dead after probable SPI short circuit

I am trying to use an ATmega328P to interface an SPI device (RFM95W radio module). This worked pretty well (I could measure the correct signals on SCK, MISO, MOSI and CS), but after some programming ...
0
votes
1answer
16 views

Issue with avr spi slave interrupt in proteus ATmega8

I want to get some data from spi, but spi interrupt doesnt work. I get a message and a pause in proteus instead of a signal on LCD. How to fix this? My code: ...
0
votes
1answer
68 views

Why does the Atmega328 USART get trapped in a loop?

I have an Atmega328 micrprocessor. I connected its RX/TX pins to an SIM808 module and uploaded this code to the processor to communicate with it and send commands: ...
2
votes
1answer
45 views

AVR setting certain PWM frequency and duty cycle is not working right

I am prototyping a simple LED dimmer on an Arduino Uno (Atmega328p) and I have issues with the PWM frequency and duty cycle I am trying to adjust. To get a frequency of 200Hz flat I am using the CTC ...
1
vote
2answers
29 views

ATmega48PB: wdt in interrupt mode still reset the MCU

I read the datasheet and this question, but there's still something wrong here. Here my wdt init code: ...
1
vote
2answers
59 views

Changing delay duration in _delay_us() changes code size

I was programming an ATtiny13A when I accidentally noticed that when I change the delay time in _delay_us() my code size changes. Here's the sample code: ...
3
votes
1answer
54 views

AVR: do I have to wait for the internal pullup to stabilize?

speaking of an ATMega2560 (not Arduino!), I connected a simple push-button between PB6 and GND. There is a bootloader and ...
0
votes
1answer
61 views

program stops execution after reception of a single character over UART

Why this simple program stops execution after reception of a single character over UART? Normally the program blinks LED every half of second. When character is received the ISR should start. Nothing ...
1
vote
0answers
42 views

How to uplad program into Arduino Nano Clone with CH340?

I've started to build a Arduino Nano with CH340g using this schematic: Which use the CH340 chip : With one difference, I've use SPI pin to program the MCU. I've uploaded OptiBoot to Atmega328 and ...
0
votes
1answer
58 views

Why isn't software USB/TTL on ATmega328p working?

I've tried to implement an AVR-CDC project. I found this website which is recommended by V-USB (I know it is pretty old project.) I drew this schematic: I've built a PCB basef on it and then I've ...
0
votes
1answer
59 views

How to make an Arduino (ATMEGA16U4) like, software USB to serial on Atmega8u?

I've start to build a project base on Atmega328 and I need to connect to it(via USB for availability of the USB port) for debugging (I prefer to debug it with serial communication), and I don't want ...
1
vote
1answer
54 views

Inconsistent bootloader failure ATMEGA328P

I am creating a wireless charger with a microcontroller on it. I have assembled 3 boards. One of them has a microcontroller that works fine - burns bootloader and uploads code sketch fine. However, I ...
0
votes
2answers
48 views

Smoke calculation with mq2 sensor

How to calculate the amount of smoke output from the mq2 sensor?
0
votes
1answer
42 views

I2C Communication in AVR

The first step in a TWI transmission is to transmit a START condition. This is done by writing a specific value into TWCR, instructing the TWI hardware to transmit a START condition. Which value to ...
2
votes
1answer
114 views

Configuring Atmega32 timer using the oscillator without prescaling gives wrong delay time

I am using AVR atmega32 microcontroller. The code below is supposed to toggle the LED connected to PORTD. The frequency of the oscillator connected to the ...
0
votes
3answers
84 views

MCU controlled power-on sequence

I would like to implement the power-on sequence of an IC. It has 3 different power supplies plus the clock, which has to be enabled after the power supplies. I am considering employing a ATTINY202 for ...
0
votes
1answer
102 views

What will happen if 1/0 condition appears in microcontroller?

I need to implement the following function in a microcontroller: \begin{equation} \ k= (v_{(n)} - v_{(n-1)})^{-3} \end{equation} Here, 'v' stands for signal amplitude and 'n' for sample number. If the ...
0
votes
2answers
39 views

Tracking Down Compiled Binary Output Differences

I have a program compiled using AVR-GCC. I'm getting a small difference in the HEX files generated on two different computers that are ostensibly set up with the same environments. I also have an ELF ...
0
votes
0answers
40 views

EEPROM chip always toggling bit when reading

I have a parallel EEPROM, the AT29C020 (doc: http://pdf.datasheetcatalog.com/datasheet/atmel/DOC0291.PDF) In order to read it I'm using an ATMega8535 as it has enough pins. At first I thought reading ...
0
votes
0answers
29 views

Atmega16U4 (Hardware USB) does not show up as DFU device on device manager

I am trying to get the Atmega16U4 to show up in windows device manager. Right now, when I connect the atmega16U4 through USB to the computer it does not do anything (does not even play the USB ...
1
vote
0answers
46 views

Issues using a 74LS245 with Attiny85

I have a Raspberry Pi, a 74LS245, and an ATTiny85. I connected the Pi to the Tiny through 1k resistors, and am able to use SPI to program it, no problem. I have added a 74LS245 inbetween, to ...
1
vote
1answer
67 views

Protecting a 3.3V board against a 5V programmer

I'm designing a home automation board with ATmega328. For programming it I'm exposing the appropriate pins via the AVR ISP interface. Now some ICs of the board allow only up to 3.5V power. What are ...
0
votes
1answer
40 views

How to send a text message from an ATMEGA328PB microcontroller [closed]

I am looking to make a project with an ATMega328PB microcontroller. I want to tell when my mailbox has been opened and to send some sort of notification. I was thinking of use a GSM module to send ...
0
votes
0answers
47 views

SPI MOSI line only hits 1.2V for speeds above 500kHz and below 4MHz (3.3V logic)

I'm trying to drive a ST7789 TFT display (datasheet) with an ATTiny-416, but for some reason SPI fails at speeds above 500kHz. So far I've had these results: 500kHz: pass 666kHz: fail 1MHz: fail ...
0
votes
0answers
33 views

Implementing UART driver with Interrupts and DMA - UART_RXC ISR is executed only first time a character is received

I am using ATxMega 32E5 and my current task is to rewrite existing RS485 driver and use DMA to save in my case valuable cycles (the speed is going to be multiplied by 8x going from 230k to 2M baudrate)...
1
vote
1answer
52 views

Attiny13 affects USBtiny programmer logic voltage levels

I wanted to port a simple program from an Attiny85 to the cheaper Attiny13. To make sure everything would work properly I started trying to upload a simple blink program to the MCU but could not get ...
1
vote
4answers
151 views

Do I need voltage regulator?

I power my board with 5V and I am working with ATMEGA8, so I don't need to reduce the voltage. Do I still need voltage regulator for stabilization? And if I do, would this work? I used here 5V ...
0
votes
0answers
63 views

Read specific line faster

i am working on a mp3 player project for hobby use,i use atmega644pa @12Mhz and use fatfs library via spi.Avr has no enough sram to the long file names so I tried to store long file names in a text ...
0
votes
2answers
51 views

How to calclate Rb value for NPN transistor?

Here is a part of my schematic. K pin from LCD is connected to NPN transistor. A pin is connected to Vcc, 5V. Base is connected to uController. It is Atmega16. 5V supply. I am using BC547 transistor ...
0
votes
1answer
51 views

Semaphore in FreeRTOS doesn’t work

I am a newbie to freeRTOS and I was trying to learn about semaphores,I am using ATmega32a microcontroller, the plan was to create 3 tasks each is blinking the same led for some time with different ...
1
vote
1answer
45 views

ATtiny USB data interrupt

I'm trying to use an ATtiny88 to detect data on a USB line. I have an USB data connection going to a hub and a secondary system and I want to use the ATtiny to detect if any peripheral hardware has ...
1
vote
0answers
58 views

Power supply for ATmega16

I am working with Atmega16 mc and it works on 5V. Also my project consists of IR sensors, LCD and few diodes. All of those works on 5V. I am wondering how can i power this board. I read somewhere i ...
0
votes
0answers
29 views

Why enc28j60 is not responding to another enc28j60?

I interfaced enc28j60 with atmega328p. Then I connected the enc28j60 board1 using ethernet cable to my laptop. I have checked the transmission and reception over the ethernet and it worked. I can sent ...
2
votes
1answer
55 views

How to make hex file for attiny402 microcontroller using winavr

I have written a code in the 'Programmer's Notepad' of winavr. But when I went to make the hex file, I didn't find the attiny402 microcontroller in 'mfile'. Can anyone help me? Now, what should I ...
1
vote
0answers
35 views

How to use ATMega USART in synchronous mode using XCK pin

I'm working on a project with ATMega64 and I have a problem with one of the USART interfaces which is going to work in synchronous mode. when trying to send a test data like: ...
0
votes
0answers
34 views

AVR Interrupt: LED kept blinking and won't stop

Lately I realize I am still a newbie, when you can't blink a freaking LED properly. It's kinda sad. I try to simplify this LED code to the simplest form possible, and it still won't work properly. ...
0
votes
0answers
133 views

AVR LED running too fast!

My LED is running too fast while asleep, and it runs as expected when it's not asleep. Strange!! What is the problem here? ...
3
votes
4answers
1k views

What is meant by 'On-chip 2-cycle Multiplier' for AVR microcontroller?

While checking the datasheet of ATMEGA 32 I have found a feature called 'On-chip 2-cycle Multiplier'. Can anyone explain to me what's that and what's the advantage of it?
1
vote
1answer
42 views

Where is Interrupt Vector Table stored in ATmega32A?

Given that Atmega32A has three types of memory : 1) SRAM. 2) Flash (Program memory). 3)EEPROM. In which section the Interrupt Vector Table is stored ?
0
votes
0answers
65 views

ESP01 in real life

I'm trying to use esp01 modules to read data from an 23c through i2c and send it through wifi. I have some serious problems with the esp01: The only pair that can be used for i2v are gpio0 and gpio2. ...
0
votes
1answer
43 views

How to implement Software PWM on an AVR on a timer ISR? Failing to grasp the maths for this

Say I have a timer running on an atmega328 8MHz like so: ...
2
votes
1answer
21 views

Variable length timer match outputs on AVR?

Is it possible to set the length of time until the next timer match output while you're in a timer match interrupt?
0
votes
0answers
39 views

Trouble using KS0108 graphical LCD

I run program that I was wrote in CodeVision for ATmega32 and I used a KS0108 graphical LCD. I was design the schematic in proteus. when I run the simulation I got this error: Non-existant pin [] ...

1
2 3 4 5
35