Questions tagged [atmega16]

ATmega16 is one of Atmel's 8-bit AVR microcontrollers in the ATmega product range featuring 16KB programmable flash memory. Unless your question is specifically targeted towards ATmega16, consider using the more general [atmega] tag.

ATmega16 is one of 's 8-bit microcontrollers in the product range featuring 16KB programmable flash memory. Unless your question is specifically targeted towards ATmega16, consider using the more general tag.

96 questions
0
votes
0 answers

WDR seems to disable watchdog timer

I'm testing some assembly code with atmega16 in Proteus 8 with AVRASM compiler and it seems that the WDR instruction isn't work correctly. From the datasheet, WDR must just reset the watchdog counter. So if I set the watchdog timer to reset the MCU…
Wolf
  • 1
  • 1
0
votes
0 answers

USART connection between ATMega16 and SM5100B-D gsm/gprs module

I have been struggling with usart interface between these two devices. After the code has been ran, i can see TX and RX flashing, but no message actually passes through, which is my ultimate goal. Any idea how to troubleshoot this problem. The code…
Mile
  • 1
  • 1
0
votes
2 answers

Interfacing 16*2 keypad and LCD with atmega32

I have a disappointing problem with a keypad module that when pressing on any of its keys, it normally shows up the key pressed on an LCD module. The problem is whenever I press the key, the rows stop being scanned and I have no ability to press any…
0
votes
1 answer

How to connect multiple devices on avr(atmega16/32) using UART?

atmega 32 has only one (TX/RX) .In case of connecting many devices working with UART what should I do?....Arduino has something called software serial Is it available in atmega 32 or how to establish it?
Hussien Mostafa
  • 159
  • 2
  • 18
0
votes
1 answer

Can UDR be written inside USART_RXC interrupt handler without checking the UDRE flag in AVR ATMega32?

I have been trying to understand this code which is supposed to echo each byte received on the AVR's USART interface using interrupt. #include #include #define USART_BAUDRATE 9600 #define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) -…
0
votes
1 answer

Show timer on LCD ,AVR

How to write a timer in c for avr that shows below pic in each row on LCD ? (https://i.stack.imgur.com/SK1mE.jpg)
Kimo
  • 1
0
votes
1 answer

Atmega multithreading can't manipulate stack pointer

im trying to do a multithreading library for atmega controller and firstly i try to manipulate the stack pointer and after the return of function "go_to_func" the program goes in function "func". The function "go_to_func" is written in asm1.s file…
Radu
  • 73
  • 1
  • 3
  • 10
0
votes
2 answers

Generating output with 20% duty cycle using only one counter

If i have micro with no PWM module , how to generate output of duty cycle (20%) on pin 1 , and output with duty cycle(80) on pin2 using one counter and interrupt not polling.
W.Wafi
  • 11
  • 2
0
votes
1 answer

Why setting uart to double speed mode when gives the right output and normal mode with same baud rate doesn't in atmega32?

To get right output I had to set U2X bit to one and when I set it to zero and change value of UBRR Register the output makes no sense. I checked that I'm using right values from datasheet table but it doesn't give right output at U2X=0. my .h…
Hussien Mostafa
  • 159
  • 2
  • 18
0
votes
0 answers

To count number of pulses in avr between some elapsed time and display it

I want to count the number of pulses that occurred between a delay of 'n' seconds in atmega32 using 16bit timer and store and display it. ` TCNT1 = 0x0000; TCCR1A = 0X00; TCCR1B = 0X01; _delay_ms(150); TCCR1B = 0X00; int K = TCNT1; Is the above…
0
votes
1 answer

Power Consumption in Arduino in 2 Clock Cycles

I would like to know how much current is consumed by multiplication operation in Arduino (ATMega328P) microcontroller. As per ATMega328p datasheet, multiplication operation takes 2 cycles. I have to now convert it to current. Please let me know how…
Jyoti Raj Sharma
  • 91
  • 1
  • 3
  • 10
0
votes
0 answers

Atmel Studio facing some problems due to code optimization

I am using atmel studio 7. I have a key detection logic that works when optimization is turned off(-O0) but does not work when its turned on. I am detecting the key using an ISR there are four keys connected to PORTB 0..3 in a matrix fashion like…
0
votes
1 answer

ATMEGA 328P varying frequency

I am trying to generate a 16kHz pwm... this is the code i am working with right now. ` int main(void){ DDRD |= (1 << DDD6); // PD6 is now an output OCR0A = 128; // set PWM for 50% duty cycle TCCR0A |= (1 << COM0A1); // set none-inverting…
0
votes
1 answer

Writing some numbers on ATmega16 EEPROM memory in assembly

I'm trying to write numbers 0-9 to the EEPROM memory using assembly language in AtmelStudio 7. I made a loop until the counter reaches 8 (which is stored in R17 and a counter which is stored in R16). EEPROM in ATmega16 is 512 bytes so I will need…
hexpheus
  • 741
  • 10
  • 22
0
votes
0 answers

(GSM module SM5100B + ATMEGA16A interface) Trouble sending SMS using AT commands in C code

I am having trouble with my university project for embedded systems. The goal is to establish an interface between a SM5100B GSM module and ATMEGA16A microcontroller, using UART (which I did, using the correct ports from the datasheets), and to be…
bad_wolf
  • 1
  • 3