Personal tools
User menu

Difference between revisions of "Porsche 928 LH Replacement Prototype"

From Francois Louw

Jump to: navigation, search
m (EZK Load Signal 9 April 2013)
Line 355: Line 355:
 
Here is a screenshot of the new tab in the Interface Software  
 
Here is a screenshot of the new tab in the Interface Software  
  
[[File:ECU-EZK.jpg|left|500px]]
+
[[File:ECU-EZK.jpg|500px]]
  
 
This table effectively allows the user to tune the EZK timing advance. The EZK can be programmed for different timing advances for different input signals. This allows exact tuning of the EZK timing advance.
 
This table effectively allows the user to tune the EZK timing advance. The EZK can be programmed for different timing advances for different input signals. This allows exact tuning of the EZK timing advance.
  
 
An extra field was also added to the Real Time Data tab to show the EZK load signal being sent at the moment.
 
An extra field was also added to the Real Time Data tab to show the EZK load signal being sent at the moment.
 +
 +
==New USB (LibUSB-win32)==
 +
 +
Ok, so far I have used serial emulation to communicate between the PC and the ECU. Not a very elegant solution, but its quick and easy to implement. Downsides was that the user needed to select the correct serial port before being able to connect. After connecting initially there was no problem and the user could forget about reconnecting. Well now there is the proper solution. The device now uses the LibUSB generic USB interface.
 +
 +
I had to rewrite the code on the ECU to use the new Microchip USB stack and I used the libUSB-win32 port. Most of the time the port is implemented using static libraries, and compiled into the Windows Interface software but I prefer to use dynamic linking. By using dynamic linking I don't have to worry about any problems integrating it into Qt.
 +
 +
New USB drivers are required when the new firmware is executed, as Windows detects a new device. After the new drivers are installed your Device Manager should have an entry like this:
 +
 +
[[File:ECUNewDeviceManager.jpg]]
 +
 +
With the new USB interface I don't have to rely on the slightly unstable Qt serial library. The coding required a complete rewrite of the Qt Interface software because the LibUSB implementation that I use is synchronous communication, requiring the Interface software to send a "Request for Data" instruction before reading the data. The Firmware required little change, seeing that on both instances I just empty the buffers that I use. On the firmware side I have 2KB buffer for receiving and another 2KB buffer for sending. That should be more than enough for any delays in data that can occur on the USB line. The windows interface uses 4KB buffers because the way that Qt works there is more delays in the Interface software than in the Firmware.
 +
 +
Difference in operation now is that in the Interface software you don't need to select "Connect" anymore, and all detecting and communication happens automatically. when you switch on the ignition then the Interface software will detect and connect to the ECU.
 +
 +
The USB code in the Interface software is also threaded to allow for smooth communication.
 +
 +
Another change that was made was the status message box. I changed it to fix an annoying memory leak (shame on me for it being there in the first place).
 +
 +
On to more testing!

Revision as of 20:22, 22 April 2013