Arduino leonardo x uno memory

Hi guys, I'm using a code and I decided to see how much memory is needed for my project, so I checked my code with Arduino Uno and Arduino Leonardo (328p x 32u4 atmel) but in Leonardo the memory needed is too different compared to Uno, even though both have the same memory size, so my question is: why?
uno:
image

Leonardo:
image

Im using the code from this site: Como usar com Arduino - Sensor de Pressão e Temperatura BMP180 - BLOG MASTERWALKER SHOP

thanks. Now I understand.

The Leonardo's connection to the PC is done from the microcontroller while the Uno's connection uses a simple UART that is connected to a serial-to-usb converter (16U2/CH340/...).

The 32U4 contains additional code for the USB connection (board identification, reaction on reset for upload) while that functionality on the 328P (Uno) is provided by the serial-to-usb converter.

It is actually the same core but the added functionality costs program memory. What is interesting (I've noticed it before) is that the Leonardo uses less RAM; I've never looked into the "why".

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.