Support for the ATtiny1614

Now, this is not a request, this is a simple question about where it would be feasible at all to support the ATtiny1614: https://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny1614-16-17-DataSheet-DS40002204A.pdf

I’d be more than willing to try, but I totally lack the knowledge to know if the hardware is capable of working with the library at all. I thought that maybe, just maybe, it would be possible to adapt the code for the Arduino UNO?

For a little bit of context: I’ve been thinking about making a “module”, with the ATtiny1614 being controlled by another board and a L6234 breakout board and a magnetic sensor connected to the ATtiny.

Interesting idea. I am not an expert at all. However, you may want to look into the following points yourself and answer at least the basic requirements:

  1. Does ATiny have the required number and type of pins to drive L6234?
  2. Does ATiny have available number and type of pins to communicate with an external board once you use some of the pins for #1
  3. Does ATiny have available number and type of pins to communicate with an external magnetic sensor once you use some of the pins for #1 and #2
  4. Does ATiny have available number and type of pins to communicate with external current sensors (at least two) once you use some of the pins for #1 and #2 and #3
  5. Does ATiny have the memory to store the code to execute SimpleFOC?

I have a feeling that ATiny is a bit too tiny, no pun intended, however, you may be able to run a stripped down, velocity open loop, no sensors and no current measurements. I’d leave this to others with more knowledge to voice their opinion.

Best way, is to try and see if it works. Get an MCU and try to hook it up, as a table-top paper exercise, before you even get to the code.

Anything is possible. Let’s not forget that the Apollo AGC had less memory and processing power than ATiny and managed to land people on the Moon, over fifty years ago, using only a hundred k lines of assembler code. That alone should be an inspiration to anyone.

Word! I’m always blown away when I think about that.

Honestly, I would not make the attempt. This chip is not quite powerful enough to be worth it. It has enough pins so that the timer and SPI would both be available, but the timers don’t support hardware dead time insertion and there aren’t enough timer outputs for 6-PWM mode with software dead-time either. So you’d be limited to 3-PWM, and the performance on that would be quite limited due to the MCU’s low speed.
But what’s worse IMHO is the 2KB RAM / 16KB flash - this will be too little for the SimpleFOC library and all the Arduino cruft it depends on.

How much power does your application need? And why go for the tiny MCU? Because the L6234 is a kind of big chip in the first place… Are you trying to put it together from existing modules, or design your own PCB?

I’m looking at the STM32G491 at the moment - it’s available in a 32-pin 5x5mm configuration, with more than enough IO, timers for 6-PWM with dead-time insertion, CANFD support and more. I think that kind of chip is more what you want for driving BLDC motors from Arduino code.

As a module, the Teensy boards are tiny but very powerful, or a Seeduino Xiao is a tiny module with a SAMD21 MCU (mid-range in terms of power, but enough for SimpleFOC). There’s also some fairly small ESP32 modules, which is an excellent MCU for running SimpleFOC…

1 Like

Wow! The Seeduino Xiao is exactly what I was looking for. I had no idea it existed and it definitely fits my purpose. My main need was the smallest profile I could get that still worked with SimpleFOC. I will definitely take a look at the STM32G491 for a custom made PCB though, since COTS components do tend to take more space and that’s something I don’t have much of for my project. Thank you so much.