Questions tagged [atmega32u4]
atmega32u4 is low-power Atmel 8-bit AVR RISC-based microcontroller
107 questions
5
votes
4
answers
241
views
Where in datasheet is the warning about unreliability of reading PINxn?
I use atmega32u4 (but believe it applies to all models). Here is the datasheet.
Consider the following C program (I use AVR-GCC 5.4.0):
#include <avr/io.h>
int main(void)
{
PORTB |= 1 <&...
5
votes
4
answers
4k
views
Library to set internal analog gain of the Arduino?
My original question was if there is a library that covers the internal comparator and differential and gain modes for the Arduino Uno, Mega 2560, Leonardo, Due, Zero, M0.
The answer is obvious: "No". ...
5
votes
1
answer
4k
views
Basic C++ programming, how to pass constructor argument into class?
I'm having some programming problems.
So here's what's happening:
In my .ino file, I have a tft variable which holds the connection to a LCD. I want to make a class which can either automatically ...
5
votes
1
answer
1k
views
Remove Bootloader on Arduinos
I am trying to move from arduinos to AVR C. Would somebody know how to remove the arduino bootloader from the microcontroller? Is there a different process for the different atmega microcontrollers ...
4
votes
1
answer
2k
views
Arduino Leonardo(Atmega32u4) - Detecting if USB is connected to a computer?
The closest thing I can find is if(Serial) but that only returns true if there's a serial port open.
The function I want, ideally, should:
Return true if plugged into a computer
Return false if ...
4
votes
1
answer
1k
views
It is possible to revive my Arduino Leonardo (mini beetle) board?
I have this board:
It has the atmega32u4 chip.
I have updated its code several times, and used it without issues for several months. Today, while updating (using Arduino IDE) it started to throw some ...
3
votes
3
answers
2k
views
Arduino Leonardo as keyboard for an iPad
I'm trying to make a Arduino Leonardo as a Keyboard for an iPad. I was successful with an Arduino UNO. However I'm hoping to use an ATmega 32U4 because of the better HID functionalities and smaller ...
3
votes
2
answers
6k
views
Minimal Arduino using ATmega32U4
I am a newbie and I would like to build my own minimalistic ATmega32U4 based arduino compatible board. Can anyone please tell me which parts resistors/capacitors (and maybe one status led) I need to ...
3
votes
1
answer
2k
views
Digital I/O threshold voltages for ATmega32u4
What are the voltages on a ATmega32u4 (eg Arduino Leonardo) such that a HIGH or LOW is read?
I want to ensure that I'm reading the chip reference manual correctly, where Table 29-1 says:
VIL: Input ...
3
votes
1
answer
730
views
Atmega32u4 issue
I made a custom ATmega32u4 board for my project. Components came from clone of Arduino Pro Micro (with bootloader and code which I uploaded) from AliExpress. I soldered everything in to my board ...
3
votes
1
answer
341
views
Alerting the ATMega32u4 that it's plugged into a computer (via USB)
I need help in writing some code that will allow for the ATMega32u4 to be aware of when it's plugged into a USB port. I'm not really familiar with the ATMega32 or with it's function in Arduino, so I'm ...
3
votes
2
answers
3k
views
Can I use arduino pro micro rx tx as digital pins
I'm using arduino pro micro Atmega32u4 5v 16Mhz
I want to use it to make a HID Keyboard and Mouse but I ran out of pins so I was wondering if I can use the RX and TX pins as digital input pins. Will ...
3
votes
1
answer
2k
views
Does the Arduino pro-micro 3.3v use an 8MHz crystal or a 16MHz crystal with a clock divisor of 2?
I am trying to convert some 5v Leonardo-compatible boards to run at a lower 3-3.7v voltage, so that I can power my project using LiPo batteries.
As far as I can tell, the default Leonardo settings (...
3
votes
1
answer
509
views
Red LED not turning off on Adafruit Circuit Playground Classic
When using the traditional Blink example program, the light blinks as expected. Even when writing from scratch digitalWriteing pin 13 to high and low repeatedly works fine. The problem is when I try ...
3
votes
1
answer
2k
views
Custom board with ATMega32u4 having USB issues
I built a custom arduino based board (speciffically based off of Sparkfun's Pro Micro 3.3V 8Mhz and their Qduino mini boards) that uses the ATMega32u4-RC.
The board I built integrated an acceleromter ...
2
votes
2
answers
3k
views
Keyboard.print() skips keys
I'm playing with the Arduino Leonardo Keyboard.print() command, but I'm facing a annoying problem:
When I print a double quote, it will not appear and also will make to disappear the next character (...
2
votes
1
answer
5k
views
USB MIDI HID with the ATmega32u4?
There are existing projects that allow the Uno and other devices using the ATmega8u2 to operate as a USB MIDI HID, such as MocoLUFA. Unfortunately, as far as I am aware, these require uploading new ...
2
votes
1
answer
2k
views
Arduino: Hardware SPI hangs, bit-bang does not
I'm using FastLED with a custom board built around the ATMega32u4. When I set it to use Software SPI, everything works fine, but when I use hardware SPI it just hangs whenever it tries to write out ...
2
votes
1
answer
423
views
Is it possible to remove the bootloader while flashing using the bootloader?
The question is meant as in, can I lock myself out of the Arduino using the bootloader, if I flash a hex file that doesn't contain the bootloader?
Or does the bootloader automatically add the flashed ...
2
votes
1
answer
2k
views
Send custom HID values instead of keys
I've been building a small macro keypad based on the ATmega32U4. So far, I've been able to send standard key presses to the host. But since I want a program on the host system to react to the key ...
2
votes
1
answer
10k
views
Suddently, "avrdude: Device signature = 0x000000" with ArduinoISP. Is my chip dead?
I have some boards with the atmega32u4 that they were working perfectly before. I'm using an unnoficial UNO board to program them via ICSP. To power the uC I'm using two lithium batteries and a step-...
2
votes
2
answers
333
views
How to detect, if Serial is really connected to listening PC program? (on atmega32u4)
How to detect, if Serial is really connected to listening PC program? (on atmega32u4)
I need to connect from PC to Arduino Micro Pro over USB Serial and disconnect again and not slow down the Arduino ...
2
votes
1
answer
835
views
Unable to flash arduino pro micro from Terminal
I am trying to upload an hex file to my arduino pro micro using Avrdude . The thing is that I cannot upload any code using the Avrdude terminal commands , but when I use arduino IDE to upload any code ...
2
votes
2
answers
6k
views
Programming Arduino Micro via RX/TX
I can't access my Arduino Micro's USB programming port when it's in my project. I want to reroute the RX and TX pins outside to a serial-to-usb adapter.
I have this on hand from a while ago. I found ...
2
votes
1
answer
250
views
What does the bootloader do?
As far as I understand it checks for a valid serial connection (new program incoming) and then either writes it to flash or starts executing the existing program.
Can't the 32u4 or EDBG fill the role ...
2
votes
1
answer
246
views
Arduino AVR Program with default ATMEGA32U4 bootloader instead
I’m working an Arduino program that uses the FastLED library and is all coded in the Arduino IDE (not my choice, just a result of this OOS library).
However, I don’t want to run this on an “Arduino” ...
2
votes
1
answer
3k
views
How does Arduino IDE reset a board before flashing? Why doesn't avrdude do it?
I have the beetle board, a Leonardo clone same as in this question.
Using the reset pin and quick hands on the keyboard, I am able to flash with avrdude and get also the board info with a command ...
2
votes
2
answers
911
views
Optimizing ext. SPI ADC for speed and verify the speed
So I have a project where I will be using an Arduino Leonardo and an external ADC (AD7980) to run a 16-bit (18bit) conversion and transmit it to the Arduino and then out on USB as fast as possible.
...
2
votes
1
answer
360
views
How can I send data to many IC's without using tons of shift registers?
I'm building an audio circuit that will play VGM files (Video Game Music).
I have it working with two different "vintage" IC's such as the SN76489 and the AY-3-8912.
Currently, my design is using an ...
2
votes
0
answers
1k
views
How to enable auto reset in Arduino Leonardo?
I am trying to program an ATMega32u4 microcontroller through arduino IDE. I have added external oscillator(16Mhz) and capacitors and few other connections according to the Schematic. I had put a ...
2
votes
0
answers
382
views
Atmega 32U4 doesn't show on device manager after fuse bits reset
I am finally ready to try setting fuse bits on my ATMega32u4-AU custom board (8Mhz Ceramic Resonators, 3.3V), however, after I set the fuse bits and plug my board to computer, the device manager ...
2
votes
0
answers
937
views
Bitmap only displays correctly with PROGMEM keyword
I have a bitmap to draw defined as below.
PROGMEM const unsigned char ship1 [] = {0x18, 0x3C, 0x7E, 0xFF, 0x81, 0xC3};
It is then used by the arduboy library's draw slow bitmap function like so:
...
1
vote
3
answers
12k
views
Is it possible to upload an arduino sketch through the serial port (RX) instead of USB
In another words, is it possible to develop a custom bootloader so sketches can be uploaded via serial connection made using the RX/TX pins and not via the USB connector (I am using Pro Micro boards)?
...
1
vote
2
answers
409
views
Is there a way to get about a 10ns Timer resolution from an AVR CPU?
I have an 8Mhz ATM32u4 that is able to read external pulse inputs at 125ns ticks using InputCapture3 (PC7) on its 16-bit timer. Is there a magical way (bitbanging?) to get around 10ns tick resolution ...
1
vote
2
answers
2k
views
Using Keyboard library for ISO-UK layout
I am creating a keyboard and the PC I use it with is configured for UK so the keyboard layout it expects is this
I've highlighted the ISO-UK vs ANSI-US differences but the only key I am having real ...
1
vote
2
answers
1k
views
Arduino Micro draws too much power from iPhone. How can I change that?
I'm building a USB keyboard that has two buttons - space and enter. The plan is to use this USB keyboard (with an Apple Lightning connector to USB) with the built in iOS switch control. I bought the ...
1
vote
1
answer
189
views
is it possible to convert a 328 design to use a 32U4?
I have several projects that use simple 328 based arduinos that I built myself, similar to the familiar "arduino on a breadboard" projects that I'm sure everybody has seen. They have just the bare ...
1
vote
3
answers
2k
views
Analog input draws current when Arduino is turned off
I am using a Arduino Pro Micro from SparkFun (similar to Arduino Leonardo, cpu: Atmega 32u4). It has a analog input: A0, which I use to keep track of the battery voltage in my battery powered project (...
1
vote
1
answer
236
views
What to do after prototyping?
I want to make a USB gamepad, and I've heard that an Arduino would be great for this kind of project. But before I start to work on it, I want to make sure I understand some things. Here are my basic ...
1
vote
1
answer
337
views
Input Capture Mode PPM signal
Greetings to all members of the Forum. I would like to express my deepest gratitude, with respect to the title of this post.
The last week I am trying to capture and decode a PPM Signal from an RC ...
1
vote
1
answer
265
views
Pro micro Wire.endTransmission() does not return
I have an Arduino Pro Micro(blue version) and I'm having trouble using the I2C. To test it, I use the code below and the result is an infinite square wave on SCL and SDA lines and I only get the ...
1
vote
1
answer
276
views
Input Capture with Sleep Enabled on ATM32u4 board only works every second reading in SLEEP mode
In short: I have an Input Capture code and a Power-Saving code combined into one program. Both are adapted from Nick Gammon's examples that work fine independently. When I combined them into one ...
1
vote
1
answer
11k
views
Arduino stopped working: avrdude: ser_open(): can't set com-state
I'm playing with my first Arduino device (Arduino Leonardo). It worked fine but at some point it failed. I'm getting this error:
avrdude: ser_open(): can't set com-state for "\.\COM6"
An error ...
1
vote
2
answers
130
views
Is Arduino Keyboard in Single User Mode Possible?
Has anyone had success using the keyboard functionality of any arduino in single user mode of mac computers? I would like to inject keystrokes in single user mode, and have been unsuccessful with the ...
1
vote
2
answers
2k
views
Using INT2/3 on Arduino Micro (Atmega32u4)
My project is using almost all the pins on this board and I require an interrupt pin to read radio state (rather than polling). I'm using I2C, so that leaves INT2 and INT3, which are the TX and RX ...
1
vote
2
answers
2k
views
After burning bootloader, Windows 10 doesn't recognize the USB device
I just built my own version of an Arduino Micro, using the ATMEGA32u4 chip. I burned the bootloader to it via another Arduino (Arduino Nano from banggood.com).
The Arduino Nano uses an ATMEGA328 chip,...
1
vote
2
answers
3k
views
Can the Mouse library scroll horizontally?
I'm using the Mouse library with an ATmega32U4 connected to Linux via USB.
I would like to issue horizontal scroll commands, but the Mouse.move() function only seems to accept X movement, Y movement ...
1
vote
1
answer
2k
views
High power consumption of ATmega32u4 when connected to iOS device
Just wondering if I can get some help here.
I have a simple scheme of MIDI controller based on ATmega32u4:
ATmega32U4 with TXLED and RXLED as output pins and USB functionality
And my team wants me ...
1
vote
1
answer
3k
views
Confusing Arduino Leonardo PWM
I'm having problems with using Arduino Leonardo PWM outputs (I'm actually using YUN board).
I need 4 PWM outputs that generally have the same base frequency of around 10 to 20 Hz or so.
I'm using ...
1
vote
1
answer
3k
views
Flash firmware with hex file over serial with Python (no avrdude, Arduino IDE)
I'm trying to make a Python function in the TCLab package to flash firmware to an Arduino Leonardo (32u4). I can compile the TCLab ino (firmware) and deploy with the Arduino IDE or with the Python ...