Go Down

Topic: Any differences between 'Leonardo' and 'Uno as HID'? (Read 139 times) previous topic - next topic

pineappleman

I am using my Arduino Uno as HID device, but I am planning to just buy a Leonardo(using Hoodloader is too risky to me...). Are there any differences between Leonardo and Uno as HID? Such as differences in input lag....etc...

sterretje

Pin functions can differ. E.g. the I2C bus is on different pins (A4/A5 on Uno, D2/D3 on Leonardo).
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

INTP

If you think hoodloader is too risky, then get a Leonardo. But if the Uno is working, I don't see the problem you see.

uxomm

Some differences between Leonardo and UNO:

Serial
Serial on D0/D1 is "Serial1" and does not share it's pins with Serial <--> USB.

Interrups (external)
Leonardo: Interrupt 0 on D3, Interrupt 1 on D2
UNO:  Interrupt 0 on D2, Interrupt 1 on D3
Additional on Leonardo: Interrupt 2 on D0, Interrupt 3 on D1, Interrupt 4 on D7

PWM
Addition PWM pins D12 and D13, so there are 8 PWM pins (3, 5, 6, 9 10 11, 12, 13).
UNO has 6 WWM pins: 3, 5, 6, 9, 10, 11

Analog pins
There are 12 analog in pins on Leonardo (UNO: 6). A0 ... A5 (like the UNO) and additional analog in on 4 (A6), 6 (A7), 8 (A8), 9 (A9), 10 (A10), 12 (A11).

Additional pins
You can use some pins of the ICSP header as additional digital pins.
MISO ... D14
SCK ... D15
MOSI ... D16

PinMapping is pretty different as on UNO. You have to think about this, when you use direct port manipulation (or use libraries that do so).
Example:
Leonardo: D11=PB7, D12=PD6, D13=PC7
UNO: D11=PB3, D12=PB4, D13=PB5
Details:
Leonardo
UNO

SPI
MISO, MOSI, SCK are only on the ICSP header (not on D11 ... D13 like on UNO).
This may cause problems with shields that do not take this into account.

I2C (already mentioned)
Leonardo: SDA: D2, SCL: D3. Also on pins close to GND, AREF
UNO: SDA: A4, SCL: A5
Always decouple electronic circuitry.

Go Up