Virtual IO and port selections

http://jbperf.com/io_extender/index.html
http://jbperf.com/io_extender/tinyIOx.html for the TinyIOx

Virtual IO and port selections

Postby a91what » Sun Aug 12, 2018 8:16 pm

This is something i have been reading on for what seems like months but cant find any good information on. I cannot for the life of me find information about i/o ports and how they are selected when trying to build an programmable output.

This is what i have, DIYPNP with semi sequential injection and ignition mods/ tinyiox

currently using PAO to turn my fans on from the PNP

I have 2 pressure transducers wired up to the tiny as generic sensors for oil pressure and fuel pressure [not used currently]
I am using remote ports to fire outputs from the tiny to drive various relays ect..

I am adding AC back onto the car and want to use the AC idle up functions ect.. this part seems easy enough input to the tiny and use the selected remote input port simple.

My only hangup is how to trigger the cooling fan to come on with the AC..... standard output has 2 conditions currently they are [coolant >190 hyst 10] and [rpm >500] so the fan only runs when the car is running. I was thinking i could just use an output from the tiny to trigger the fans to come on under 3 conditions, the two above and the input from the ac switch... this is where i am stuck, I dont know what ports relate to the physical input pins.

If someone could school me on that i would be very grateful.

other questions i have and cant find info on
-how does one use the virtual io??
-how do you use the virtual io in an output?
a91what
 
Posts: 8
Joined: Sun Aug 12, 2018 7:12 pm

Re: Virtual IO and port selections

Postby jbelanger » Sun Aug 12, 2018 9:11 pm

The virtual I/Os are similar to what is called loops on the MS3 (if that's something you've seen before). You can use them wherever you would use a CPU pin as either a digital input or a digital output. That means you can use them in the ports settings and in the programmable on/off outputs.

