TinyIOx: read LC1 digital data. Now with generic PWM

A forum for discussing the MegaSquirt related (but non-B&G) board development, assembly, installation, and testing.

Moderators: jsmcortina, muythaibxr

ruzki
Helpful MS/Extra'er
Posts: 63
Joined: Thu Nov 01, 2007 1:06 pm
Location: Germany
Contact:

Re: TinyIOx: read LC1 digital data

Post by ruzki »

OK sounds good 8)

i will follow you !
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

There is now a possibility of having 2 generic PWM channels. Each channel has an 8x8 duty cycle table with a load on the y-axis and the RPM on the x-axis. The load can be either MAP, fuelload, TPS, MAFload, CLT, BattV or MAT. This load and the RPM are read over CAN at a rate of about 20 times per second. Since these are at standard locations in the output tables of both MS2/Extra and MS3, the TinyIOx firmware can read these parameters without a user input (other than the selection of the load parameter).

More details are available here: http://forum.jbperf.com/viewtopic.php?f=9&t=1181

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

I thought I'd add what the configuration looks like (even though it is in the post I linked):

Image

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

You can now buy the board directly here: http://jbperf.com/io_extender/tinyIOx.html#Buy

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

For anyone using the generic PWM function on the TinyIOx, you need to upgrade the firmware version: http://forum.jbperf.com/viewtopic.php?f ... 6079#p6079.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

There is a new firmware release with features ported from the IOx and some new ones: http://forum.jbperf.com/viewtopic.php?f ... 6383#p6383.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Wergilius
Experienced MS/Extra'er
Posts: 162
Joined: Fri Sep 16, 2005 12:50 pm
Location: Stockholm, Sweden
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by Wergilius »

Hi

I have the TinyIOX, MS2 and the EGT TC board. Everything seems to be working but I have some minor problem
that I hope to get some help with. Since I have minor mod in my MS firmware and another similuar setup I would
like to have AI 0-3 to map top analog 1-4 and analog channel 1-4 in MS.

If I make the setup 0-3 to 0-3 I get all values correct (EGT 0 to 3 is channel 0-3)
Image


But if I try to map them to 1-4 only channel 1-3 is shown in MS (it works in TinyIOX)

Image
Image

What is I doing wrong here?


Some other strange this, if I want to use the new built in PWM output
then in Base IO I should set PWM outputs to disabled?

Regardles of this setting I can only set 1.6 and 0 on the first 4 rows according to this picture:
Image


Would it be possible to use this connection to generate a PWM out (to get 12V PNP PWM and protect the CPU)?
Image

Thanks in advance!
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

I'm sorry but I'm confused about what you're trying to do and what the gauges are showing. First, on which physical pins are the EGT inputs connected? Second, is this trying to get around the numbering that is different depending what you're looking at where some start at 1 and others start at 0? If you have one set up that works, why do you want to change it? The easiest way for me to see what is going on is for you to post you project (archive the project in TS and post the resulting .tsproj file; use the option to not include log files when you create the archive).

The PWM outputs in the base settings are for when the MS is controlling the outputs. So you need to leave those disabled to give the TinyIOx control over the outputs through the generic PWM outputs. If one is enabled, the other will be greyed out.

As for the values, you can set values other than 0.0 and 1.6 but you are limited multiples of 0.4 so you could have 0.4, 0.8, 1.2, 1.6... This is done so that the range of 0-100% has the best resolution possible while using a single byte. So you have a resolution of 1/255 for the 0-255 values which represent 0-100%. If you still can't get anything between 0 and 1.6 let me know when you post your project and I'll have a look at that also.

As for your schematic, using that circuit with 12V is not the best idea. You should instead use this which will completely isolate the 12V from the CPU:
high_side_output.png
Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Wergilius
Experienced MS/Extra'er
Posts: 162
Joined: Fri Sep 16, 2005 12:50 pm
Location: Stockholm, Sweden
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by Wergilius »

thanks for the pwm layout. i will send the bacup later.

i was a bit unclear, i have a similaur setup but other hardware
so i would like to have this (as it seems possible in settings)

tiny ad0 -> ms ad1
tiny ad1 -> ms ad2
tiny ad2 -> ms ad3
tiny ad3 -> ms ad4
(raw value in tiny is ok, not shown in ms)

if i configure tiny ad0-3 to ms ad0 to ms ad3 it work as expected.

