Questions tagged [atmega32]

ATMega32 is an 8-bit AVR microcontroller with 32 kiB of flash.

A relatively high-end microcontroller, thus 8-bit RISC. Still in production as of 2021, but the newer ATMega32A is also available.

Tag [avr], and don't tag [atmega32] unless your question is about specific features or performance of this microcontroller. (You can still mention in the question body what hardware you're using, even if it's probably a general AVR question)


Specs

https://www.microchip.com/en-us/product/ATmega32 links a summary datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/2503S.pdf and various more detailed stuff.

  • 32 KB ISP flash memory with read-while-write capabilities
  • 1 KB EEPROM
  • 2 KB SRAM
  • 54/69 general purpose I/O lines
  • timers, USART, 8-channel 10-bit A/D converter
  • 0 to 16 MHz (or 0-8 for the ATmega32L model)
  • Supports AVR's multiply instruction with 2-cycle performance

See also https://www.elprocus.com/types-of-avr-microcontroller-atmega32-and-atmega8/ and other search results.

81 questions
3
votes
2 answers

How can the average of the ADC Readings be calculated?

The aim is to store the newest 10 ADC readings in an array and then calculate the average of them to be used elsewhere. Removing the oldest each time it is updated. Regarding the LED timing, it must switch timing from 1s to 0.25s if ADC reading is…
scrub
  • 35
  • 5
2
votes
1 answer

How to get GPS Data when switch is pressed in Atmega328p

So I am working on getting the gps data when the button is pressed using external interrupt. My problem is , it is working without the external interrupt but when I added it, it's not getting the data. Is something wrong with my code? I am using…
2
votes
1 answer

Why am I getting this error in proteus: " Invalid opcode 0xFFFF at PC=0x002A"

I wrote this code for avr atmega328P in assembly language. It turns on and off an LED using a push button, but in proteus I am getting this error: Invalid opcode 0xFFFF at PC=0x002A This is my code: .INCLUDE "M328Pdef.inc" ldi…
2
votes
2 answers

How to consider letter by letter of a string and compare them with if functions?

I tried to get letter by letter from a string and use them as a parameter to a function that identifies that letter as "a" or "b" or "c"... and then give some value to a variable and return that value as a hex value. char A[] =…
2
votes
1 answer

I2C not reading

I'm trying to interface with a BNO055 breakout board from a Teensy 2.0, but I'm having trouble reading from the BNO055. It has different registers that you can access to read data from the chip. To start, I'm just trying to read the IDs of some…
CaseyB
  • 24,780
  • 14
  • 77
  • 112
2
votes
1 answer

I can't clear external interrupts in Arduino Uno

I'm working on a project using an arduino uno board, I'm using an External interrupt tied to a switch I wanted this switch to work only if i sent an activation order to the board The Problem is that, if the switch is pressed before i send the…
SaTech
  • 430
  • 6
  • 17
2
votes
2 answers

crtatmega328p.o:(.init9+0x0): undefined reference to "main"

I have been trying to compile a robot simulation. I created an empty file called test.c and tried to compile a test using: avr-gcc -mmcu=atmega328p test.c AVR-GCC it's installed copt@copt:~$ avr-gcc --version avr-gcc (GCC) 5.4.0 Copyright (C) 2015…
1
vote
2 answers

Set PWM frequency on Arduino Mega using Timer2 in "phase & frequency correct" (mode 5)

Using my Arduino Mega 2560 I am trying to generate a PWM signal where I can change both PWM frequency and Duty Cycle. For that I decided to use Timer2 OC2A output. The code is the following one: void setup() { //…
rodolaf
  • 29
  • 5
1
vote
1 answer

I'm trying to debounce a button in c++ for an atmega 328p microcontroller but nothing seems to be working

I'm still at a beginner level in C++. I need to debounce a button (PCINT10) using an interrupt and a timer. I'm using an atmega328p microcontroller and a HW-262 shield. Currently using timer0 to increment time by 1ms. This is part of my code so…
Elle
  • 11
  • 2
1
vote
0 answers

ISR INT0 causes Reset on AVR Atmega32

I'm facing a problem programming an ATmega32A-PU regarding the use of Interrupt INT0. Everytime it's triggered (by rising edge on PD2) , it causes the MCU to (seemingly) reset, meaning it starts int main(void) from the beginning. It's not the first…
M.Grae
  • 21
  • 5
1
vote
1 answer

variable value keeps being "0" even after assigning it a value

I'm trying to make a function to make a delay in ATmega32 using Timer0 but I can't get the delay right and when I used debugging I found that the variable T_tick is not changing value from 0 but other operations depend on its value so nothing is…
Ahmed Hal
  • 11
  • 3
1
vote
0 answers

QMK Toolbox: No HID console devices connected when trying to upload firmware to keyboard

The image would normally show "list all devices", so I’m assuming it says, "No HID console devices connected" because for some reason it is not recognizing my ATmega32U4 chip. I have tried: Using three wires. I have already confirmed two of the…
Meylita
  • 11
  • 2
1
vote
1 answer

Compilation error when creating ISR(vect) interruption : multiple definition of `TIMER0_COMPA_vect'

Good morning everyone i'm posting this here because i can't figure it out on my own. I've been trying to add ISR function in my project but it doesn't compile. I work on Microship studio on an ATmega328p on a raw c++ project (NO ARDUINO). I've been…
XavierDes
  • 11
  • 2
1
vote
1 answer

What does this #asm #endasm mean?

I'm looking for code to make an automatic light sensor. then I found the code like below. so what does the code mean? #asm in r30,mcucr cbr r30,__sm_mask sbr r30,__se_bit | __sm_adc_noise_red out mcucr,r30 sleep cbr r30, __se_bit out…
Frank
  • 13
  • 2
1
vote
1 answer

Keyboard print UID MFRC522 Arduino Leonardo

I want to print the UID of a card as an HID with the Arduino Leonardo. Here is the code that I have void loop() { if ( mfrc522.PICC_IsNewCardPresent()) { // Select one of the cards if ( mfrc522.PICC_ReadCardSerial()) { // Dump debug…
Spoozy
  • 33
  • 6
1
2 3 4 5 6