The first way to use it is to set one as an on/off output and then use the same one as the condition for another output (real pin or another virtual I/O). You can also use the same virtual I/O output as an input in the ports settings to be used on the MS through CAN. You can use one of the ports channel (coming from the MS over CAN) as an output virtual I/O and use it as a condition for an on/off output (again real pin or another virtual I/O). Finally, you can use a virtual I/O as an input on one port and and output on a second port to loop data from and to the MS over CAN (although I'm not sure that this has any real useful application). And you can mix and match all of these to create some relatively complex sequences and use the same virtual I/O for multiple things as long as there's only one place where is can be updated.

As for your main question, I don't see where you mention where the AC switch is connected. Or do you mean you're using PA0? If so, you need to use portam AND 1 hyst 1.

Jean
Image
jbelanger
 
Posts: 3633
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada

Re: Virtual IO and port selections

Postby a91what » Sun Aug 12, 2018 10:49 pm

Yes i figured that part out finally after looking through the manual one more time. Now I have learned something very useful about the status and port bitwise operations. :D


Now i plan to use an input pin on the tiny [ lets use ADC3 as an example ] as a remote port input to trigger AC idle up. How can i link this pin to a virtual IO? would i just use AD3 as the field with a threshold of 1?

My idea is to build a virtual IO with the coolant temp, rpm, and input port as triggers then use this virtual io in the status field for PA0

Lastly what field will i use in the programmable outputs to link this virtual io as a field that PA0 looks at for activation?


maybe i am over complicating things, i just want the fan to turn on with my current settings and when the AC is triggered.


EDIT: I think the easiest thing to do would be to take this virtual IO and use it in an output from the tiny to trigger the fan rather than figure out how to reference it from the MS PA0 output.
one jumper in the case and this would be done and free up PA0 for something else.. looks like the MS cant see the ports in the tiny from the programmable fields.
a91what
 
Posts: 8
Joined: Sun Aug 12, 2018 7:12 pm

Re: Virtual IO and port selections

Postby jbelanger » Mon Aug 13, 2018 12:13 am

PA0 on the MS can only represent the state of the physical pin PA0. You cannot change the state from an external source on the CAN bus. So if you don't want to use the actual pin, you cannot keep the same settings.

As you say, you can use a pin on the TIOx that is triggered from other variables in the programmable outputs. You will then likely not even need to use a virtual I/O since you can simply use the actual pin you want to use. Unless you need more than 3 conditions in which case you will need to use a virtual I/O and 2 programmable outputs.

Jean
Image
jbelanger
 
Posts: 3633
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada

Re: Virtual IO and port selections

Postby a91what » Mon Aug 13, 2018 7:56 am

[quote="a91what"]Yes i figured that part out finally after looking through the manual one more time. Now I have learned something very useful about the status and port bitwise operations. :D


Now i plan to use an input pin on the tiny [ lets use ADC3 as an example ] as a remote port input to trigger AC idle up. How can i link this pin to a virtual IO? would i just use AD3 as the field with a threshold of 1?
In the MS if i use AD6 as an digital input i can use a number like 600 in the threshold that shows it is triggered, I assume the AD3 input on the tiny would work the same? [ I can do some actual testing when i get back into town just want affirmation ]

Lastly what field will i use in the programmable outputs to link this virtual io as a field that PA0 looks at for activation?

for example PA0 can be linked by using portam threshold of 1 hysteresis 1 [ this may not be possible based on your response above ]


Thanks!
a91what
 
Posts: 8
Joined: Sun Aug 12, 2018 7:12 pm

Re: Virtual IO and port selections

Postby jbelanger » Mon Aug 13, 2018 12:43 pm

Ok, I'm a bit confused over what exactly you want to do and where everything is connected and I'm also creating some confusion from this. So please clearly tell me where everything is connected and which conditions you need to activate what. Don't worry about virtual IOs at this point but just spell out the physical inputs, outputs and the conditions.

Jean
Image
jbelanger
 
Posts: 3633
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada

Re: Virtual IO and port selections

Postby a91what » Mon Aug 13, 2018 12:55 pm

PA0 currently controls the fan from the main board

I am going to use a digital input on the tiny for the AC idle up, going to use AD3 through a high side relay [input from the ac switch is 12v in the stock wiring]

i want the fan to come on under the normal criteria i currently have programmed AND anytime the AC is running. I am attempting to program the input for the AC to trigger the output pin

This is the first time i have attempted to use the bitwise criteria so i apologize for my lack of understanding...
a91what
 
Posts: 8
Joined: Sun Aug 12, 2018 7:12 pm

Re: Virtual IO and port selections

Postby jbelanger » Mon Aug 13, 2018 1:52 pm

It's not your lack of understanding it's mine that was causing the confusion.

First, make sure you condition your 5V digital input on AD3 with at least a 1k resistor and a 0.1uF cap.

Now let's go through everything one by one. For the AC you'll need to use one channel on an input port; let's use channel 1 on port 3 since that's one channel that's available on the MS for AC idle up.

Then you will need to enable one of the programmable on/off output and enter your conditions. To use AD3 that you want for AC idle up, you will need to use port3 AND 1 hysteresis 1; this will select channel 1 on port 3 that you assigned before. You will then need to assign this programmable output to Virtual I/O 1. To transfer that to the MS you will need to assign this virtual port to a port channel so you can set channel 2 of port 3 to virtual I/O 1.

Now on the MS side, you will need to enable ports polling in the CAN parameters. The TinyIOx use different settings from the default so use CAN ID 4, table 7 and offset 45; you can leave it as 3 inputs. The set the AC idle up to use remote port 3 bit 0 (that's channel 1 because the numbering starts from 0 here and 1 on the TIOx).

Then for activating PA0, you simply need to set one condition. You need to use gpioport2 (again confusing numbering because it starts from 0 here and from 1 on the TIOx so port 3 is gpioport2) and use the bitwise condition And with threshold 2 and hysteresis 2 to use channel 2 (by the way channel 3,4,5,6,7,8 would use threshold and hysteresis 4,8,16,32,64,128). So this will activate PA0 when your condition on the TIOx is met.

I hope that is clear enough. If not, let me know and you may want to post your project (make a project backup because it contains the msq for both the MS and the TIOx).

Jean
Image
jbelanger
 
Posts: 3633
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada

Re: Virtual IO and port selections

Postby a91what » Mon Aug 13, 2018 2:23 pm

That was very clear and now it makes alot more sense to me. This opens up alot of options I did not have previously!

I can omit the extra buffer circuit [resistor and cap] if i use the mainboard 12v input circuit [nitrous input] correct?

Thanks!
a91what
 
Posts: 8
Joined: Sun Aug 12, 2018 7:12 pm

Re: Virtual IO and port selections

Postby jbelanger » Mon Aug 13, 2018 2:37 pm

I'm sorry but I don't know what's on the main DIYPnP board; there are no public schematics and I've never had one in my hands. If it does already have some sort of filtering then that's fine.

Jean
Image
jbelanger
 
Posts: 3633
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada

Re: Virtual IO and port selections

Postby a91what » Thu Aug 23, 2018 11:33 am

I tested this on the work bench and have a few questions.

The fan circuit does in fact come on when i energize the 12v input circuit with 5-12v, however to make it function i had to use port3 thres 1 hyst 0 ; i assume this means that it is activating when the AD3 input goes off.

I think i figured out why this is happening, the nitrous input or misc 12v input, outputs 5v when there is no signal and goes to 0v when 5-12v is applied to the IN pin. ; AD3 is active all the time and goes off when i turn on the AC switch. i can see this in the outputs page, port 3 goes from 1 to 2 when i apply 12v to the input circuit.

now i dont see the AC idle up input coming on with the input on or off, i see no change in the AD3 input when watching it in the outputs window but i do see the virtual io change that is watching port3-1. now i could just make another virtual io that will trigger on port3-1 and assign it to port3 - 3 and assign the AC idle up on GPIO2 - 2 to make this work how i want.

Did i wire something incorrectly? I feel as though something is missing, i will link the page.

Nitrous Input: This is actually a multipurpose 12 volt input. The output of this circuit is 0 volts when a 5 to 12 volt signal is applied to the In pin and 5 volts when the In pin is not connected.

Nitrous / +12V input: R37, R38, Q14

https://www.diyautotune.com/support/tec ... -assembly/
a91what
 
Posts: 8
Joined: Sun Aug 12, 2018 7:12 pm

Re: Virtual IO and port selections

Postby jbelanger » Sun Aug 26, 2018 2:40 pm

Please post the current msqs and a short log of when you do your input tests. It is very difficult to know what is happening with just a text description. And make sure that the datalog has the data from the MS and TIOx.

Jean
Image
jbelanger
 
Posts: 3633
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada

Re: Virtual IO and port selections

Postby a91what » Thu Sep 06, 2018 12:57 pm

Just wanted to update that i now have this working correctly, I had to build a different 12v input circuit using the ms2 docs, something told me trying to shortcut the solution was going to be a headache.

Thanks
a91what
 
Posts: 8
Joined: Sun Aug 12, 2018 7:12 pm


Return to I/O Extender

Who is online

Users browsing this forum: No registered users and 4 guests

cron