Giter VIP home page Giter VIP logo

Comments (4)

Teslafly avatar Teslafly commented on July 16, 2024

the chibios systick uses timer 2 unfortunately. timer 2 and timer 5 are the only 32 bit timers in the stm32f4 fit for chibios.
#define STM32_ST_USE_TIMER 2 (in mcuconf.h)
Timers 1 and 8 are used for motor pwm generation and adc control.

Timers 3 and 4 are supported because they are the 2 timers historically available on extra io pins for most hardwares. Either on the hall sensor port or the servo port. also they support dma which i think is required?

I do not believe that timer 5 is being used for anything if one of it's gpio's is accessible. but it needs to be enabled.

timer 13 (PA6) or 14 (PA7) may be able to be used as well, though they may not be able to access DMA? which i think is required for ws2812 control.

image

Basically, the hardware timers are tightly integrated with the way vesc works and playing around with them without being careful and understanding the larger system can quickly break things.

what reason do you want to use a different timer?

from bldc.

sshenker85 avatar sshenker85 commented on July 16, 2024

Appreciate your quick response.

Basically I have a hardware design where I am utilizing almost all of the available pins including timer3 and timer4. PB3/ Timer2 is the only remaining pin which I could use for the LEDs as I also noted it has DMA access.

If you say that timer5 could potentially be used for ChibiOS control, would it be a matter of simply swapping 2 to 5 in the below to free up timer 2 for the leds?:
#define STM32_ST_USE_TIMER 5

Thanks again for your help.

from bldc.

Teslafly avatar Teslafly commented on July 16, 2024

I think that would work. Both timer 2 and 5 are 32 bit so that should be the only change needed. Try it and see if it works.
Worst case the compiler yells at you or it doesn't boot.

Then getting the led package to work is the other thing.

from bldc.

sshenker85 avatar sshenker85 commented on July 16, 2024

Thanks Ill give this a try ! Yeah the other part should not be too difficult.

from bldc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.