Archive for February 28th, 2009

Checking Memory and CPU Consumption on TS7390

Today I decided to place my new updated code on the ARM device and measure CPU and memory consumption.
I used the top command to investigate the consumptions. Running the program with continuous querying 3 sensors and updating them on the GUI resulted in 10% CPU consumption and 19.3% memory consumption. The processor on this device is a 200Mhz ARM and the memory is only 64MB ram so only 12.35MB of RAM is used but most of this is the actual QT framework. Normally however, there is only about 19MB RAM free out of the 64 before actually loading the program but a lot of this is cache ram that can be removed by executing: echo 1 > /proc/sys/vm/drop_caches. This provides about 40% RAM free so this is a big improvement. I decided to remove the whole kernel feature out and do no monitoring, just load the GUI components and leave them blank. CPU consumption is almost 0% and RAM usage is still as high as 14% (8.96MB). So the kernel part of my system with all few hundred DTCs codes loaded in memory only consumes about 3MB of RAM. This is good news. However I still don’t know how adding more GUI components will affect it yet. I have to be careful with my memory consumption.

DTC Parts Implemented including Reset MIL

Over the past 2 days I successfully implemented the checking and loading of DTCs. I have used the Scantool.net’s code database file for all the codes. This is loaded into my program. I can then do something as simple as:

qDebug() << automonApp.getMilStatus();
qDebug() << automonApp.getNumberOfCodes();

This will let me know if the MIL is on and the number of DTCs currently stored on the ECU. There are 4 types or categories of codes:

  • Powertrain Codes – eg. P0133
  • Chassis Codes – eg. C0100
  • Body Codes – eg. B0200
  • Network Codes – eg. U0122

The most common codes are the Powertrain codes. A code starting with P0 is SAE defined, while P1, P2, P3 are manufacturer defined, SAE defined, jointly defined respectively. It is a similar naming scheme with the C,B and U codes.

My simulator gives 6 DTCs if you press the malfunction button. This also illuminates the MIL. Reading these codes was a little difficult as there are 3 ECU’s in the simulator, ECU, ABS and Transmission unit. So I ended up getting codes from other ECUs as well but knowing where the delimiter was, proved to be difficult. The response to a 03 mode command responds with 43, but 43 can be a valid code as well. The 4 represents a chassis code so 43 00 would be C0300. I could not use 43 as a delimiter so I turned headers on using the ATH1 option and this gave back the sender/receiver/priority and CRC header bits. Using this information I successfully interpreted the correct bytes.

Resetting the MIL is very simple, just a matter of sending a mode 04 command.

Saturday, February 28th, 2009 ELM327 Interface, Onboard Diagnostics (OBD) No Comments