Arduino - Extend the number of servos supported by a Rx
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Arduino - Extend the number of servos supported by a Rx
The '84 has a "Universal Serial Interface" that will provide the hardware, but will need some software support. Have a look at http://www.atmel.com/Images/doc4300.pdf.
Note that if the '84 is not using a crystal, you will need to make sure the baud rate is accurate enough.
Mike.
Note that if the '84 is not using a crystal, you will need to make sure the baud rate is accurate enough.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
-
- Posts: 4
- Joined: Mon Jun 06, 2016 4:36 am
- Country: -
Re: Arduino - Extend the number of servos supported by a Rx
Thanks for the link! I'm not planning to use a crystal - do you think the default baud rates (74880 or 115200) are close enough to the 100K baud at which the Futaba sBus operates? If not, how can I solve the problem with an external crystal oscillator?
Thanks in advance for any help!
Marsh
Thanks in advance for any help!
Marsh
Re: Arduino - Extend the number of servos supported by a Rx
The point is that the internal oscillator is of low precision, so when you set your code to say 115200 baud it may actually significantly different and potentially too far off for correct communication. I.e. you might need to calibrate the oscillator or tweak the baudrate generator values depending on what features the chip has.
Neither of these baudrates would work as is, they're very far.
Neither of these baudrates would work as is, they're very far.
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Arduino - Extend the number of servos supported by a Rx
Also the oscillator may drift as the temperature changes.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
-
- Posts: 4
- Joined: Mon Jun 06, 2016 4:36 am
- Country: -
Re: Arduino - Extend the number of servos supported by a Rx
It just clicked that the baud rates I gave are the defaults for the Arduino IDE serial monitor - you can set the ATTINY84 to whatever you want, right? However, your points regarding clock precision and stability are very valid ones. Are the internal clocks in the ATmega328P stable enough? It sounds like they are being used for processing sBus data for quads, so I'd guess they are. Perhaps going that route (or a Pro Micro?) would be better.
Questions still open about relationship between captured frame channel data and equivalent PWM data. Are they values that I can compare (simple <, =, > relationships) to determine switch position?
Any additional thoughts on viability of this in lieu of using discrete channels are greatly appreciated!!!
Marsh
Questions still open about relationship between captured frame channel data and equivalent PWM data. Are they values that I can compare (simple <, =, > relationships) to determine switch position?
Any additional thoughts on viability of this in lieu of using discrete channels are greatly appreciated!!!
Marsh
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Arduino - Extend the number of servos supported by a Rx
You might try using a Pro Mini first. Have a look at this: https://github.com/MikeBland/SbusToPpm.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Arduino - Extend the number of servos supported by a Rx
Arduinos and FCs all use a crystal oscillator.swampd32618 wrote:Are the internal clocks in the ATmega328P stable enough? It sounds like they are being used for processing sBus data for quads, so I'd guess they are.
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Arduino - Extend the number of servos supported by a Rx
Another option is to do what I have on the X8R-Analog device (https://github.com/MikeBland/x8r-analog).
This uses an ATTINY13 without a crystal, but measure the baudrate of the incoming serial data and adjusts its timing to match so if the internal oscillator drifts, it changes the baudrate to keep the correct speed.
Mike.
This uses an ATTINY13 without a crystal, but measure the baudrate of the incoming serial data and adjusts its timing to match so if the internal oscillator drifts, it changes the baudrate to keep the correct speed.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
-
- Posts: 4
- Joined: Mon Jun 06, 2016 4:36 am
- Country: -
Re: Arduino - Extend the number of servos supported by a Rx
I like the idea of syncing the MCU clock with the receiver. Can I do that with the ATTINY84 as well? It has an USI capability, so on paper it looks like it will work. I'm not sure, however, if I can get something working on the Arduino Mega and then use it as in ISP for the ATTINY84. Thoughts?
Marsh
Marsh
Re: Arduino - Extend the number of servos supported by a Rx
Hi, I'm new to this forum but the work of this code is amazing, I would like to use it in one of my videos o my YouTube channel, I was looking for a project like this, I know this post is old already but in case someone is still following. Is it a big job to change the code to use it with an Attiny85? I'm planning to use it to only switch few lights not to drive servos and I want a very small device. Cheers.
- MikeB
- 9x Developer
- Posts: 17996
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Arduino - Extend the number of servos supported by a Rx
The '85 could work. Compared to a Pro Mini, it doesn't have a full UART, only the USI and you will also need to consider whether you are using the internal oscillator or a crystal, and adjust the serial timing if using the internal oscillator.
Mike
Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Arduino - Extend the number of servos supported by a Rx
It is easy to find S-bus servos but I'm sorry S-bus Esc don't exist.