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.

0
votes
0answers
20 views

AVRDUDE does not recognize USBasp device

I'm am having issues with my USBasp programmer (Windows 10). I installed the WinUSB driver using zadig 2.4. When I run AVR dude with the following parameters ...
0
votes
1answer
48 views

32khz crystal for AVR. Caps needed?

I remember reading long ago that I don't need filter caps for a watch (32768 Hz) crystal. Is this true? Or will I need to put some capacitors to ground on either end of the crystal? I will be using ...
0
votes
0answers
35 views

AVR ATmega328 low fuse wrtiten and issue

I am using an Arduino Uno as the hardware programmer together with avrdude as the software programmer for flashing an Atmega328. I have noticed PB0 was set to ...
-6
votes
1answer
76 views

Recovering a program from a locked AVR [closed]

How can a program from an AVR be recovered when its lock fuse bits are set?
2
votes
1answer
87 views

RS-232 interface chip problem - why is the voltage level so wrong?

1. What I want to do: I have a PCB with an AVR microcontroller (ATmega16U4) on it. I want the microcontroller to communicate with my computer through an RS-232 cable. 2. What I did: I added an ...
4
votes
1answer
358 views

AREF above operating voltage of the microcontroller

I’m operating an ATMega32 at 3v3 through USB and a LDO. Is it possible to connect the AREF pin directly to the USB voltage of 5V so that I can read voltages between 0 and 5V when reading from the ...
0
votes
2answers
64 views

Atmega328 doesn't respond after power loss while uploading program

While uploading program to atmega328 I accidentally disconnected it from power. After that I get "target doesn't answer" message while trying to upload. I am using USBasp programmer, connections are ...
2
votes
1answer
54 views

Multi-tasking on an 8bit AVR -

I'm using an ATTINY816 (the new series AVRs) to manage a system that includes the following tasks: Simple audio "effect processing" (delay, pitch up, pitch down...) using internal ADC + DAC Storage ...
0
votes
0answers
40 views

Attiny 841 dev board schematic review

I am about to send a custom Attiny841 dev board (aimed at Optiboot) to production and I thought, since I never used netiher this microcontroller nor the USB-UART converter before, I'd come here and ...
0
votes
0answers
23 views

Translate from AVR pgm_read_byte to normal C array manipulation in STM8

I am trying to translate a couple of lines of code from AVR space data to STM8 normal C data manipulation. As you should know, AVR has a program space which can storage data for read only operation, ...
0
votes
2answers
54 views

Use ADC as Analog Comparator (AttinyAVR)?

I have recently been trying to transition from Atmel's Atmega 328p avr to the newer (and much smaller) attiny416. The trouble is, the 416 only allows you to choose between two positive inputs and two ...
6
votes
2answers
649 views

LED- Resistor, does the position matter? [duplicate]

I was reading the MAKE AVR programming. One of the chapters suggests to solder resistor to the cathode side of an LED. But in our uni labs it's said to connect the resistor "before" the LED; that is ...
0
votes
0answers
51 views

Receiving data from SIM808

I am trying to use SIM808 module but I have no response even after sending only "AT". I am using 5V/2.5A AC/DC adapter. The board (ecb-v3.2) is rather connected well because two diodes are on all the ...
1
vote
1answer
93 views

MAX7221 not always powering on

I have a MAX7221 SPI 7-seg. LED driver linked to an AVR168P microcontroller. Sometimes when powering on, everything works as expected. Other times the display blanks and remains blank. Other times ...
1
vote
1answer
45 views

AVR SPI slave first byte problem

I have written a simple SPI slave on an ATMEGA328PB. It mostly works, however, I can't seem to get the first byte to be what I want. The difference between the first, second, and all other attempts ...
31
votes
5answers
11k views

How do devices like the Game Boy Advance achieve their frame rate?

I've been designing my own handheld gaming device based around an AVR microcontroller and a small OLED display. I started off with a monochrome display 128x64 pixels and can comfortably draw to it at ...
-1
votes
0answers
23 views

How to use sleep modes of AVR in CodeVisionAVR?

I want to drive a keypad with Atmega16 and I'm using an ISR for handling the keys which user presses. So, my main() only includes a few lines for setting up the interrupts and ports. If I want to use ...
0
votes
3answers
76 views

