Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
2answers
118 views

Timer0 overflow interrupt does not work on ATtiny10

I am trying to use the Timer0 overflow interrupt to make a little project. I used such a timer in the ATtiny45 and it worked, but with ATtiny10 no result. So I tried an easy LED blinking program and ...
1
vote
2answers
145 views

AVR bitwise operation: making a NOT with a microcontroller

I'm programming an ATtiny10, i have two spare pins, one of which is the external interrupt pin on PB2, and i want to write the inverse of that signal to PB1. I want to spare a component, since i have ...
0
votes
3answers
94 views

GPIO state of MCU (AVR) with no supply voltage

In general: what state do the GPIOs of a MCU (an AVR in my case) have when there is no supply voltage and the MCU is "off". Am I right that the pins are floating as there isn't any "reference" for the ...
0
votes
2answers
37 views

Atmega88p with shift register 74hc595

I need to use a shift register to control multiple leds, but I need to control each one individually. The idea would be to send a buffer with the data, however I need to have several active leds and ...
-1
votes
2answers
90 views

when dividing two integer result truncated to 0 [closed]

when i divide two integer and if the result is below like 0.987, then it become zero ...
0
votes
0answers
23 views

can't figure out why my micronucleus/V-USB setup doesn't work

I built a small attiny85-based board using vusb and essentially the schematic of the discontinued Sparkfun "AVR Stick" (at least on the usb/uC side; see https://www.sparkfun.com/datasheets/Widgets/AVR-...
0
votes
2answers
52 views

How to load immediate negative value in a register?

For example on 8-bit AVR given a register r16 I do something like ldi r16, 44 and this way I can give it positive values from 0 ...
1
vote
1answer
40 views

How to show a long sentence on character LCD by using bascom?

I want to show a long message that going to differ every time and it's 3 lines or less. This message comes from Sim900. I cant show the whole sentence on my 4x20 lcd. how can I print it in several ...
2
votes
1answer
70 views

Atmel Chip not recognized as USB device. How to troubleshoot

I've soldered the AT90USB1286 Chip on a PCB like on this circuit: Imgur If I measure the pins, caps, resistors etc. with a multimeter, everything seems to be powered and fine. Reset button pulls to ...
2
votes
1answer
191 views

Atmega naming scheme (324p vs 328p)

I am looking into AVR chips (big fan) for a personal project. I need capabilities similar to Arduino Uno, so I recently compared Atmega 328p and Atmega 324p. To my surprise the 324p has significantly ...
0
votes
1answer
41 views

AT90USB162 not detected in windows

I have an AT90USB162, have it set up like this: I'm trying to program the chip using Atmel FLIP, but I can't because it's not detected. What could be the problem and how can I fix it?
2
votes
1answer
61 views

Atmega32u - Ground in bus powered configuration

The Datasheet provies an example configuration for when the device is powered from the bus, and shows the bus Vss connected to ...
0
votes
1answer
71 views

AVR programming

This question might be asked somewhere, if so all references would be appreciated. Hello, I have programmed Atmel chip Atmega32U4 through USB. It is possible because it supports USB programming. I ...
1
vote
1answer
84 views

while ( !(UCSRA & (1<<RXC)) ) vs while (RXC == 0)

I have question about code below : ...
0
votes
1answer
85 views

AVR Programming : Chip Enable Program Error

I am working on avr controllers for a while, but I have problem with "progisp" avr programming software. When I buy a new micro-controller like atmega32 it can be programmed properly for a while but ...
0
votes
1answer
40 views

avrdude: error: program enable: target doesn't answer. 1

Before I can program my ATmega32 through USBasp but now only in 30 times or more try I can program ATmega32. I get this error ...
1
vote
1answer
35 views

ATTiny414 inline assembly operand constraints for IO pin parameter

I'm trying to use the light_ws2812 library to drive WS2812 LEDs from an ATTiny414. The core of that library is an inline assembly snippet that bitbangs the serial line. here it is with the timing-nops ...
0
votes
0answers
32 views

Can I program an ATtiny85 using AVR SPI headers with I2C peripherals attached

I am preparing a schematic that includes an ATtiny85 MCU and a few I2C peripherals. It also has a MOSFET attached to pin 6 that drives a motor. I plan to use an AVR header to program my device. I'm ...
0
votes
0answers
34 views

passing argument 3 of 'spi_tx_multibyte' discards 'volatile' qualifier from pointer target type [enabled by default]

I've written a simple SPI controller code for sending and receiving a single byte. Now I`m trying to write a controller which can transmit/receive multiple bytes in one transaction. I am planning to ...
8
votes
2answers
454 views

ATtiny13A - Can't generate software PWM with CTC mode

I'm trying to make a remote control RGB LED light using an ATtiny13A. I know the ATtiny85 is better suited for this purpose, and I know I might not eventually be able to fit the whole code, but for ...
1
vote
2answers
40 views

atmel studio for mac

Is Atmel Studio compatible with Mac or Linux? It seems like there is only Windows support from the downlaods here: http://www.microchip.com/mplab/avr-support/atmel-studio-7.
1
vote
2answers
125 views

Press and hold the reset button to reset AVR!

I connected a tactile switch to the AVR reset button according to the circuit below. every time I press the button the AVR resets itself but my question is: Is there a way to make this button acts ...
-6
votes
3answers
150 views

How did my ATmega328p chips suddenly start dying? [closed]

I recently started working on a little self balancing robot using ATmega328P. I made a simple PCB with an ATmega, a L293D, terminals for 2 motors and a MPU 6050 and so on. I have a huge 25V 2200uF ...
0
votes
1answer
48 views

LPF and AMP for ADC with op amp not giving sufficient gain

I have a project where I need to have audio input into atmega168PA. I've decided to implement it by using an electret microphone which will feed into op amplifier for low-pass filtering and ...
1
vote
1answer
52 views

Attiny10 with RSTDISBL and USBAsp

I have some project what requires all GPIO pins of attiny10 so I have to program RSTDISBL fuse. But only programmer I have is low voltage USBasp (with latest firmware supporting TPI interface). The ...
0
votes
1answer
121 views

I can't flash my new ATMega328p with PL2303 USB-TTL converter

I've soldered my ATMega328p-au to a SMD to DIP board, and I've connected pins like this: USB | ATMega RX ---> TX TX ---> RX 5v ----> 5v GND -> GND and GND --> button --> RESET My USB-TTL converter ...
1
vote
1answer
43 views

AVR-GCC initialization code

Consider the following asm.S .global main main: rjmp main Compile and dump it with these commands: ...
0
votes
1answer
46 views

Output Compare Interrupt does not work avr atmega

Hey I'm trying to do blinking led using interrupts on 16 bit timer. My atmega model is Atmega168A. Chip clock rate is 12Mhz. Here is my code: ...
0
votes
1answer
40 views

How to program ATmega8U2

I was given an ATmega8U2 chip by my friend and I have been doing a bit of research about it. It says it does not come with a pre-programmed with a boot loader, so I was just interested about how to ...
0
votes
1answer
54 views

LED blinking while loop not working AVR timer 0

It is strange and rare. I am trying to blink a LED at PD0 at 2hz, but it doesn't work. Seems to me that while loop doesn't work at all. I have triple checked the code. what is the problem here? ...
0
votes
2answers
110 views

Getting Accelerometer values from MPU 6050

I m trying to read accelerometer values from mpu 6050 in atmega328p (Arduino UNO). I want an embedded c program that's why don't wanna use any external lib. So I read about I2C protocol, read the ...
0
votes
3answers
91 views

Timer interrupt (ISR)

I am using a timer interrupt for multiplexing however my question relates more closely to interrupt service routines. If I set the prescaler and turn on a timer, using the below code I can run code ...
0
votes
0answers
20 views

Unexpected AVR prescaling weird problem

I have problem setting the correct prescaler for a clock using an external 32k crystal. Not really a problem, but rather an unknown. The correct prescaler for it should be 1/128 ...
0
votes
2answers
88 views

Low-power solar cell source using capacitors

I am designing a circuit using AtTiny10 to supply a downstream microcontroller with power using only capacitors and a small solar cell. Would the following design work ? The basic idea is that the ...
0
votes
1answer
35 views

ATMega32, PetitFS, writing measurements to file

I'm trying to write measurements from external sensor to the file (lets say 1 per second). I'm using ATMega32 and PetitFS. At this moment I'm able to write one measure: ...
0
votes
1answer
45 views

Will other devices interfere with programming a ATmega32U4 if attached to SPI bus?

I’m designing a custom PCB around an ATMega32U4. The 32u4 will talk to another onboard component via the SPI bus. Since the SPI pins (MISO, MOSI, SCK) are also used for ISP programming could other ...
0
votes
0answers
84 views

Accomplishing division and remainder with AVR Assembly

Given an unsigned 8-bit value in r19 I want to figure out what the remainder is after division with some immediate value x. The ...
1
vote
4answers
103 views

Dual SPI master with ATmega32u4

An unexpected need emerged in my design, which is to control 2 slave SPI devices simultaneously. At first, of course, I was planning to to use the SPI Bus as usual and control both devices using the /...
1
vote
1answer
67 views

Multiplexing Red and green dual led not being switched on properly

I am having problem getting this red and green led to switch on in its yellow color state. Red + green = yellow!! But it simply refused to do so. It's more like an annoyance than a real big deal ...
0
votes
0answers
27 views

atmega32u4 powered board design

I've been trying to design a atmega32u4 powered board but I've been struggling with some design problems, some of them result of stupid mistakes and some that I have no idea the cause. So I'm in the ...
2
votes
1answer
87 views

“light_ws2812” library 10x slower than required (AVR C, ATMega328p int. 8Mhz)

So I'm trying to run some SK6812 (WS2812 clones) on a standalone ATMega328p. The output signal is too slow! I define F_CPU as 8000000 (8Mhz), both in the code and in the Atmel Studio Symbols, but my ...
0
votes
0answers
29 views

Arduino I2C bus fails when one slave is powered down [duplicate]

I have a set of Arduino Nano units where one is I2C master broadcasting messages to a number of slaves. It works perfectly fine when they are all powered on. The Arduino units are all interconnected ...
0
votes
0answers
46 views

ATMega2560 Bootloader help

I've got a board with an ATMega2560 that also has an SST25VF016B SPI flash memory. I'm trying to do an OTA bootloader. So what's happening is this: I'm hosting a new firmware binary in my server The ...
0
votes
0answers
61 views

LSL and add command

The way I am understanding is that LSL r17 shifts the bits to 1 place to the left and therefore multiples them by 2. This should mean that if I have a signed(0-255) ...
1
vote
3answers
112 views

AVR assembly language on Division

how do i performs a division by 4 of the 16-bit unsigned value in registers r4:r5 Where r4 is the most significant bit. I understand that by division of 4 which means i have to shift the bit by 2. ...
0
votes
2answers
77 views

atmega8a-pu PORTC not working in 3v3

I have atmega8a-pu and not problem with 5v. but when i connect 3v3 to ...
0
votes
0answers
11 views

Fuse setting of atmega16A with crystal oscillator 12mhz

I am using atmega16A with oscillator 12mhz can I see the fuse bit setting using progisp by system configuration option And copy that setting and paste on new atmega16A with same oscillator 12mhz ...
2
votes
1answer
96 views

Unsigned 32-bit multiply in AVR assembly

How do I perform a multiplication by 2 of the unsigned 32-bit quantity in registers r18:r19:r20:r21 where r18 is the most ...
1
vote
1answer
95 views

24-bit two's complement division in AVR assembly

How do I perform a division by 2 of the 24-bit two's complement value in registers r6:r5:r4. (r6 is the most significant byte.) From what I have this is what I tried: ...