Questions tagged [atmega]

ATmega is a product line within Atmel's AVR micro-controller family.

The official website can be found here.

819 questions
-2
votes
1 answer

ATmega64a float to IEEE-754 unexpected result

I am trying to convert a float to an IEEE-754 Hex representation. The following code works on my Mac. #include #include union Data { int i; float f; }; int main() { float var = 502.7; union Data value; …
user1757006
  • 705
  • 2
  • 12
  • 23
-2
votes
1 answer

Pointer to pointer comparision breaks when while(1) removed - why?

Trying to build a menu system but running into some issues with pointers - which I don't have much experience with. I don't understand why removing the while(1) makes the comparison fail between mainmenu_table[1][i] == &option6 but for some reason…
Calum Nicoll
  • 109
  • 5
-2
votes
1 answer

How can i parse the SIM808 raw GPS data?

I have the makerfab sim808 and the documentation does not specify what is what that is returned in the gps raw data. The following is the data, has anyone worked with this and can let me know what is what. GPS raw data:…
Karim
  • 415
  • 6
  • 14
-2
votes
1 answer

How stack pointer works

I'm trying to make an multithreading kernel for atmega328p micro an for that i need to know how the stack pointer it works.
Radu
  • 73
  • 1
  • 3
  • 10
-2
votes
1 answer

Which Arduino Uno pin corresponds to TCNT0?

I am trying to count using the internal ATMega328 to create a Theremin based on this concept. I am using the internal timer1 and timer0 counters. However, I am unable to find documentation for which pin to use as an input to trigger the…
mintyLemon
  • 25
  • 7
-2
votes
2 answers

ATmega8 basic math operation understanding

Can somebody tell me how ATmega8 (or similar 8-bit proc.) implements math operation like subtraction, addition, division, multiplication on register logic? Where can I read about speed of this operation? (I know that division and floating point…
AlexB
  • 81
  • 1
  • 4
-2
votes
2 answers

Connection Atmega8 with MPU6050

I have question, because I have problem with connection Atmega8 with mpu6050 by means of I2C. This is my connection: Is this a good connetion?
Jakub W
  • 165
  • 2
  • 18
-2
votes
1 answer

Arduino Serial.read doesn't work

My Arduino Mega (with CH340 but all the drivers needed installed) has stopped reading from the serial port. Doesn´t matter what I write it keeps saving number 50. I have tried with simple examples codes as this one: int incomingByte = 0; // for…
-2
votes
1 answer

ATmega2560 External Interrrupts rotary encoder Bouncing

I am trying to get readings from 3 rotary encoders (KY-040) and send values via UART. I am using Arduino-Mega 2560 board but due to requirements reason I am programming it in C. But when I try to get the reading from encoder I get random…
sha09
  • 3
  • 3
-2
votes
1 answer

ATmega128 microprocessor, issue regarding error when measuring distance in timer ticks?

Ok, so a laser on earth hits a mirror on the moon and bounces back. On the ATmega128 microprocessor, we use TIMER1 to capture the clock ticks when the laser shot out and the clock ticks when it returned, subtract and get a "distance" in clock ticks.…
Tyler Dahle
  • 77
  • 1
  • 8
-2
votes
2 answers

Convert C code to Assembly Code in ATmega8

I want to make a code about accurate delay library in ATmega8 with winAVR as the compiler, do you have any idea to convert the code below to assembly? I have no idea to convert the code, because I don't understand assembly. this is the code. static…
user3625159
  • 1
  • 1
  • 1
-2
votes
1 answer

converting atmega 32 code to atmega 16 code

my code is for atmega32 microcontroller for converting coordinates to nmea format how can i convert this to atmega16 code. since it is using atmega32 library files will this code work on atmega16 or some changes are required.... #include…
user3472271
  • 11
  • 1
  • 3
-3
votes
1 answer

How does bitwise operator work the avr atmega register?

In the below code image bitwise left shift operator is used with the register for uart initialization,How does that left shift operator (1(left shift)RXEN),(1(left shift)) work when register bit(RXEN,TXEN) is not initialised enter image description…
PRASH
  • 17
  • 3
-3
votes
1 answer

ATmega2560 using UART interrupt to control global flag

I recently met a problem when I was playing with an ATmega2560, and I really don't understand what's wrong with it. Here is my code. main: #include "Definitions.h" int main(void) { Initialization(); while (1) { //_delay_ms(1); // or…
Bryant.C
  • 11
  • 2
-3
votes
1 answer

Loading Values from Data Space with Z Register?

I'm new to programming in AVR assembly, and I'm having difficulties understanding the following code. .include "m328Pdef.inc" main: ldi r22, 0x20 sts 0x0100, r22 ldi zh, 0x01 ldi zl, 0x00 ldi r20, 0x05 clr r22 ld r22, z …
mark
  • 62
  • 1
  • 8
1 2 3
54
55