Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKYSTARSF405HD4 Change timer for S5 S6 #10371

Open
Yarolsav180703 opened this issue Sep 19, 2024 · 2 comments
Open

SKYSTARSF405HD4 Change timer for S5 S6 #10371

Yarolsav180703 opened this issue Sep 19, 2024 · 2 comments

Comments

@Yarolsav180703
Copy link

Yarolsav180703 commented Sep 19, 2024

Current Behavior

I use SKYSTARSF405HD4 FC and want to use 4 motors(S1-S4) and 2 servos (S5-S6) But its badly assigned to Timers like
S1 Timer4
S2 Timer4
S3 Timer3
S4 Timer2
S5 Timer3
S6 Timer3
And I can't use it like I want cause Timer 3 is already used by the Motor output

Desired Behavior

I asking for help to change the Timer in FC target, but I don't understand how to do it right, cause channels for alternative timers have an N index

Suggested Solution

After googling I have seen some similar solutions, but I have Inav 7.1.1 and it seems the syntax of the Timer definition little bit other
I suggest changing Timer 3 to Timer 8 or Timer 1 with the N index

I write it in target.c, Timer 8 appears in Inav for S5 S6 S7(from where?) and servos don't working. Maybe I am wrong in syntax

#if defined(SKYSTARSF405HD2)
DEF_TIM(TIM8, CH2, PB0, TIMER_OUTPUT_N_CHANNEL | TIM_USE_OUTPUT_AUTO , 0, 0),
DEF_TIM(TIM8, CH3, PB1, TIMER_OUTPUT_N_CHANNEL | TIM_USE_OUTPUT_AUTO , 0, 0),
#endif

UPD. I tested it with an oscilloscope and there is no PWM output on the S5 S6 pads

Who does this impact? Who is this for?

All who use that FC and want wider functional

Additional context

image

Similar request, but here used for 6 motors, I need 4 motors and 2 servos #9415

@mmosca
Copy link
Collaborator

mmosca commented Sep 19, 2024

Not all timers are available to all pins. This is a hardware limitation.

Have you checked if there are other timers available for those pins? And have you tested if the new configuration still supports dshot correctly?

@Yarolsav180703
Copy link
Author

Yarolsav180703 commented Sep 19, 2024

Thank you for your answer!
image
According to the datasheet, at those pins available Timer 1 and Timer 8 with index N, I've seen that it is possible to use them with target tweaks like here: #3921

I tested it, seems to DSHOT working correct, but servo outs 5-6 not show any life signs
Also, Timer 8 is set to LED output, maybe it's playing some role here

Maybe, I make incorrect changes in the target.c, i cant find syntaxis example or reference for check it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants