Pages: [1] 2 3
Author Topic: FIS Control, Arduino, Grabbing Variables from Memory  (Read 31783 times)
adam-
Hero Member
*****

Karma: +124/-33
Offline Offline

Posts: 2179


« on: August 06, 2015, 01:23:22 AM »

Hi guys,

I'm going to give a little background to my problem before I delve into the deep.  I'm planning on building a little Arduino board with a can-bus shield and plan on reading some basic variables in the ECU and displaying them on the cluster.  I've programmed before, but never used ASM so I'm going to have to do a bit of reading. 

The first problem, I know the MK4 Golf wasn't fully can-bus, but the clock pinout has a 3? can-bus pairs.  Can I use the can-bus to display information on the cluster, or does the cluster not support can as standard?

Even if the cluster does support can, what about the rest of the car?  I have a feeling some modules are connected with can-bus, but does the loom run to all of them?  Specifically, does the ECU support can-bus, and how do you grab from it?

Obviously it's programmed through the k-line and that's how you log from it, but logging into the ECU takes time (3 seconds) and I'd like to use the Arduino to display on the clocks as soon as the ignition comes on, to display "Hello, Adam" or similar.  So logging into the clocks with the k-line would take too much time and hence not be suitable. 

So, can I use can-bus on the cluster to display a welcome screen and then go to k-line to log the ECU for display on the cluster?

I know it sounds convoluted, probably because I'm making it, but this is all new to me.  For now, even if I can get the cluster to display nmot, or gangi or whatever I'd be happy, a Welcome screen is a bonus.

Yes, I know you can buy a magic box, but that's no fun.

Fanxxxxxxx
Logged
fknbrkn
Hero Member
*****

Karma: +185/-23
Offline Offline

Posts: 1454


mk4 1.8T AUM


« Reply #1 on: August 06, 2015, 02:15:54 AM »

yes you can grab some vars from the can-bus
like an IAT, nmot or coolant temp. but there is bo boost, no egt, no gangi or something else that maybe really useful
another way - using kline and kwp1281 Smiley ro read what you need. (or better kwp2000 with direct memory access Smiley  )

clocks display working by 3LB protocol (in my mk4) and there is no problem with time delay login. im using one of these boxes to display useful data at screen and welcome message working good on it.

mk4 uses different can-bus networks for engine and comfort

btw which transeiver you are using? and do you have a library and working sniffer? im planning to make some air suspension controller with can-bus shield
« Last Edit: August 06, 2015, 02:18:51 AM by fukenbroken » Logged
adam-
Hero Member
*****

Karma: +124/-33
Offline Offline

Posts: 2179


« Reply #2 on: August 06, 2015, 02:35:32 AM »

I was thinking of you when I wrote the post!  I knew you had it working on a 032HN 0001 bin - which is the one I'm using!

Can you get the code from the box?  I'm curious to see how the welcome screen works.  I was just worried about the time delay for the clocks to respond to login and then display Welcome on the screen when the ignition is turned on.  So you turn on the ignition, the Arduino becomes live, has to wait to log in to the clocks and THEN displays Welcome.  This long delay would look bad, almost like the clocks have to "boot".

I remember you linked to the box in another thread but the guy is no longer selling them.  I wonder what chip they're based on.  I'll look into Arduino and k-line/kwp1281. 

I've bought a SeeedStudio canbus shield, but obviously it's now not going to work as I'd hoped.

So, how can I connect to the clocks and the ECU with an Arduino.  Can you break it down for me, I'm really new to this.  I'm going to start preparing notes when I get home from work! Smiley
Logged
adam-
Hero Member
*****

Karma: +124/-33
Offline Offline

Posts: 2179


« Reply #3 on: August 06, 2015, 02:41:38 AM »

http://kovo-blog.blogspot.ro/2013/11/audi-fis-3-line-protocol.html

Seems like a start. 
Logged
fknbrkn
Hero Member
*****

Karma: +185/-23
Offline Offline

Posts: 1454


mk4 1.8T AUM


« Reply #4 on: August 06, 2015, 02:53:06 AM »

nono
3LB doesnt require login, cluster will display any message instantly after turning on ignition. arduino is another story, as i remember it tooks a few seconds to boot and its not good Sad

this box uses PIC18F4585-I/PT and its all i know about it. i have firmware for this but no sources, i think reading about 3LB protocol will be much more useful for you. as i remember there is just a flag that tell a clocks to use all screen instead of top 1/3

also this box doesnt work on audis because of .. something different idk

Logged
adam-
Hero Member
*****

Karma: +124/-33
Offline Offline

Posts: 2179


« Reply #5 on: August 06, 2015, 03:09:23 AM »

Awesome!  It's not quite what I wanted to hear, but thanks!

I might look into getting a box, because it seems simpler.  I like the challenge of being able to do it myself though.  I guess I could have the Arduino permanently powered up and then it just receives the ignition on signal which starts the code - that way I can display a Welcome screen.

I'm going to have a read when I go home; thanks!

Will keep this thread updated with my progress!
Logged
nyet
Administrator
Hero Member
*****

Karma: +607/-168
Offline Offline

Posts: 12268


WWW
« Reply #6 on: August 06, 2015, 09:50:19 AM »

KWP2000 and pulling things from ECU ram:

https://github.com/KEOpenSource/ME7Explorer
Logged

ME7.1 tuning guide
ECUx Plot
ME7Sum checksum
Trim heatmap tool

Please do not ask me for tunes. I'm here to help people make their own.

Do not PM me technical questions! Please, ask all questions on the forums! Doing so will ensure the next person with the same issue gets the opportunity to learn from your ex
ZZottel
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 12


« Reply #7 on: August 06, 2015, 01:51:16 PM »

