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

learn more… | top users | synonyms

1
vote
1answer
44 views

Read value from analog input of an AVR microcontroller?

I have added a photoresistor to ATMEGA328P-PU. I'm trying to read the value from the analog input, but I don't understand how to assign the value from analog input to integer value (photoResistorValue ...
1
vote
1answer
122 views

What happens before the first instruction on a µC? [on hold]

I was reading a book by Elecia White (O'reilly) recently and came to a question: What happens before main()? Actually as soon as the programcounter is at the first instruction I guess I'm ...
1
vote
1answer
25 views

AVR ATmega: can I trigger external interrupt by setting corresponding INTF flag bit?

I'm writing a C program for ATmega64A which has a INT0 ISR. This ISR should be executed in case of INT0 falling edge OR if the TIMER3 goes overflow. To avoid doubling the code I'd like to trigger ...
-4
votes
0answers
29 views

How to interface 8051 with ili9341?

I want to interface ili9341 ttft lcd. But there is no example of the code written in C. All examples are based on Arduino coding. Is there anyone who achieved this ?
0
votes
0answers
26 views

controlling a 74hc595 shift register led dot matrix display

I've been trying to control a couple of led dot matrix boards for a couple of days but i seem to be stuck. What am i doing wrong? The boards have 6 8*8 led dot matrices driven by a ULN2803A each via ...
0
votes
1answer
19 views

atmega32u4 generate clock using timer4

I have a atmega32u4 with 8Mhz and try to generate a clock signal with 1,2 or 4 MHz using timer 4 and output it on PD6 (!OC4D) For timer 1 and on PB5 (OC1A) I used CTC mode: ...
0
votes
1answer
38 views

MQTT + ESP8266-01 and AVR [closed]

I'm working in the IoT field and just got started with the WiFi module ESP8266-01. I know how to use the AT comands and HTTP requests, but I want to use MQTT protocol. I have found this library: ...
3
votes
0answers
34 views

Problem Outputting 2.5 Khz Signal ATTiny85 with Digispark

I am relatively new working with the Digispark IDE and I am having some issues with something that should be really simple. I am trying to output a 2.5 kHz square wave signal, that will oscillate +/-...
2
votes
1answer
36 views

atmega32u4 use Timer as souce for a counter

I started to play around with an atmega32u4 and came across a question I wasn't able to solve right now (may be I just missed the right page in the 500 pages datasheet). I was able to create a ...
0
votes
0answers
17 views

Complete Bread board arduino [migrated]

I bought a atmega328 microcontroller and burn the bootloader. Now I want to upload code directly from pc to the microcontroller on bread board. I have max232 ic for the communication but I recently ...
6
votes
3answers
505 views

Can an AND gate be used to toggle an HDMI connection?

I am looking to turn on and off the throughput of an HDMI signal via a microcontroller. Would four ICs such as the SN74LS08N AND gate be enough? Or do HDMI signals need something more complex?
0
votes
0answers
15 views

Cannot enter programming mode on Arduino Uno [migrated]

I have an arduino uno that I've been programming with an avr dragon through Atmel Studio 7. I did two things in close proximity and I'm not entire sure which action is the culrpit. I tried using ...
3
votes
2answers
63 views

Does the internal 8Mhz oscillator in an ATTINY run even if no clocks are connected to it?

If I set up the fuses on an ATTINY so that the system clock uses the internal 128Khz oscillator (sometimes called the "Watchdog oscillator"), does the internal 8Mhz oscillator still run? It does not ...
2
votes
2answers
108 views

How do I create pulse of 200 ns and 10 V with a microcontroller?

I 'd like to command the gate of a MOSFET with a microcontroller. The command will be be very short: a pulse with 200 ns of duration (period = 1 ms) and about 10 V of amplitude. Can I do this with an ...
0
votes
2answers
45 views

Atmega128 ISP programming, unable to read device ID

I am trying to program a Atmega128. ISP programming First I used AVR dragon, I can read the target voltage, but when I go to read the device signature, warning comes Unable to enter programming ...
0
votes
0answers
25 views

Watchdog timer problem on Atmega 1281

I am using a modified Arduino board: Gizduino X with Atmega 1281 MCU chip on-board. The application is uploaded to MCU using Arduino IDE programmer. I attempted to use the Watchdog timer reset feature ...
0
votes
0answers
49 views

Timer causes UART problem

I have a problem, found on both ATMEGA1284P and ATMEGA2560. I have set a 16-bit timer in CTC (tried both Timer1 and Timer5) to give an interrupt every 1ms so I can increment a 32-bit volatile time ...
-1
votes
0answers
40 views

AVR Studio 7 with WinAVR help required

From last few years i am using WinAVR with VMLab Simulation software, everything was OK with them, as have successfully created different small, medium and large scale projects. I feel difficulty in ...
0
votes
0answers
33 views

Problem when programming Atmel ATmega16U4 using USB

I'm having a problem when I'm programming the ATmega16U4 through USB port. I designed the PCB, but I will assume the hardware connections are good. It is because when I connect the chip to the ...
0
votes
0answers
22 views

Atmel ICE SAM connector pinout does not reflect the real pinout

Maybe I am just too slow, but I can't understand exactly how do you connect an ATMEL-ICE (6 pin connector, not the 10 pin) to a chip. I am using a SAMD21G (http://www.atmel.com/Images/Atmel-42181-SAM-...
1
vote
0answers
119 views

PCINT0 interrupt on attiny

I'm started working with AVRs few days ago. Started with assembler and simulating in Proteus. My current goal is to enable Pin Change interrupt on PCINT0, which is PB0 on my attiny13. Right now I'm ...
1
vote
2answers
322 views

Wires from car battery to solenoid catching fire after connecting a second solenoid

I have two solenoids connected to my AVR and car battery: simulate this circuit – Schematic created using CircuitLab But when I start switching them the circuit burns up (literally there ...
4
votes
3answers
328 views

ATmega - Why is the prescaler factory defaulted to 8?

Why do ATmega (e.g. 328P or 644P) have CKDIV8 (or CLKPS = 0011) factory programmed along with a default internal 8 MHz ...
0
votes
3answers
273 views

Blinking LED on ATMEGA168. Error rc=-1. AVRDUDE

I apologise in advance. This is my first project. I keep getting this error ...
0
votes
2answers
135 views

Modifiying variable inside of Interrupt vector. AVR

My question is again about modifying variables inside the ISR. If the variable used only inside of ISR, I don't have to declare it as volatile, right? After some researching, I figured out that ...
1
vote
1answer
35 views

Memory architecture and instruction storage - Naimi: AVR Microcontroller

LDI R16, 0x25 --> E 2 0 5 --> 1110 0010 0000 0101 Apparently, in AVR, the code and data are stored separately and each area (code, data area) is accessed by a unique bus. Now since the Program ...
0
votes
3answers
42 views

Load/Store architecture

In RISC vs CISC, the load/store architecture: Load memory data into CPU register Compute Store result in memory In CISC, 1,2,3 is wrapped in a single instruction. In RISC 1,2,3 are separate ...
0
votes
2answers
40 views

Configuring events on Xmega

Is it necessary to enable the interrupt for a given event source in order for the event to fire, or is it only necessary to select the source from the event system? To clarify, I am asking about the ...
1
vote
1answer
21 views

Event triggered one shot on XmegaA4U

I am trying to implement a phase control circuit for driving a TRIAC/SCR. I plan to use an xmegaA4U series microcontroller. I already know that I can route the AC signal through a voltage divider and ...
3
votes
1answer
57 views

Sensor supplied by MCU - sink or source what is most energy efficient?

I'm building a tiny system for fridge door monitoring. AVR (Attiny13A) is used which is connected to a linear hall sensor OH49E, the complete system is battery powered and I'm trying to minimize power ...
-2
votes
4answers
179 views

Basic Transistor/MCU Question [closed]

Let's say I have 4 AVR MCU's All hooked up to VCC. And let's say they're all connected to ground through an NPN transistor or NMOSFet. Can I use that transistor to switch the MCUs on\off? I'm pretty ...
1
vote
2answers
172 views

How to make a circuit that generates 50mA current at +1.8v within 10ns rise time?

I am using Atmega328 MCU to control a SRAM IC and it is required to power up the IC using a source that can deliver 50mA current at +1.8v within 10ns rise time without any voltage drop. unfortunately ...
0
votes
1answer
38 views

AVR MCU running @ 32.7Khz Low speed LED multiplexing problem interrupt

Works fine with internal 8mhz, but when change to 32.7Khz, the multiplexing led display is not working properly (it's flashing very randomly). is this the limit of low clock speed or is there a ...
0
votes
1answer
46 views

LED display Atmega - Running out of output pins

Seems like I am running out of I/O pins. I only have 6x 8bits pins (need 8 with multiplexing), and I want to power 5x 8 by 8 and 2x 7-seg displays. I don't want to use another ic. so is there a way?
0
votes
1answer
49 views

Atmega32 PWM on all four PWM pins

I am trying to control LEDs brightness using PWM on the Atmega32. I have one LED connected to each of the 4 PWM pins (OC0, OC1A, OC1B, and OC2). Using the code below, all of the LEDs are functioning ...
0
votes
0answers
47 views

Using the interrupts of ATmega16

I am using CodeVisionAVR and I'm trying to write an ISR which should do a specific job for me. the problem is that first time that the ISR is called, it works properly but for next time it does not. ...
0
votes
0answers
73 views

AVR interrupt setup seems to stop program execution

On ATMEGA168PA I have problems with interrupt-driven character reception over UART. When I include the line setup_interrupt() it seems that program execution stops ...
0
votes
1answer
39 views

AYTINYx4 - execute other code during analog conversion

I am using an ATTINY44 in my current project. As I need to do some time sensitive switching I would like to avoid any unnecessary delay. To control another device (not time sensitive) I need to read ...
0
votes
1answer
53 views

1200 Baud Rate UART at a 9kHz clock speed [closed]

I just did the math and with the internal clock of the ATMega328. The lowest clock frequency that you could use to have a 1200 Baud rate is 9.6kHz. Unfortunately I need to be under 9kHz. Is there ...
0
votes
1answer
82 views

Atmega328p: why button input is read as 0 when pressed?

I'd like to turn on the board's LED (PB5) when I press its button (PB7). ...
1
vote
1answer
44 views

Can I use ATtiny SPI and still be able to do in-system programming?

I'm building a cost sensitive device that requires SPI and a single analogue comparator. Looking at the spec, ATtiny20 or ATtiny48 would fit the bill. The requirement is to be able to program it in ...
0
votes
1answer
37 views

Rise/Fall time of GP Pins

Are rise/fall times typically affected by the clock speed. That is if I have a AVR at 16 MHz will it have a different rise/fall time than the same AVR at 32kHz?
-1
votes
1answer
85 views

AVR ATmega32 UART Not Reciving

I'm trying simple UART transaction functions for ATmega32. I can send the bytes but not receiving anything. I am using polled UART receive. ...
1
vote
2answers
74 views

FCC Low Oscilation

I have heard that if a circuit is operating at less then 1.2 MHz it does not need FCC certification. Does an ATMega328 with with a 1Mhz External crystal, and the internal clock not used qualify for ...
0
votes
0answers
21 views

usbasp erasing fuses

I'm trying for the first time to program an attiny45 with a USBasp and avrdude. After about an hour of frustration, i found that when the programmer erases the flash, it also erases the fuses. So i ...
0
votes
1answer
26 views

AVRISP. How to choose SPI frequency?

Yes, yes, I know that it must be between 1 and 4 clock cycles of a target device. But... We don't know it if clock is provided by internal rc generator or external quartz. So is there any possible way ...
2
votes
3answers
118 views

Some characters are not transmitted correctly from mega32 to ESP8266

i recently bought an ESP-01 for a simple wi-fi project reading the temeprature from a website . First i wired the ESP-01 directly on the TTL converter (cp2102) to read the temperature and everything ...
0
votes
1answer
66 views

soft starter code for avr

I need to control 2 DC motors (Maxon RE40) using an AVR (atmega328) through pwm. I was wondering what is the right way to approach the situation. Should I increment the duty-cycle at a specific time ...
0
votes
2answers
64 views

atmega328p GPIO with 3.3V regulator reads 2.5V at pin when High

I am driving the enable on a boost regulator and the boost is not turning on. When I checked the voltage on the enable, it was 2.5V. The boost worked on an identical set of boards I tried before this (...
0
votes
0answers
59 views

JTAG is not working with Atmega32a using Atmel-Ice

I am using Atmel studio 7 and Atmel-Ice to program atmega32a on a board that I have made and using 16MHZ external crystal. When connecting the board to Atmel-Ice using ISP it works fine and I can ...