Tinyiox and broadcasting of timer channel 0

Main site: http://jbperf.com/index.html
Post Reply
Todd133
Posts: 4
Joined: Sat May 30, 2020 6:29 pm

Tinyiox and broadcasting of timer channel 0

Post by Todd133 » Sun Jul 05, 2020 1:58 pm

Hi I hope I'm wording this correctly. I'm building a tinyiox for speed and fuel level inputs. I need to use this data on my custom dash display and was wondering now about being able to see timer channel 0 over canbus (still new to canbus but learning) I've been using the can manual so far for setting up the dash. I've have successfully received all data I need so far by using the base id and group numbers but the tiny is confusing me. Can I use the group 27 id from the manual for remote board pwm input? Would this be the timer data from the tinyiox board?

jbelanger
Posts: 3860
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada
Contact:

Re: Tinyiox and broadcasting of timer channel 0

Post by jbelanger » Sun Jul 05, 2020 2:39 pm

I think there is some confusion over the CAN protocol. When you mention the group id, that is from the MS CAN broadcasting on the MS2 and MS3. The TinyIOx does not use CAN broadcasting but uses the MegaSquirt CAN protocol which is not the same and requires polling. It's the original CAN protocol used with the MegaSquirt ECUs. It allows communication in both directions and is much more flexible but it is more complicated to implement.

The document for this protocol is linked to on the msextra manuals web page and is directly available here: http://www.msextra.com/doc/pdf/Megasqui ... -01-20.pdf

Jean
Image

Todd133
Posts: 4
Joined: Sat May 30, 2020 6:29 pm

Re: Tinyiox and broadcasting of timer channel 0

Post by Todd133 » Sun Jul 05, 2020 5:17 pm

Well that sucks. I may not be able to use the data then. I was hoping maybe my microsquirt would be able to send something in the other format for the dash display. Even raw data as I can use calculations to scale it to something useful

jbelanger
Posts: 3860
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada
Contact:

Re: Tinyiox and broadcasting of timer channel 0

Post by jbelanger » Sun Jul 05, 2020 5:50 pm

Actually, you can do it in a roundabout way. I'm not sure if that was what you meant in your first post and I might have read it a bit too quickly.

I don't know if you have an MS2 or MS3 but you can poll the data from the TIOx on your MS and then use id 27 (as you suggested) for the timer data (raw data). You can also use id 13 for your other sensor.

If you're not sure how to do all this, give more details about your setup and I can help you with the setup.

Jean
Image

Todd133
Posts: 4
Joined: Sat May 30, 2020 6:29 pm

Re: Tinyiox and broadcasting of timer channel 0

Post by Todd133 » Sun Jul 05, 2020 6:37 pm

Yes that is exactly what I was asking/thinking. I have a microsquirt (MS2) and have built a custom dash cluster for my truck but it is running Android on a single board computer and realdash app (I can write custom ini like text to direct and use calcs on the data) I would have a 5v square wave signal from my vss into timer 0 ( already have a board that outputs this from the factory vr vss sensor) it would be putting out 12 pulses per driveshaft revolution with 3.55 gear and 30"tire. As long as I can use the group 27 output I should be fine (other than the calculations but I'm sure I can figure that out) I would be interested in how to poll it to that for sure. I haven't hooked up the tiny yet (I'm sure that will also be a leaning curve! Lol) as I'm still figuring out what I need for the sender circuit At 16ohms empty and 158ohms full (don't need any crazy resolution just a full to empty gauge) I was thinking a voltage divider circuit may be the best way on that? But I'm open to experience if someone has some knowledge on it.

Todd133
Posts: 4
Joined: Sat May 30, 2020 6:29 pm

Re: Tinyiox and broadcasting of timer channel 0

Post by Todd133 » Sun Jul 05, 2020 6:39 pm

Oh and the tiny will be using its own power supply as to not overload the microsquirt

jbelanger
Posts: 3860
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada
Contact:

Re: Tinyiox and broadcasting of timer channel 0

Post by jbelanger » Sun Jul 05, 2020 7:24 pm

The timer value corresponds to the number of clock ticks between 2 pulses. The default settings on the TIOx is to use the 24MHz clock divided by 128 (prescale) which gives a 187500 Hz clock. The timer value is a 16-bit which means that the maximum (lowest speed) is 65535 which is equal to 0.34952 second between pulses. You need to compute what that equals to in your setup to convert the distance and time into mph. If that is not precise enough, you can change the settings on the TIOx.

And the sender has a very low value which means you will have to use only part of the 0-5V range. This is similar to a TPS sensor but with a much smaller value so you should use a circuit similar to that but with a resistor between 5V and the sender to keep the current reasonably low. If your sender is connected to 12V and you cannot remove this to use 5V instead (with the aforementioned additional resistor) then you will need a voltage divider circuit but that will mean you have 2 voltage divider circuit in series (the sender is a voltage divider) so you need to take that into consideration in your computations.

To get the data on the Microsquirt from the TIOx, you will need to set things up in the CAN Parameters in TunerStudio. You will need to set the ADC polling
for the fuel sender (CAN Id for the TIOx is 4 and you can leave the table (7) and offsets (2, 10) as per the defaults. For the vss, you will need to enable PWM polling (CAN Id 4, table 7, offset 28). You will need to also enable the ADC and PWM inputs on the TIOx.

Jean
Image

Post Reply