# Autosteer on the Arduino Nano Every

**URL:** <https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355>\
**Category:** Autosteer\
**Created:** [14 March 2021 04:32 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355 "2021-03-14T04:32:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.lenfesty](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@david.lenfesty](https://discourse.agopengps.com/u/david.lenfesty)\
**Post date:** [14 March 2021 04:32 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/1 "2021-03-14T04:32:53Z")

</div>

I didn’t fully evaluate my decision to purchase a Nano Every and it turns out they aren’t _quite_ compatible with Autosteer without modifications.

Anyways, to get support in the IDE, you have to install the `Arduino megaAVR Boards` package in the Board Manager, and then select the every as the correct device, as so:

![nano_every](https://discourse.agopengps.com/images/transparent.png)

Then use the regular USB firmware from the `Support_Files` ZIP on release, except replace `Autosteer_USB_4.3.10.ino` with the file in [this github gist](https://gist.github.com/davidlenfesty/d841094d214235f5a023c1345adcbae3).

All I did was remove the 50kHz I2C setting and swapped out the PWM frequency configuration for a config that’s valid on the Nano Every.

A few caveats ATM:

- I’ve only tweaked the USB version, although I assume you could apply the same changes to the UDP version as well. I don’t have the hardware to test so I’m not doing it.
- This does not support the IBT2, you can _only_ use it with the cytron driver (or a PWM/DIR driver anyways), D4 is not PWM-capable on the Nano Every.
- I2C is now running at 100kHz which IMO should be fine but could be an issue if problems have been seen at that speed.

---

<div class="post-metadata">

**Author:** ![PotatoFarmer](https://discourse.agopengps.com/user_avatar/discourse.agopengps.com/potatofarmer/32/11865_2.png) [@PotatoFarmer](https://discourse.agopengps.com/u/PotatoFarmer)\
**Post date:** [14 March 2021 05:52 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/2 "2021-03-14T05:52:47Z")

</div>

If you look in the board manager there are legacy settings for the Every, compatible with the original nano pinout and processor speed.

For other projects you can use the megacorex board library to get a second hardware uart on the Every too.

---

<div class="post-metadata">

**Author:** ![david.lenfesty](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@david.lenfesty](https://discourse.agopengps.com/u/david.lenfesty)\
**Post date:** [14 March 2021 16:39 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/3 "2021-03-14T16:39:27Z")

</div>

Yep, although unfortunately the emulation layer doesn’t cover the I2C and timer registers that are directly written to by the autosteer code, hence the changes.

---

<div class="post-metadata">

**Author:** ![giotoma](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/g/9fc29f/32.png) [@giotoma](https://discourse.agopengps.com/u/giotoma)\
**Post date:** [17 March 2021 01:25 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/4 "2021-03-17T01:25:34Z")

</div>

can you delve a little deeper into this topic?

---

<div class="post-metadata">

**Author:** ![PotatoFarmer](https://discourse.agopengps.com/user_avatar/discourse.agopengps.com/potatofarmer/32/11865_2.png) [@PotatoFarmer](https://discourse.agopengps.com/u/PotatoFarmer)\
**Post date:** [17 March 2021 02:17 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/5 "2021-03-17T02:17:34Z")

</div>

Which part of it?

The Nano every is the new version of genuine Arduino hardware. It is capable of running up to 20mhz vs 16Mhz. For the most part apparently, the legacy setting for the compiler will run original nano programs at the 16mhz clock rate with a comparable pin out to the original nano.

There is a special board library on git hub for it called megacoreX that makes it vastly more useful, and gives it a second Hardware uart not enabled by Arduino.

![nanolibrary](https://discourse.agopengps.com/images/transparent.png)

Looks like legacy may be better handled in MegaCoreX as well.  
Watch out for the Ali Every clones, they need to run the “Thinary library” and are next to useless.

---

<div class="post-metadata">

**Author:** ![giotoma](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/g/9fc29f/32.png) [@giotoma](https://discourse.agopengps.com/u/giotoma)\
**Post date:** [17 March 2021 09:32 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/6 "2021-03-17T09:32:39Z")

</div>

do you think there could be problems compiling the autosteer sketch with maegacoreX? the second serial would be very useful for connecting the Vesc motor controller, without having to resort to the SoftwareSerial

---

<div class="post-metadata">

**Author:** ![giotoma](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/g/9fc29f/32.png) [@giotoma](https://discourse.agopengps.com/u/giotoma)\
**Post date:** [7 April 2021 14:17 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/7 "2021-04-07T14:17:29Z")

</div>

I tried to run the new usb autosteer on the nano every with the MegaCoreX and the clock at 20 MHz, the serial communication does not work, the same sketch with the clock at 16MHz works … any ideas?

---

<div class="post-metadata">

**Author:** ![Roderick1st](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/r/848f3c/32.png) [@Roderick1st](https://discourse.agopengps.com/u/Roderick1st)\
**Post date:** [7 April 2021 16:03 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/8 "2021-04-07T16:03:32Z")

</div>

I have my PCB working with the nano every thanks to Davids code. Does anyone else suffer a slow down in data getting to AOG if you enable the Inclinometer?

---

<div class="post-metadata">

**Author:** ![PotatoFarmer](https://discourse.agopengps.com/user_avatar/discourse.agopengps.com/potatofarmer/32/11865_2.png) [@PotatoFarmer](https://discourse.agopengps.com/u/PotatoFarmer)\
**Post date:** [7 April 2021 18:05 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/9 "2021-04-07T18:05:14Z")

</div>

Some baud rates are incompatible with certain processor frequencies, that could be causing issue.

[http://ruemohr.org/~ircjunk/avr/baudcalc/avrbaudcalc-1.0.8.php](http://ruemohr.org/~ircjunk/avr/baudcalc/avrbaudcalc-1.0.8.php)

But it looks like 20MHZ should be good.

Not sure if AOG has timed events millis() in the code, but that also has to be scaled, or at least the processor speed defined somewhere in the code.

---

<div class="post-metadata">

**Author:** ![giotoma](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/g/9fc29f/32.png) [@giotoma](https://discourse.agopengps.com/u/giotoma)\
**Post date:** [7 April 2021 19:00 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/10 "2021-04-07T19:00:18Z")

</div>

Seems to me that the only millis() is for the freq of the main loop, if I don’t change it, the code will only run faster I think…

---

<div class="post-metadata">

**Author:** ![FarmingEng](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/f/a3d4f5/32.png) [@FarmingEng](https://discourse.agopengps.com/u/FarmingEng)\
**Post date:** [21 August 2022 08:58 UTC](https://discourse.agopengps.com/t/autosteer-on-the-arduino-nano-every/4355/11 "2022-08-21T08:58:57Z")

</div>

Hello! Is there a later version of this modification available? I’m trying to get the USB-Version 5.0 to work with the nano-every board, but it dosen’t really work as of now.

Thanks!