Burning hex files into multiple micro-controllers at a time. [closed]

I am using attiny88 and the usbasp programmer. Right now I am burning 1 micro at a time. But it is a time-consuming process during the production. Is there any way to burn multiple microcontrollers ...
2
votes
2answers
179 views

Can't trigger AVR ADC Interrupt

I am using an Atmel's XPlained mini board with Atmega328PB. I am trying to use ADC interrupt, however I can't get it to fire. Here's the code that I have a problem with: ...
0
votes
1answer
49 views

Arduino and DAC

I have programmed an Arduino to control a DAC, generated signal control the current of an LED via a LT1206. Whenever I plug in the power, before Arduino starts, the LED starts to blink because it ...
0
votes
1answer
67 views

Power issue on connecting controller to FTDI programmer

Hi, I have connected my controller (ATMEGA2560) input to 5V power supply. At the VCC terminal 5V is shown. The VCC, TX,RX, RESET and GND pins are connected to a FTDI programmer port as shown in figure....
0
votes
0answers
26 views

CC2530: adapting AVR/pgmspace.h for Zigbee

Goal: Adapt ENC28J60 codes written for ATMega328p (http://tuxgraphics.org/electronics/201204/embedded-ethernet-client.shtml) for CC2530. Problem: No equivalent library for AVR/pgmspace.h available ...
1
vote
1answer
56 views

SAMD21 DAC example

beginner here in need for starting directions. I have SAMD21 Xplained Pro Board. I would like to produce DC DAC output, based on 8 bits on the input. Range of my DC output values should be around ...
0
votes
0answers
42 views

AVR PWM on any pin: Not working with OCR0B

I learning AVR programming through a book. In which there's a program to implement PWM on any pin This is the program ...
0
votes
1answer
38 views

.dw directive in AVR assembler

the piece of code below is mentioned in 8-bit AVR's instruction set as an example to explain the LPM instruction. ...
-1
votes
0answers
58 views

AVR timer: CTC mode

I am having some trouble understanding Timers in AVR, especially CTC mode In CTC mode when a match occurs I can toggle OC1A or OC1B pins. As per the data sheet In clear timer on compare or CTC ...
0
votes
1answer
115 views

AVR Can Write I2C, but Fails to Read (Fails to Write Register Address)

I'm using an ATMega328 DIP Package with a TLE493D(A0) (and manual) 3-axis hall effect sensor. I've done successful reads/writes to other I2C devices (AT42QT2120), but I'm having issues with the TLE493....
0
votes
2answers
127 views

Long distance (and I think low frequency) serial communication with Arduino [closed]

I need to implement a long distance (up to 15 kilometers) communication between some electronic devices. The devices is some boards on AVR chips with Arduino library and a Raspberry pi as the ...
-1
votes
2answers
108 views

Can somebody explain to me thoroughly about DDRx, PORTx, PINx in AVR?

Okay this might be a really dumb question, but I don't really get these 3, my main confusion is, why we need three of them? Why can't we r/w on port like normal register? (please don't downvote). And ...
-1
votes
0answers
30 views

Block reading of SDHC returns 0x00

I have a 4 GB sd card attached via SPI to my XMega MCU and I want to read this card with the USART-SPI interface in SPI mode of the MCU. So i have this code SD.c ...
1
vote
0answers
65 views

Can't manipulate array with atmega8

I am quite new to AVR programming and I am currently having some troubles with arrays. I am trying to write an Arduino code that will be run on a Atmega32u4. The goal is to communicate with a AX12-A ...
0
votes
1answer
57 views

Confusion on Servo and PWM (AVR) [duplicate]

For reference im using an AVR Atmega 328p, and the servo specs i'll be using says this: Pulse Cycle: 20 ms (I assume this means the "period") Pulse Width: 600-2400 µs So from my understanding, ...
1
vote
2answers
213 views

How can I isolate voltage dividers so they aren't interfered with by other parts of the circuit?

I have a small and very basic circuit that PWMs an RGB LED. It has a potentiometer to allow me to set brightness level for night time and a LDR that allows me to detect night time. I took some ...
1
vote
1answer
42 views

EEPROM Interface confusion with Address?

So im researching how to interface with a EEPROM Chip via I2C with an AVR (Still learning a lot of the interfacing). Anyways, the AT24C16 for instance (or that family of EEPROM) seem pretty popular. ...
0
votes
1answer
208 views

On AVR-GCC, how can I find out what statically initialized variable is using up my RAM?

The variable does not show up on the MAP file so it is hard to track it down. I'd rather not have to manually search though all the source code looking for static initializers.
1
vote
1answer
221 views

AVR: Pullup vs Pulldown on button input?

So I know the Atmega328p (What im using now) has Pull-up resistors available to be activated. And I know when reading input we could either make a button cause a PIN to go high or low....but is there ...
0
votes
1answer
121 views

Protect Code inside Microcontroller [closed]

As a preface, what I am asking is highly related to this question. That said, the question linked was asked in 2011 (7 years ago), and I imagine the microcontroller world has changed (at least to ...
1
vote
1answer
85 views

Minimal external components for AVR CPU

If I want to program a new AT90USB1286 series chip via the standard 6 pin ISP header, do I need any additional components wired up at all? I'm wondering specifically about the need for a quartz ...
0
votes
1answer
51 views

AVR Pin change interrupt: Capacitive Touch Sensor

I'm reading the book: AVR Programming: Learning to Write Software for Hardware by Elliot Williams. In the Interrupt section of the book, there's a small project to make a Capacitive touch sensor. ...
0
votes
1answer
62 views

Newbie question: C programing for AVR

The following lines which works exactly opposite to what i'm expecting, would appreciate correcting my understaing: Button connected with Pin D2 & Led B2: ...
0
votes
1answer
52 views

FPGA CAN Bus Test Bed

I don't have familiarity with FPGAs and I haven't used VHDL for 21 years, so starting from scratch. I am wondering if the following is possible/sensible. FPGA running n "small" independent ...
1
vote
1answer
54 views

SPI: Receiving bytes from slave

For a couple of days I have been learning about SPI and decided to give it a go with 2 small devices. DEVICE 1: Atmega328p (MASTER) DEVICE 2: MFRC522 (SLAVE) As far as I understand: master sets SS ...
0
votes
0answers
14 views

Can't set fusebit on Arduino mega2560

The board came default with lfuse:0xFF hfuse:0xD0 efuse:0xFF I've been trying several of the programmers that come with Avrdude, but the only one showing some results is -c wiring, the others timeout....
0
votes
1answer
48 views

Where MOSI is triggered low or high

Sending and Receiving Data //Function to send and receive data for both master and slave ...
0
votes
0answers
41 views

Increase NPN transistor rise and fall time

I'm trying to emulate an automotive sensor with AVR and transistors. I have three resistors connected in series. Using AVR digital outputs (5V) to drive the transistors base, I "short circuit" to ...
0
votes
0answers
22 views

Deploying program from Atmel Studio or Avr dude to Atmel “XMEGA-A3BU Xplained”

Im attempting for the last 3-4 days to connect the Atmel dev board to the computer in order to either load the .elf or hex file to the bootloader in order to turn on the LED based for an assignment. ...
2
votes
0answers
23 views

Deployoing compiled program from Atmel Studio or Avr dude to Atmel “XMEGA-A3BU Xplained”

Im attempting for the last 3-4 days to connect the Atmel dev board to the computer in order to either load the .elf or hex file to the bootloader in order to turn on a LED. Im following instructions ...
5
votes
2answers
369 views

Communicating between 2 different microcontrollers

My Arduino runs at 16MHz clock speed; another microcontroller runs at clock speed of 13MHz. If I send digital output directly from an output pin of the former to input pin of the latter, there will be ...
0
votes
1answer
49 views

Have I bricked my ATMEGA3328p by setting

I was playing around with setting the "system clock prescalar" (CLKPR). I'm now in a situation where I can see that the clock is 244.9KHz, using my logic analyser and the "Clock output on PORTB0" ...
4
votes
3answers
564 views

Is the ATMEGA328P's serial baud rate quantised?

I'm using an ATMEGA328p, running from its internal oscillator (divided by 8 = 1MHz). I've (roughly) measured the oscillator output, using my Salae logic analyser, as ranging from 960KHz to 1000KHz, ...