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
0
votes
1 answer

avr interrupt library with atmega32 problem

I have a problem with atmega32 as when i am using this code: #include "../HAL/led/Led.h" #define F_CPU 16000000UL #include "../MCAL/Interrupt/ExtIntREG.h" #include int flag = 0; int main(void) { SET_BIT(MCUCR, ISC00); …
0
votes
1 answer

converting 16-bit number into digits for led display

I'm designing a calculator on atmega328p using assembly language, after performing the calculation I need to separate the result into digits to display them on LED matrix. Till now I wrote a code that does that with an 8-bit number (one register)…
Majd A.G
  • 3
  • 1
0
votes
0 answers

How can I verivy RAM problem in atmega 328p

I have been banging my head for several hours because I have a rare problem. I suspect I have a memory issue I have a pcb with an atmega328p in DIP format and an I2C OLED display with 128x64 pixels. At first I was using the adafruit library but I…
bask185
  • 377
  • 1
  • 3
  • 12
0
votes
2 answers

How to access class's virtual method from interrupt service routine?

I am trying to implement PWM using Timer0 for Atmega328P in C++. Indeed, I have achieved this. But, I have another related problem. I have a PWM abstract base class that provides an interface for PWM implementation. // mcal_pwm_base.h #ifndef…
BHOS
  • 91
  • 7
0
votes
1 answer

Define array in header and storing it in stack

I need to define a global array which has to be visible in every file. I declared it in a header file, but it's stored in heap e not in stack. How can i put it in stack? Thank you EDIT: I'm using an ATMEGA32 and array is put at the begin of the RAM…
Amos Elia
  • 3
  • 2
0
votes
0 answers

Interrupt button and Led not working properly

I am building a traffic light system. So when the button is not pressed, led 1 and 4 will turn on for 4 seconds, then led 2 and 3 will turn on for 4 seconds. If the button is pressed, the led for pedestrian (led 5) will wait and turn on only when…
Trần Thiên
  • 33
  • 1
  • 1
  • 6
0
votes
0 answers

Sending a string to UART gives garbage with printf

I'm trying to format data sent over a USB UART with printf and it's giving me garbage. I can send a simple string and that works but anything I try to format gives junk. Looking through the code I think it has to do with my string not being in…
CaseyB
  • 24,780
  • 14
  • 77
  • 112
0
votes
1 answer

I/O Data tranfer Modes and I/O addresses access

I've realized that the 3 ways to make an I/O connection : 1- Programmed I/O (polling) 2- Interrupt-Driven I/O 3- Direct Memory Access (DMA) now, I need to relate this with the reality of how accessing I/O addresses is done (Isolated I/O ||…
Ali K.
  • 7
  • 4
0
votes
1 answer

Why is the Atmega32u4 not running the code directly?

So, I programmed an ATMEGA32u4 and when I connect the device, it doesn't run the code. Instead, it gets recognised as an ATMEGA32u4 chip in Windows device manager. To get the code running I have to open Atmel FLIP and open USB and then have to press…
0
votes
0 answers

Why the screen resets every second?

I am trying to complete my project at university but I cannot find why my screen resets after a second. The project supposed to be stopwatch, showing minutes and seconds. I need to have 3 buttons: 1. startstop 2.set minutes 3. set seconds, but it…
KK 13
  • 53
  • 5
0
votes
1 answer

ISR-defining vs checking for TIFR corresponding bit in AVR timer programming

With timers, I want to toggle an LED every one second. I'm using ATMega32 and the clock frequency is 1MHz. I can get to 0.1 second using the 8-bit counter, and for each 10 timer interrupts, I blink the led. #define F_CPU 1000000UL #include…
Tortellini Teusday
  • 1,335
  • 1
  • 12
  • 21
0
votes
1 answer

Is my program to generate a 1kHz square wave correct on pinb1 of ATmega32(8MHz 64presclar Timer1)?

The code compiles correctly but I am unable to obtain 1kHz Square Wave. I attached an LED at PINB1 to check. I used Timer1, with CTC mode and Prescalar as 64. PLease Help. #define F_CPU 8000000L #include #include "avr/iom32.h" // - - -…
0
votes
1 answer

I2C communication Receiving NAK bit

I've SAME51N19 controller, I'm using sercom 1 for I2C communication from PIN A16=PAD0 SDA & A17=PAD1 SCL. SAME51N19 facing Issues while transferring the data on address 0b0101001=0x29. Also, checking on oscilloscope not getting good. Attaching the…
0
votes
0 answers

ATmega32 SPI transmiting as slave device results in SPDR write collision

I'm simulating my code on Proteus and trying to send data between two ATmega32 devices via SPI as master and slave. However I keep getting the warning "SPDR Write Collision. Written data is ignored" for the slave device for each character of the…
0
votes
1 answer

Arduino Project

So, I am making a project wherein I will be using an Arduino Uno. What I want to do is, whenever the switch is on, the Arduino will make the led blink. But there is a twist. The LED will start blinking after 10 seconds of the switch status becoming…