Tiny IOx setup question

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

Tiny IOx setup question

Postby mill383 » Mon Oct 27, 2014 10:33 pm

Jean,

I've been successfully using TinyIOx to read 4 analog inputs assigned to AD0 thru AD3.
The next plan was to add 2 toggle switches (to control fuel and ignition table switching) and a spare push button. Was thinking of using AD4 thru AD6 for these. But am having trouble figuring out how to configure this in Tiny.

Under "Base I/O Settings" window, I enabled "Digital I/Os".
Under ADC Activation, only ADC Ch 1 thru 4 are active.
Under Port Settings, I arbitrary selected Port 1 as Input, then assigned Ch1 as AD4, Ch2 as AD5, Ch3 as AD6. All other port channels are Unassigned.

When I cycle power, I get a config error.

I noticed under ADC Settings, the 9 ADC Channels are pre-configured as AD0 thru AD9. So I'm guessing the problem is AD4, AD5, AD6 are both defined as analog and digital. Can I un-assign AD4-6 from being analog? I was assuming it would be disabled via ADC Activation screen?

Thanks,
Dave
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby jbelanger » Mon Oct 27, 2014 10:48 pm

mill383 wrote:I noticed under ADC Settings, the 9 ADC Channels are pre-configured as AD0 thru AD9. So I'm guessing the problem is AD4, AD5, AD6 are both defined as analog and digital. Can I un-assign AD4-6 from being analog? I was assuming it would be disabled via ADC Activation screen?

That's correct. In the ADC Activation screen, only set AD0 to AD3 active and leave the other ones disabled. That will leave the other ones available for other functions.You're also correct about the way to set the digital inputs.

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

Re: Tiny IOx setup question

Postby mill383 » Tue Oct 28, 2014 9:30 am

mill383 wrote: I arbitrary selected Port 1 as Input, then assigned Ch1 as AD4, Ch2 as AD5, Ch3 as AD6.


Jean, I was getting a config error. Do I have my direction backwards? Under Port Settings, should I have selected "Output" instead of "Input"? Because I am sending these discretes "out" on CAN via Port 1?

Dave
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby jbelanger » Tue Oct 28, 2014 10:53 am

No, the pins are inputs. Do you get an error message even after disabling the ADC channels? If so, please post an archive of you project (.tsproj file).

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

Re: Tiny IOx setup question

Postby mill383 » Tue Oct 28, 2014 5:33 pm

Jean,
Yes, I am still having the problem, even if I turn off ADCs.
Email sent with project archive.

Dave
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby jbelanger » Tue Oct 28, 2014 6:38 pm

Dave,

I see the issue and I need to check the code and test a few things. I'll get back to you when I have more details.

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

Re: Tiny IOx setup question

Postby mill383 » Tue Oct 28, 2014 6:45 pm

Sounds good.

Dave
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby jbelanger » Tue Oct 28, 2014 7:44 pm

There was indeed a bug that only showed up when you select an ADC pin for another function. Use the attached s19 file.

You will need to use the tinyioxdl_ms3.exe downloader and follow the instructions as per the instructions here: viewtopic.php?f=9&t=301. The instructions are for the IOx but simply use the correct s19 and downloader for the TinyIOx.

Jean
Attachments
tinyIOx.s19
TinyIOx firmware version 0.1.0D
(72.93 KiB) Downloaded 181 times
Image
jbelanger
 
Posts: 3633
Joined: Sat Oct 03, 2009 12:24 pm
Location: Quebec, Canada

Re: Tiny IOx setup question

Postby mill383 » Tue Oct 28, 2014 9:48 pm

Thanks Jean. I'll give it a try tomorrow and report back.

Dave
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby mill383 » Wed Oct 29, 2014 7:18 pm

Jean,

The fix seems to work, at least the config error is gone. I have some wiring to finish up to actually test the switch inputs.

When enabled as inputs, do the pins have a weak pull-up inside the processor? Or do I need to provide a pull-up resistor to 5V? I will be using these as switch to ground inputs.

Thanks for the quick fix!

Dave
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby jbelanger » Wed Oct 29, 2014 7:27 pm

There is a weak pull up when the pins are configured as inputs but if you connect the pins to something outside the case, you will need a protection circuit. The minimum would be a resistor and a couple of diodes (and maybe an additional pull up).

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

Re: Tiny IOx setup question

Postby mill383 » Wed Oct 29, 2014 7:56 pm

Roger that. Thanks Jean.
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby mill383 » Fri Oct 31, 2014 3:48 pm

Jean,

Update here...

Got the two toggle switches and push button wired up to Tiny, and assigned to Port 1 on the 3 lower bits. Next joy is to figure out how to get MS3 to read these. I was able to toggle a light on my dash (driven by Injector Out J) by using canin1_8. This is not ideal, as this is an 8-bit, bitpacked word, comprising of the 3 switches. What I really need is a separate boolean variable for each switch.

tiny3.JPG
tiny3.JPG (41.31 KiB) Viewed 8818 times


Where I really want to use this input is for table switching, but I can't find a variable in the pick-list that would work, unless I'm missing something.

tiny4.jpg
tiny4.jpg (28.09 KiB) Viewed 8818 times


I suppose this is a question for the MS3 forum, but thought I'd run it by you first.

Dave
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby jbelanger » Fri Oct 31, 2014 4:05 pm

CANIN1_8 is the packed 8-bit value and you can use the "AND" condition to test one bit. So you use '1', '2' or '4' as the threshold if you want test if bit 0, 1 or 2 is on or not.

And table switch input, you use CANIN1 for bit 0, CANIN2 for bit 1 and CANIN3 for bit 2.

Of course and I assume you already did so but you have to set the CAN Parameters so that the MS3 read the TinyIOx data over CAN. And you need to use the correct CAN ID and offset for the TinyIOx; the default is for the IOx. The TinyIOx CAN ID is 4 and the offset for the input port is 47 (the table number is the same as the IOx: 7).

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

Re: Tiny IOx setup question

Postby mill383 » Fri Oct 31, 2014 4:20 pm

47? I thought tiny.ini says port 1 was 45. I'll try 47.

Yes, bit masking with the AND feature. My bad.
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am

Re: Tiny IOx setup question

Postby jbelanger » Fri Oct 31, 2014 4:24 pm

Sorry, you're right that port 1 is 45. It is just that the MS3 normally uses port 1 and port 2 as outputs and port 3 as inputs. If you don't use all 3 ports, it doesn't matter much but you might want to keep things in the standard way.

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

Re: Tiny IOx setup question

Postby mill383 » Fri Oct 31, 2014 5:01 pm

Ok. got it working.

Apparently the MS3 doesn't run Table Switching logic when engine not running (I hate that for bench testing inputs!)

I powered up my bench test Opti-spark, (to fake out MS3) and now these two Tiny discrete switches do work and I can change between VE and Spark tables.

Thanks,
Dave
mill383
 
Posts: 27
Joined: Tue Aug 26, 2014 7:56 am


Return to I/O Extender

Who is online

Users browsing this forum: No registered users and 5 guests

cron