To write some text on the instrument cluster with the 3LB protocol is easy.

Every message consists of 18 bytes.
The first byte is always 0xF0 and the last byte is a checksum. The 16 characters in between are the actual text. For upper case letters it's simple ASCII.

Keep in mind that all bits on the 3LB are inverted.

I attached two logic analyzer traces of the 3LB. You can open them with the Saleae Logic tool.

"radio_to_fis.logicdata" is a trace of a real Audi radio, sending data to the cluster.

Recently I implemented a demo of the 3LB on an ATMega32. I used the timer interrupts to get the timing as accurate as possible.
"avr_to_fis.logicdata" is the trace of the ATMega sending data to the cluster.

I also add the source code for the microcontroller. I used WinAVR to compile it.
The external clock was 11.059 MHz.
If you want to port the code to another AVR or use another crystal, you will have to modify the timer settings accordingly.

Regards, Stefan
Logged
adam-
Hero Member
*****

Karma: +124/-33
Offline Offline

Posts: 2179


« Reply #8 on: August 07, 2015, 12:52:17 AM »

I was going to email you Stefan!  Your username and actual name obviously refer to the product you already sell, but I didn't want to email because I thought it would be cheeky and you wouldn't want to give away any secrets!

However, that is the total polar opposite, thank you!

I've just bought a TTL UART cable so that I can k-line connect with the car and Arduino.

Am I right in thinking that you can control the whole LCD, rather than just the top half?  Your product seems to suggest that. 

Just now, I just want to connect to the cluster and display some text, I will move on to trying to get a Welcome screen to work - as I think that will be the hardest part, and then get the cluster displaying ECU variables.  Nyet has already posted up a link that I'm going to help use to create this.

The Arduino cable that I've bought seems to have well documented libraries that I can us to help me.

Your information has been fantastic, thanks! Smiley
Logged
eliotroyano
Hero Member
*****

Karma: +48/-8
Offline Offline

Posts: 825


« Reply #9 on: August 07, 2015, 05:18:09 AM »

yes you can grab some vars from the can-bus
like an IAT, nmot or coolant temp. but there is bo boost, no egt, no gangi or something else that maybe really useful
another way - using kline and kwp1281 Smiley ro read what you need. (or better kwp2000 with direct memory access Smiley  )

I have been looking at VW CAN Bus protocol 2.0, and seems to me that other info and/or engine variables can be requested to ECU.
« Last Edit: August 07, 2015, 07:20:41 AM by eliotroyano » Logged
ZZottel
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 12


« Reply #10 on: August 07, 2015, 06:09:43 AM »

Am I right in thinking that you can control the whole LCD, rather than just the top half?  Your product seems to suggest that. 
Yes, you can control the whole screen via 3LB, but the protocol is more complex than the example given above.

I suggest to go step by step. First write some simple text to the cluster. Then gather the needed parameters from the K-line or the CAN bus that you want to display.
Logged
adam-
Hero Member
*****

Karma: +124/-33
Offline Offline

Posts: 2179


« Reply #11 on: August 07, 2015, 06:17:21 AM »

That's what I'm going to do.  I've just bought the UART cable from America so should see it hopefully around the middle of next week at best. 

I know that I can grab variables from the ECU with the k-line, but I'm not convinced the MK4 is linked to the ECU with CAN, so I think using that would be fruitless.

Going from that, I think it would be best to use the k-line to display and grab data from the ECU, assuming that the k-line can be used to control the whole LCD.

You could just post the source code to your FIS-control. Wink
Logged
ZZottel
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 12


« Reply #12 on: August 07, 2015, 07:07:09 AM »

If I understand you right, you want to use the K-line to read data from the ECU and also to write data to the cluster screen.

First of all, I don't even know if you can control the cluster screen via K-line. Maybe this is possible using some OBD commands that allow to modify the RAM of the cluster.
Another problem would be, that you can not use the K-line to communicate with two control units at the same time. Ok, you could solve this by separating the K-line of the cluster from the rest.


Please check the preconditions:
- How to get data from the ECU:
Connect VCDS and have a look at the used protocol. All Mk4 should use KWP1281. Only the R32 is using KWP2000.
If your Mk4 already has CAN bus, there should be some data there (like RPM, speed, oil temperature and so on).

- How to write text to the cluster:
3LB should always work for the Mk4. If the part number of the cluster is "1Jx 920  xxx", then you can also use CAN bus.
Logged
adam-
Hero Member
*****

Karma: +124/-33
Offline Offline

Posts: 2179


« Reply #13 on: August 07, 2015, 07:15:31 AM »

That was the idea, but I've not really given it deep thought, just passing ideas around just now.  Never even gave the thought of sending/receiving data from two separate modules at the same time.

My ECU uses KWP1281, not sure if it has can-bus (it's a 2001 model), but I have a feeling it might, I'll need to check.

The part number of the cluster is 1Jx 920 xxx, so I guess I can use can-bus.  I noticed that there is two can-bus pairs on the clocks, are they the same?  I'll check with a multimeter when I get home. 

So, I use a UART module to read the ECU and pull data from it, and then parse it and write it to the cluster with 3LB, or can-bus?

So:
1: ECU > UART > Arduino > 3LB/Cluster
2: ECU > UART > Arduino > Canbus/Cluster

Thoughts?
Logged
adam-
Hero Member
*****

Karma: +124/-33
Offline Offline

Posts: 2179


« Reply #14 on: August 07, 2015, 03:19:20 PM »

The canbus pairs on the clocks are not the same, so they must feed different modules within the clocks.  Needles, LCD, something else?

Going to have a look at code next to get the display to atleast say something.
Logged
Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.022 seconds with 17 queries. (Pretty URLs adds 0s, 0q)