Programming/hardware question

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

Post Reply
seishuku
Experienced MS/Extra'er
Posts: 209
Joined: Tue Dec 01, 2009 5:38 pm
Location: Wisconsin, USA

Programming/hardware question

Post by seishuku »

I need 3 general outputs for something I'm working on, I already have js11, iac1, and iac2 tied up... now there are ad6 and ad7 but the code says they "can't be spark e/f", is that just the code that wont use them, or is it the hardware?
I have completely read the I/O section of the programmers manual, I was hoping to get a faster answer here.
jsmcortina
Site Admin
Posts: 39614
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Programming/hardware question

Post by jsmcortina »

seishuku wrote:I need 3 general outputs for something I'm working on, I already have js11, iac1, and iac2 tied up... now there are ad6 and ad7 but the code says they "can't be spark e/f", is that just the code that wont use them, or is it the hardware?
I have completely read the I/O section of the programmers manual, I was hoping to get a faster answer here.
Where does it say "can't be spark e/f" ?
Which programmers manual?

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
seishuku
Experienced MS/Extra'er
Posts: 209
Joined: Tue Dec 01, 2009 5:38 pm
Location: Wisconsin, USA

Re: Programming/hardware question

Post by seishuku »

Oh, sorry.... the manual for the micro controller (m9s12c64), I recall the comment is in the misc c source where it sets up all the pins (I'm on my phone, so I couldn't say where exactly).

Or am I being dumb and it says that they can be spark e/f? I'm kinda doubting myself now. :lol:
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: Programming/hardware question

Post by racingmini_mtl »

I don't know what you saw but have a look at this: http://www.msextra.com/doc/ms2extra/MS2 ... ms2options.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Programming/hardware question

Post by dontz125 »

ADC6 & 7 are in fact usable as sparks E & F, but only on the MS2. The uS and uSM have filter components that (I think) would interfere with the timing of spark pulses.

This ability to act as spark outputs is why I've started muttering that perhaps these pins should be made programmable outputs, as well! :D
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
seishuku
Experienced MS/Extra'er
Posts: 209
Joined: Tue Dec 01, 2009 5:38 pm
Location: Wisconsin, USA

Re: Programming/hardware question

Post by seishuku »

Ok, that's what I was looking for, and yeah if that's the case, they should be allowed as MS conditional outputs (as per "programmable I/O").
Though that's not exactly why I need them, I need them for my own code to "steal", for my own devices.

And above when I said "I have completely read the I/O section of the programmers manual...", I meant "haven't"... Stupid phone.

What I was mainly wondering if those ADC pins can indeed be GPIO as well, as most microcontrollers allow pins like that to be a peripheral (in this case an ADC), or I/O with pull-ups/pull-downs, etc.

Now that I've looked through the source again, I can't find that comment... I thought it was in ms2_extra_init.c where it's setting the pins, but looking through it again I do see it says AD6/AD7 can be spark 5/6, so I must have mis-read it.
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Programming/hardware question

Post by dontz125 »

seishuku wrote:Though that's not exactly why I need them, I need them for my own code to "steal", for my own devices.
Yeah, about that - you do realize, the MS firmware and source code is a copyrighted commercial IP? Announcing your intent to misappropriate that IP in a forum paid for and administered by the copyright holders is pretty d*** arrogant, and bloody rude besides.
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
seishuku
Experienced MS/Extra'er
Posts: 209
Joined: Tue Dec 01, 2009 5:38 pm
Location: Wisconsin, USA

Re: Programming/hardware question

Post by seishuku »

Huh? I'm not doing anything with their IP, I'm adding my own code on top of MSExtra (that's what the user code C source is for, right???)
I meant "stealing" as in I'm stealing the IO pin away from the MS control code, not as in physically stealing something. That's why I put it in "quotes".

Besides that, I own a genuine B&G v2.2 board, as well as an MS1 processor AND an MS2 daughterboard.
jsmcortina
Site Admin
Posts: 39614
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Programming/hardware question

Post by jsmcortina »

Yes, the ADC pins can be configured as digital inputs of outputs.
e.g.

Code: Select all

DDRAD |= 0x40; // enable pin AD06 as digital output
then PTAD is used for the output itself.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
seishuku
Experienced MS/Extra'er
Posts: 209
Joined: Tue Dec 01, 2009 5:38 pm
Location: Wisconsin, USA

Re: Programming/hardware question

Post by seishuku »

Awesome, looks like it works exactly like my MSP430 microcontroller then...
Thanks!
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Programming/hardware question

Post by dontz125 »

Seishuku - I withdraw my comments, and will sit back down and drink my coffee. I would ask that you re-read the bit I quoted in my post, and decide for yourself if my reaction was unreasonable.

James - any chance of that making its way into the standard code, for those without compilers?
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
seishuku
Experienced MS/Extra'er
Posts: 209
Joined: Tue Dec 01, 2009 5:38 pm
Location: Wisconsin, USA

Re: Programming/hardware question

Post by seishuku »

dontz125 wrote:Seishuku - I withdraw my comments, and will sit back down and drink my coffee. I would ask that you re-read the bit I quoted in my post, and decide for yourself if my reaction was unreasonable.
Just a misunderstanding.

When I said "that's not exactly why I need them" was referring to not needing the pins as conditional outputs as per the MegaSquirt control (ie. if RPM > 5000 then output1 "on"), I need the I/O pins for my own code for direct interface to my own devices. My code is going to steal control (control of the pins) away from the main MegaSquirt control program.

Just FYI, copyright/IP infringement, as far as I understand it, is only illegal if I'm redistributing it for profit and claiming it as my own (or cloning it and passing it off as real, etc, etc)... What I'm doing is for my own project, and is for my configuration, it's not intended for anyone else.

I can share what I'm working on, if anyone is interested, I don't mind sharing mods, but the chances are no one will really be that interested. :lol: (assuming it works in the first place!)
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: Programming/hardware question

Post by racingmini_mtl »

seishuku wrote:Just FYI, copyright/IP infringement, as far as I understand it, is only illegal if I'm redistributing it for profit and claiming it as my own (or cloning it and passing it off as real, etc, etc)... What I'm doing is for my own project, and is for my configuration, it's not intended for anyone else.
That's not what the license says. Please read the text file included in the source directory. I'm not saying you can't do what you want here but you still need to know what is in the license and respect it.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
seishuku
Experienced MS/Extra'er
Posts: 209
Joined: Tue Dec 01, 2009 5:38 pm
Location: Wisconsin, USA

Re: Programming/hardware question

Post by seishuku »

Well that was a little easier than I thought...
https://www.youtube.com/watch?v=BdG7Q3NL6Ss

And before anyone says "why not just use a CAN based display?"
Well, that's because I don't have any, I already have this display and I'm cheap... :lol:

I have it set up so I can change the displayed value is RPM, MAP, MAT, CLT, AFR (shown), BAT, or ignition advance.

Originally I intended to use the display with my MSP430 LaunchPad and interface it directly to my Innovate LC1 (no analog loss), but this is the next best thing and less extra devices.
mazdaspeed
Helpful MS/Extra'er
Posts: 142
Joined: Thu Oct 18, 2012 6:20 pm

Re: Programming/hardware question

Post by mazdaspeed »

So is it looking likely to have these as cofig i/o in a future release????
Post Reply