i know about the 8bit limit for pwm, no other value than
1.6 and 0.0 is possible to write in half the grid.

but i post backup msq later today.
Wergilius
Experienced MS/Extra'er
Posts: 162
Joined: Fri Sep 16, 2005 12:50 pm
Location: Stockholm, Sweden
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by Wergilius »

here is the backup of ts
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

That project is not correct. There is no TIOx msq and the current msq for the MS2 doesn't have the CAN enabled. Please load another one with the exact configuration you have so that I don't have to guess what I'm supposed to be looking at.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Wergilius
Experienced MS/Extra'er
Posts: 162
Joined: Fri Sep 16, 2005 12:50 pm
Location: Stockholm, Sweden
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by Wergilius »

On the wish list for the next firmware it would be a nice feature to be able to
select the internal PWM outputs as replacement for the analog input to be
send to MS thru the CAN message, something like this:

Image

Would make it easy to logg and evaluate from MS.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

If you want to log the PWM outputs from the MS2, you can use offset 134 for PWM polling on the MS2 and you will then have PWM A and B in the first 2 PWM inputs on the MS2 (the other 2 will have invalid data). You will need to change the MS2 ini to log the data (gpiopwmin0 and gpiopwmin1) since nothing is done with those at this time.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Wergilius
Experienced MS/Extra'er
Posts: 162
Joined: Fri Sep 16, 2005 12:50 pm
Location: Stockholm, Sweden
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by Wergilius »

Ok thanks for the tip, but I guess if I change the ini file that would not change the data stream from the standard Get Command "A"?
(i'm using an external USB data logger for my MS projects so I could always add it in firmware as well if needed)

/jens
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

It won't change the data stream. However, the data stream already contains the needed variables at offset 120 and 122. You only need to do something if you want to see the data in an msl file because the current ini does not tell TunerStudio to write those variables to the log file.

If you don't use TunerStudio but do something else with the data from your logger, you simply need to use the data at the offset mentioned above.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Wergilius
Experienced MS/Extra'er
Posts: 162
Joined: Fri Sep 16, 2005 12:50 pm
Location: Stockholm, Sweden
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by Wergilius »

Thank you for the info, I will try that.

Regarding my other issues I have looked some more at it:

ADC Mapping not working as expected:

If I leave the ADC Mapping default (or manually let it be default) I can see this on the CANbus:
Image

Actually only channel 1-4 is activated in TinyIOX but all groups polled so I would have expected 0 in
all unused channels.


But if I alter the ADC mapping according to my previous uploaded cfg, channels are correct on 1-3
but channel 4 is missing (or still zero) Channel 2-5 active in TinyIOX:

Image



Internal PWM table A not accepting value other than 1.6 or 0.0

If I change any cell above row 4 I get expected result, 50 -> 128 -> hex 80 (purple)
If I change any cell on row 4 and lower, I only get 1.6 or 0.0 (I tried to write 50)

CANbus info on the left side:

Image

Suggestions welcome :?
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

Please post your project. The one you posted did not have a TinyIOx msq in it (the one with a TinyIOx msq is actually an MS2 msq; make sure to select the correct device when you do a save as). And other settings were not the same as the pictures you posted. So I don't know how you generated the archive but there was something wrong with it or you did not use the same project. You can also simply zip the directory where your project is located.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Wergilius
Experienced MS/Extra'er
Posts: 162
Joined: Fri Sep 16, 2005 12:50 pm
Location: Stockholm, Sweden
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by Wergilius »

Very much possible, attaching correct files (zip of folder)
Sprint HB_140319.zip
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by racingmini_mtl »

The first problem with the ADC is due to a bug in MS2Extra 3.3.1 and earlier. If you use 3.3.2 or later, it will solve the issue.

As for the PWM table, this seems to be a TunerStudio issue. Earlier version worked fine but the latest version doesn't. I have found a workaround until Phil fixes the issue. Use the attache ini for the TinyIOx. It works here so I hope it works for you too.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Wergilius
Experienced MS/Extra'er
Posts: 162
Joined: Fri Sep 16, 2005 12:50 pm
Location: Stockholm, Sweden
Contact:

Re: TinyIOx: read LC1 digital data. Now with generic PWM

Post by Wergilius »

Thank you, i will check this but i'm sure it will work as expected.
Post Reply