www.gt4dc.co.uk
Maintain, Modify and DRIVE your GT-Four


It is currently Thu Apr 18, 2024 1:38 pm




Post new topic Reply to topic  [ 116 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next
Author Message
 Post subject: Re: Developing an ecu ?
PostPosted: Wed Jan 23, 2013 3:50 pm 
Offline
Group B
User avatar

Joined: Sat Sep 02, 2006 3:13 pm
Posts: 3679
Location: Bournemouth
Car Model: None
Postman's just been, it's Christmas again :)

Image

_________________
If at first you don't suck seed, try drier grain.

Image


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Wed Jan 23, 2013 10:34 pm 
Offline
Group B
User avatar

Joined: Sat Sep 02, 2006 3:13 pm
Posts: 3679
Location: Bournemouth
Car Model: None
Goddamn surface mount !!!!!!!!!!!!!!!! ^^^E£*&*(W^W&&W*"£*("(

Trying to nudge the little chip into position with a screwdriver. Anyone heard of tiddlywinks ?

_________________
If at first you don't suck seed, try drier grain.

Image


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Thu Jan 24, 2013 12:15 am 
Offline
Club Staff
User avatar

Joined: Wed Jul 13, 2005 12:14 am
Posts: 3265
Location: Camberley, Surrey
Car Model: ST205
Sounds like a break and a cup of tea is in order! :)

_________________
GT4DC Events Co-ordinator
1996 ST205 UK


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Thu Jan 24, 2013 12:50 am 
Offline
Group B
User avatar

Joined: Sat Sep 02, 2006 3:13 pm
Posts: 3679
Location: Bournemouth
Car Model: None
Image

Built as far as possible minus the bits I thought I had in stock but can't find.
The surface mount was a pain, especially the 6 pin one as it's only about 2mm x 3mm so difficult to get hold of and easy to move accidentally (or flick across the bench :lol: ) Maybe once I've built a few I'll get the hang of it.


I'll keep tabs on this post of errors / design changes to include for the next batch of boards.

Spotted before I even got the boards back:
Knock chip has no crystal / clock connected. Link Xin to PIC18 Xout & use external 10MHz clock.
Add programming header for dsPIC. (removed as unnecessary as chips only need programming once. Since discovered my standalone programmer won't handle this version)

Spotted on assembly:
IC4 out of line with rest of transistors in the row.
Add fixings in case I decide to make an achoring strip / heatsink. (I'm nervous about standing power transistors unsupported if there's vibration, though it's done in the standard ECU).
Add fixing for USB sub-board rather than relying on glue.
Look again at part No.s for the D connectors so I get 2 matched and WITH fixing screws. The RS catalogue is awful.
No input capacitor in IC6. / No decoupling capacitors on 12V rail. (not an issue yet)

Spotted on debugging.
Reset on dspic is tied to 5V via network, should be 3.5V. (happened when voltage for PIC18 changed to 5, didn't notice link to dspic)
Self protecting transistors limit at about 3A with 3.5V gate drive. Change injector drives to conventional logic level mosfet. STP60NF06L

Rather a lot of errors, including some real schoolboy ones. Symptom of working in short bursts in spare time.

_________________
If at first you don't suck seed, try drier grain.

Image


Last edited by Nibbles on Sat Jan 26, 2013 5:46 pm, edited 4 times in total.

Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Thu Jan 24, 2013 1:56 am 
Offline
Club Staff
User avatar

Joined: Thu Jul 14, 2005 12:44 pm
Posts: 4067
Location: drinking devil fuel
Car Model: ST205
You running Clint's car on it yet?? :lol:


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Fri Jan 25, 2013 6:40 pm 
Offline
Group B
User avatar

Joined: Sat Sep 02, 2006 3:13 pm
Posts: 3679
Location: Bournemouth
Car Model: None
So far so good :)

Image

programming header spliced in so I can program the dspic with the pickit programmer. (Only need to this this on one as I can program the chips for others in this board).

Command line compiler purchased. $250 ouch. This translates the source code in 'C' to the machine code run by the chip.

Noddy program written (along the lines of 10 print "hello world", 20 goto 10 :lol: ). In this case set the pins to input & output correctly, then invert the INJ4 line each time round the loop with a delay in between.

Result above.

For those interested, the source code used:

Quote:
#device dspic33FJ128GP802
#FUSES NOPROTECT,NOIESO,PR_PLL,NOOSCIO,HS,WDT,WINDIS,ALTI2C

typedef int16 word; // word is unsigned int
typedef int16 uword; // uword is unsigned int
typedef signed int16 sword; // sword is signed int
typedef char uchar; // uchar is unsigned char
typedef signed int8 schar; // schar is signed char

//ports
#word TRISA = 0x02C0
#word PORTA = 0x02C2
#word LATA = 0x02C4
#word ODCA = 0x02C6
#word TRISB = 0x02C8
#word PORTB = 0x02CA
#word LATB = 0x02CC
#word ODCB = 0x02CE

void main(void)
{
uword itmp;

// powerup / reset initialisation
PORTA = 0;
PORTB = 0;
// main loop
while (1)
{
// each loop initialisation
#asm
CLRWDT
#endasm
TRISA = 0xFFEF; // set i/o pins
ODCA = 0;
TRISB = 0x2477;
ODCB = 0x0060;
//
PORTB ^= 0x0200;
for (itmp = 0;itmp < 10000;itmp++);
};

The output code produced by the compiler (in readable form)
Quote:
.................... void main(void)
.................... {
*
00200: BSET.B 81.7
00202: SETM 32C
00204: MOV #3F80,W15
00206: MOV #3FFF,W0
00208: MOV W0,20
0020A: NOP
0020C: MOV #3F80,W15
0020E: MOV #3FFF,W0
00210: MOV W0,20
00212: NOP
.................... uword itmp;
....................
.................... // powerup / reset initialisation
.................... PORTA = 0;
00214: CLR 2C2
.................... PORTB = 0;
00216: CLR 2CA
.................... // main loop
.................... while (1)
.................... {
.................... // each loop initialisation
.................... #asm
.................... CLRWDT
00218: CLRWDT
.................... #endasm
.................... TRISA = 0xFFEF; // set i/o pins
0021A: MOV #FFEF,W4
0021C: MOV W4,2C0
.................... ODCA = 0;
0021E: CLR 2C6
.................... TRISB = 0x2477;
00220: MOV #2477,W4
00222: MOV W4,2C8
.................... ODCB = 0x0060;
00224: MOV #60,W4
00226: MOV W4,2CE
.................... //
.................... PORTB ^= 0x0200;
00228: BTG.B 2CB.1
.................... for (itmp = 0;itmp < 10000;itmp++);
0022A: CLR 802
0022C: MOV 802,W4
0022E: MOV #2710,W3
00230: CP W3,W4
00232: BRA LE,23A
00234: INC 0802
00236: GOTO 22C
.................... };
0023A: GOTO 218
.................... }
0023E: PWRSAV #0

_________________
If at first you don't suck seed, try drier grain.

Image


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Fri Jan 25, 2013 7:50 pm 
Offline
Club Staff
User avatar

Joined: Thu Jul 14, 2005 12:44 pm
Posts: 4067
Location: drinking devil fuel
Car Model: ST205
It's compiler specific but ports should probably be declared volatile :lol:

Mind, for 250 I'd expect the compiler to write the flippin code for me. Even MS visual studio is free these days


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Fri Jan 25, 2013 8:06 pm 
Offline
Group B
User avatar

Joined: Sat Sep 02, 2006 3:13 pm
Posts: 3679
Location: Bournemouth
Car Model: None
The microchip compiler is free if you don't want the optimiser. With the optimiser it's free for 60 days then it's $900 Hence I use the CCS one.

_________________
If at first you don't suck seed, try drier grain.

Image


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Fri Jan 25, 2013 8:33 pm 
Offline
Club Staff
User avatar

Joined: Thu Jul 14, 2005 12:44 pm
Posts: 4067
Location: drinking devil fuel
Car Model: ST205
:shock: Its-how-much :shock:


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Fri Jan 25, 2013 8:45 pm 
Offline
Group B
User avatar

Joined: Sat Sep 02, 2006 3:13 pm
Posts: 3679
Location: Bournemouth
Car Model: None
At least they offer you a choice, pay it and get nice efficient code, or spend the money on faster chips with more memory (the microsoft way :lol: ).

Back in the day, my cheap nasty compiler for the 68hc11 was £1500. (and it WAS nasty) Thankfully the customer paid for it.

_________________
If at first you don't suck seed, try drier grain.

Image


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Sat Jan 26, 2013 8:05 pm 
Offline
New Poster

Joined: Wed May 27, 2009 5:02 pm
Posts: 40
Car Model: None
nice work, btw what happenet with that project from some guy on mr2oc a long time ago that was supose to get oem toyota ecus to be programable.. if anybody knows... he got in some problems dealing with calls in call in asembler code of stock ecu or something like that and gave up... ??


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Mon Jan 28, 2013 6:39 pm 
Offline
Junior WRC

Joined: Fri Jan 29, 2010 10:39 pm
Posts: 514
Location: Bournemouth
Car Model: ST205
rio wrote:
nice work, btw what happenet with that project from some guy on mr2oc a long time ago that was supose to get oem toyota ecus to be programable.. if anybody knows... he got in some problems dealing with calls in call in asembler code of stock ecu or something like that and gave up... ??


http://www.twobrutal.co.uk/forum/showth ... bly/page40

need to register though

also, take a look here >> https://www.assembla.com/spaces/3SGTE_E ... ifications

_________________
St205 WRC - Running sweet.


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Mon Jan 28, 2013 7:25 pm 
Offline
Club Staff
User avatar

Joined: Thu Jul 14, 2005 12:44 pm
Posts: 4067
Location: drinking devil fuel
Car Model: ST205
I offered to try and help the MR2OC guy but he just completely ignored me
Not even a sod off :(


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Mon Jan 28, 2013 7:58 pm 
Offline
Junior WRC
User avatar

Joined: Sun Sep 24, 2006 7:19 pm
Posts: 563
Location: Basingstoke
Car Model: ST185
two_OH_five wrote:
I offered to try and help the MR2OC guy but he just completely ignored me
Not even a sod off :(


How bloody rude is that ? :lol:

_________________
2004 Subaru WRX


Top
 Profile  
 
 Post subject: Re: Developing an ecu ?
PostPosted: Mon Jan 28, 2013 10:24 pm 
Offline
Junior WRC

Joined: Fri Jan 29, 2010 10:39 pm
Posts: 514
Location: Bournemouth
Car Model: ST205
I have a spare ICD 3 you can borrow, should work for the dspic...

_________________
St205 WRC - Running sweet.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 116 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8  Next


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group