Questions tagged [avr]

AVR refers to two families of either 8- or 32-bit RISC microcontrollers

The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to One-Time Programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

External links:

2091 questions
0
votes
1 answer

ATMega328p: Strange behaviour sending bytes through USART

I have an ATMega328p (MCU) connected to my computer via a USB to seal converter (BUB) from ModernDevice.com. The MCU is connected to the BUB by TX, RX and GND lines. To send data using the U(S)ART, I use this library, written based on many solutions…
ENHering
  • 45
  • 5
0
votes
2 answers

what is the optimum solution to amplify small range volt to enable the microcntroller read it in wide range?

i need to make the Microcontroller read an analog value that has range min=0.1 to .25 volt max. I'm using AVR Microcontroller "ATmega32" , i know that the ADC in this uC has configure called "differential input" with "gain" option -that is what i…
Hussein
  • 41
  • 4
0
votes
2 answers

compare more than two strings

I have 5 strings. I need to compere all five at once. char set_password1[5] = "1111"; char set_password2[5] = "2222"; char set_password3[5] = "3333"; char set_password4[5] = "4444"; char set_password5[5] =…
0
votes
2 answers

C preprocessor macro replacing #if #else statements

I'm using this statement now to switch between small and slightly more extensive error messages in my C code: #ifdef COMPACTC error_code ((uint16_t) init_cascade, 5); #else error_message (__func__, "cascades malloc failed"); #endif (it's part…
Adrian
  • 3
  • 2
0
votes
1 answer

EEPROM read and write for 5 bits

I have this code that write and write from EEPROM for 4 digit number. For Ex: 2356 Code; void WritePassToEEPROM(uint16_t pass) { EEPROMWrite(0000,(pass%100)); EEPROMWrite(0001,(pass/100)); } uint16_t ReadPassFromEEPROM() { return…
0
votes
1 answer

ATMega random number generation

For some context, I’m working on what is basically “Simon” for an Arduino project. I’m using an ATMEGA2560 and editing the code with Atmel Studio 6.1. The project uses the random number generator to create the sequence for the button input, which is…
0
votes
1 answer

Attiny13 Clock frequency and ADC

I am working with an Attiny13 AVR, which is programmed by arduino UNO over SPI. I found a core for attiny13 and the content of the boards.txt file as follows; #attiny13.name=Attiny13 @ 128 KHz (internal watchdog…
user1449456
  • 404
  • 5
  • 14
0
votes
1 answer

Sending commands to AVR from node.js

I need to send commands Xmega from node server using serialport. For example I want my commands to be in following format: < M 500 where: < marks the beginning of command (string) M is command (string) 500 is integer value (can be between 0 to…
M.N
  • 21
  • 2
0
votes
1 answer

Assembly display a value from register on LEDs light box that is never set

Architecture: ATmega8535 Development Board: STK200 My code basically displays from register r0 values on my LEDs switch light box. On board push buttons are connected to port A, and switch light box LEDs are connected to port C. 1000 0000 1100…
Higeath
  • 5
  • 3
0
votes
1 answer

Information needed regarding ATA5831 transceiver with AVR microcontroller

I am trying to use the Atmel ATA5831 UHF transceiver that has an embedded AVR microcontroller core. The datasheet for the transceiver is here: http://www.atmel.com/Images/Atmel-9285s-Car-Access-ATA5831-ATA5832-ATA5833_Datasheet.pdf. I don't have…
0
votes
1 answer

Calculating delay from 3 nested loops

My exercise: •Calculate the maximum delay possible using three loops @ 1 MHz clock frequency. (Answer 49.94 s) delay: ldi r23,$FF ;Initialise 3rd loop counter loop3: ldi r24,$FF ;Initialise 2nd loop counter loop2: ldi…
Higeath
  • 5
  • 3
0
votes
0 answers

how do I perform the STK500v2 protocol communication with my AVR via a android app?

I have modified the Peter Fleury boot loader of AVR to my ATmega2560 which uses a STK500v2 protocol. My ultimate aim is being able to flash my hex via a bluetooth device HC 05 connect to my AVR and android app to send hex via bluetooth. Can some one…
Srini Vardhan
  • 13
  • 1
  • 4
0
votes
0 answers

Find bit position efficiently on micro-controller

I have pins defined as 8-bits mask (so only one bit is set) on an AVR micro-controller. Sometimes I need the number of the pin instead. What is the most efficient way to get it? To make sure, it's clear, I want a function/macro that gives to…
Puck
  • 1,950
  • 3
  • 17
  • 26
0
votes
0 answers

receiving multiple bytes through uart avr with interrupt driven

i'm trying to receive multiple bytes from fingerprint scanner as a response from a specific operation it's a 24 bytes and i used another atmega32 microcontroller to send an array Identify[24] = …
0
votes
1 answer

Some implicit makefile?

I am trying to understand makefile. I took atmega168 bootloader's makefile and simplified it to this: CC = avr-gcc override CFLAGS = -g -Wall -Os -mmcu=atmega328p -DF_CPU=16000000L '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1'…
Qeeet
  • 293
  • 3
  • 12
1 2 3
99
100