Maximum of (Pulse)Inputs?

已查看 35 次
跳至第一个未读帖子

Gabor Schilten

未读,
2015年9月8日 02:16:582015/9/8
收件人 ioio-users
Hi,

For an interesting new project, i have to intercept 6 rc receiver channels, and around 4 ultrasonic sensors to start with.
Outputting 6 pwm signals then for all engines and servo's..

However, according to the wiki, we only have single-precision and 3 double-precision pulse input modules.
If I'd exchange the 3 doubles for 6 single precision, I'd end up with 9.

Is there something I'm missing here? Or do I need to look for eather another IOIO board or Sensors based on I2C?

Thanks.

Gabor

Tyler

未读,
2015年9月8日 03:28:452015/9/8
收件人 ioio-users
Gabor, 

Based on the datasheet for the pic24FJ256 family, there are 9 input capture modules that can be configured any way you like. You should be able to do as you propose, unless the IOIO firmware is purposefully limiting you, which I doubt. 

Have you tried it yet? The IOIO firmware will tell you if you try to initialize something illegally (with a runtime exception).

Tyler

Tyler

未读,
2015年9月8日 03:37:002015/9/8
收件人 ioio-users
Just in case you're curious, here is an overload for initializing a pin as a pulse-input in single-precision mode:
This would open IN_PIN as a single-precision pin with a clock rate of 250KHz and measuring the time the signal stays high. 

// input = ioio_.openPulseInput(Spec spec, ClockRate clock_rate, PulseMode mode, boolean double_precision)
Input = ioio_.openPulseInput(new Spec(IN_PIN), ClockRate.RATE_250KHz, PulseMode.POSITIVE, false);

More detailed explanations are available in the javadoc.

Tyler

Gabor Schilten

未读,
2015年9月8日 05:59:052015/9/8
收件人 ioio-users
Thanks. Got it working. However, no idea how to get the 10th 'sensor' working based on PWM ;)

Op dinsdag 8 september 2015 08:16:58 UTC+2 schreef Gabor Schilten:

Tyler Trombetta

未读,
2015年9月8日 11:33:142015/9/8
收件人 ioio-...@googlegroups.com
Gabor,

I'm reading the value of a toggle switch outputting PWM by passing the signal through a low pass RC filter and then reading the value on an Analog IN pin. It's not pretty, but it works pretty reliably since I'm out of PuseInput modules. If you have something that doesn't need any fidelity that could be an option. 

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Ytai Ben-Tsvi

未读,
2015年9月13日 13:11:102015/9/13
收件人 ioio-...@googlegroups.com
Sorry for responding late. In case it matters, the IOIO is potentially capable of up to 9 single-precision PulseInput, where every pair of single precision can form a double precision.
For simplicity, I chose to expose this as 3 single + 3 double, but that's strictly an arbitrary software decision.
The code that does that is here:

The part that says new int[] {0, 2, 4}, new int[] { 6, 7, 8 },
Says "use modules 0+1, 2+3, 4+5 as double precision and 6, 7, 8 as single precision. You can change this to whatever other combination you want (remember that double precision always need to use an even index and would use up the next index too, and that in total you have 0 through 8).
There's currently no API to make that change, you're need to modify IOIOLibCore as explained.

Gabor Schilten

未读,
2015年9月13日 16:00:322015/9/13
收件人 ioio-...@googlegroups.com
Hi JTai,
No problem, still in designing phase.
Thanks for the link, will look into it when it's due.



Op zo 13 sep. 2015 om 19:11 schreef Ytai Ben-Tsvi <yta...@gmail.com>:
回复全部
回复作者
转发
0 个新帖子