Fraidy Cat Racing

1994 Jaguar XJ12


You are not connected. Please login or register

Megasquirt

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Megasquirt on Mon Jan 04, 2016 10:31 pm

What we have:

Microsquirt Module http://www.microsquirtmodule.com/
Perfect for your 4 cylinder stand alone conversion, not exactly the ideal starting place for a V12.

Innovate LC2 wideband 02 sensor
It should do an adequate job of sensing oxygens

PIC12F675 micro controller
Does things

The plan:

Ignition:
We will be using the factory EDIS modules and crank sensors from the Fluffy2 for the ignition
the MS has no problem controlling one of the while the other will be controlled by a SAW delay module
some EDIS information can be found here

Fuel:
The injectors used on the jag are low impedance, which creates a few challenges when you are trying to control 12 of them
We could buy three of these for $174 or we could build some for about $70 less
At some later time we could look into sequential injection using more delay modules

What we need:
TBD

SAW delay code
Code:
title 'Jaguar SAW delay'
 List P=PIC12F675
 Radix HEX
 Include p12F675.inc
;
 __config_PWRTE_ON &_WDT_OFF &_INTRC_OSC_NOCLKOUT &_CP_OFF &_MCLRE_ON
;
;******************   PIN equates   ********************************
;
SAW_In EQU 1 ;
PIP_In EQU 2 ;
SAW_Out EQU 4 ;
;
;******************   End PIN equates   ****************************
;
;******************   Memory equates   *****************************
;
Flag1 EQU 0x20 ;used for flags
Temp1 EQU 0x21 ;
Temp2 EQU 0x22 ;
Temp3 EQU 0x23 ;

Counter EQU 0x28 ;

;
;******************   End Memory equates   *************************
;

#define SAW_Out_Hi bsf GPIO,SAW_Out;
#define SAW_Out_Lo bcf GPIO,SAW_Out;
;
#define Bank0 bcf Status,RP0
#define Bank1 bsf Status,RP0
;
;******************   MACROS   *************************************
;
 org 0
 goto Intitial
;
;******************   Initialisation   *****************************
;
Initial clrf PCLATH
;
 clrf GPIO ;Clear latches
;
 Bank1
;
 movlw b'10001110' ;no pull,fall edge,int;
 movwf OPTION_REG ;clk,lo-hi,wdtr, 1:64 (26)
;
 movlw b'00001110' ;Set GPIO
 movwf TRISIO
;
 movlw b'00000000' ;no a/d (42)
 movwf ANSEL
;
 movlw b'00000000' ;not used (38)
 movwf VRCON
;
 Bank0
;
 movlw b'00000000' ;
 movwf ADCON0 ;(41)
;
 movlw b'00000111' ;not used
 movwf CMCON ;comparator module (33)
;
 clrf T1CON ;timer 1
;
;******************   Clear RAM Bank0   ****************************
;
 movlw 0x20 ;start of RAM
 movfw FSR
Next clrf INDF ;clear addressed reg
 lncf FSR,F
 btfss FSR,6
 goto Next ;64 reg's
 clrf FSR
;
 clrf INTCON ;(13)
 clrf PIR1 ;(14) int flags

 SAW_Out_Hi
;
;******************   End Initialisation   *************************
;
;
;
;******************   Main   ***************************************
;
;Main program loop
;
Main
 bcf T1CON,0 ;t1 off
 bcf PIR1,0 ;ti overflow flag
 clrf TMR1L
 clrf TMR1H
;
 btfsc GPIO,SAW_In ;wait for low
 goto $-1
 btfss GPIO,SAW_In ;low now, wait for hi
 goto $-1
;
 bsf T1CON,0 ;t1 on
 btfsc GPIO,SAW_In ;wait for low, count pulses
 goto $-1
 bcf T1CON,0 ;t1 off

;
 btfsc GPIO,PIP_In ;wait for falling edge
 goto $-1
;
 ; 150us delay
 comf TMR1L,F ;complement results
 comf TMR1H,F ;& keep in register
 bsf T1CON,0 ;T1 on
 goto $+1 ; compensate for call,return
 goto $+1
 nop
 bcf T1CON,0 ;t1 off

 movlw d'45'
 call Dl_Cycle
;
 SAW_Out_Lo ;output delayed pulses

 bsf T1CON,0 ;t1 on
 btfss PIR1,0 ;t1 overflow?
 goto $-1 ;no
 SAW_Out_Hi ;pulse send out
;
 goto Main
;
;
;******************   Dl_Cycle   ***********************************
;
Dl_Cycle movwf Temp1
 decfsz Temp1,F
 goto $-1
;
 return
;
;******************   End Dl_Cycle   *******************************
;
;
 END

View user profile

2 Re: Megasquirt on Tue Jan 05, 2016 10:11 am

I don't recognize the code, but the program looks pretty basic and what I'd expect. It sets its inputs and outputs, counts pulses, saves them in memory and then waits for the falling edge of a high signal to call them out of memory.

I'll shop it around.

View user profile

3 Re: Megasquirt on Wed Jan 06, 2016 3:06 pm

By searching some of lines of code I found this website: http://www.microchip.com/ It may be the chip and resulting code this thing was written for.

View user profile

4 Re: Megasquirt on Wed Jan 06, 2016 7:33 pm

they made the chip and they have a compiler, however the compiler is not happy with the code that we have.

View user profile

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum