{"id":318,"date":"2013-04-09T10:29:24","date_gmt":"2013-04-09T10:29:24","guid":{"rendered":"http:\/\/blog.daft-ideas.co.uk\/?p=318"},"modified":"2013-04-09T10:37:14","modified_gmt":"2013-04-09T10:37:14","slug":"ecu-project-entry-the-first","status":"publish","type":"post","link":"https:\/\/blog.daft-ideas.co.uk\/2013\/04\/09\/ecu-project-entry-the-first\/","title":{"rendered":"ECU Project- Entry the First"},"content":{"rendered":"
Worthy of note, is that this is -not- the first effort I’ve made in this field.<\/p>\n
In short, the reason behind this project is that I have an MGB GT; after the second B-series engine gave up the ghost (they don’t really seem to like 20,000 motorway miles and 12,000 ‘other’ miles a year), I got fed up- and the car sat languishing in the garage for 6 months.<\/p>\n
So, my birthday rolled around- and my mother made me a little purchase…<\/p>\n
<\/a><\/p>\n As it turns out, this gave me some bad ideas. As there are several people in my group of friends and acquaintances- not least of which, my father- who are very much into the Ford Capri, I’d heard of a little engine swap that can be performed relatively simply, into that vehicle- the Cosworth 24v V6.<\/p>\n The block length of which would just about fit. As would the gearbox- assuming I’d switch the auto ‘box that comes bolted to the engine, with an MT75 5-speed manual. Naturally, I prefer the sound of\u00a0carburetors\u00a0 and this is as standard a fuel-injected, ECU-controlled engine…<\/p>\n A solution was needed; off-the shelf solutions, as usual, too expensive… this is my first step along the route to achieving it.<\/p>\n The purchase of an FPGA (Field Programmable Gate Array) is my first step along the line- inspired by an interview with a gentleman who suggested that experience using them would aid my future employment prospects.<\/p>\n It’s a nice little device, and very clever- anyone familiar with logic circuitry will understand the basic concepts- AND, NOT and OR gates arranged in specific ways to achieve outputs that are desired.<\/p>\n The software we were using (Quartus II) also incorporates megafunctions- effectively, complex logic-based designs in premade ‘blocks’.<\/p>\n <\/a><\/p>\n Pictured above is an (admittedly, relatively complex) LED flasher. Connected to the ‘input’ on the left of the image is one of the internal clock pins on the FPGA- more on this later- and the other is connected to an included LED.<\/p>\n Now, to start with, I had no real idea what to expect- and other than making sure that the board was properly functional, did nothing, until I had a little backup; enter Iain, stage right, for “beer and a curry, honest”.<\/p>\n Further, we were not able to confirm the clock frequency of pin on the FPGA I was using. They appear to be variable, and my board turns out to have a few idiosyncrasies (including relatively poor user manuals). So, having read somewhere that it was either 12, 24, or 48 Mhz, for my trial design we set up a little counter-comparator pair- counting clock pulses, at 6000, turn LED on, at 12,000, reset the counter.<\/p>\n <\/a><\/p>\n Pin association is given in the above image- pin 66 is one of the onboard clock sources, and pin 35 is the pin for the LED output on my board.<\/p>\n And… it worked! the LED flashed at a steady rate of on for half-second, off for half-second. Telling me that the frequency of the CLK source that we used was 12Mhz.<\/p>\n Some issues we ran into- when assigning the values for the constant values, I mistyped on no less than 3 occasions (easy to do, when you’re typing out a 32-bit binary number), omitting a digit, or duplicating another. This took a\u00a0surprising\u00a0length of time to rectify (when you’re not sure your design is going to work, it’s often easy to overlook something obvious). Also, we had a little fun with having to re-design the circuit at various points- the LPM_compare function required a 32 bit number to ‘compare’, up to that point everything had been working on 25 to save space… back to the drawing board!<\/p>\n End of Step One.<\/p>\n","protected":false},"excerpt":{"rendered":" Worthy of note, is that this is -not- the first effort I’ve made in this field. In short, the reason behind this project is that I have an MGB GT; after the second B-series engine gave up the ghost (they don’t really seem to like 20,000 motorway miles and 12,000… Continue reading