How can I use spi to emulate this?

http://postimg.org/image/kb9nelm3d/
This is the 3LB protocol (navigation mode) used by VW to display data from the navigation unit to the cluster display.(MFD, FIS).

After a couple of measurements this is what I think I found out:

a. The clock is set at 2500 kHz.
b. It can be a mode 3 spi.

This is the most acurate one that I grabbed but the data was not properly pushed int the breadboard so it is not consistent.

http://postimg.org/image/92xg6z6dv/

How can I emulate this?

Do you have more details on the 3LB protocol?
To emulate this you may need to resort to bit banging.

Yes. There are 2 modes of this 3LB.

  1. Normal (when you can write only the 2 top lines with 8 chr each line)
  2. Navi mode which is this one.

I have no clue how where start even.
P.S. I got my own cluster and navi on the desk. So if you got any ideas I can try them.

That is a very weird protocol, I suspect you are not sampling fast enough because the clock and data look like they change at the same time and that can't be the case.

As for what "enable" does I have no idea but seeing more exact timing relationships might help.


Rob

Im sampling at 5kHz. I found out something.. I took apart the cluster to see its mcu, and it`s a NEC784036GC.
[Datasheet] NEC 298742, DS datasheet pdf
It has 2 CSI (?!?!?) ports. A 3 wire protocol.
The only thing that i found about this protocol is :
http://documentation.renesas.com/doc/products/mpumcu/apn/78k0r/ZUD-CC-07-0088-E.pdf

They say :

The communication conditions are as follows.
• fCLK = 8 MHz
• CSI00 (unit 0, channel 0) is used.
• 9,600 bps, 8-bit data
• LSB first
• Number of transmit data: 10
• Transmit data: 3A
• INTCSI00 transfer end interrupt servicing is used.

The thing that pointed out was LSB which is what I think I have.
I`ll sample at higher rates and post what i get.

I have attached the samples 10.000kHz->100.000kHz

And the last one. At higher rates I can`t get anything.
200.000kHz

See how different it looks with a better sampling rate? You'll have to learn how to drive a logic analyser.

At higher rates I can`t get anything.

Eh? How could it not work if sampling faster? What brand LA is it?

Anyway it looks like SPI with an active high CS to the slave device...except the first byte in which the enable signal is low.

Got me beat, I think some documentation is required.


Rob

Just looking at the data sheet for that CPU it seems that the SCI port is really just a version of an SPI port. I suspect they are transmitting bytes much the same as you do on an AVR and bit-bashing the enable signal with a GPIO pin.

As to why the enable for the first byte is a different polarity to the rest I have no idea but you could replicate that functionality yourself.


Rob

I don`t have any idea how replicate this.. :frowning:
The LA is an arduino based.

The LA is an arduino based.

Oh, then get a real one :slight_smile:

I think you can use the normal SPI.transfer() function and wiggle that enable pin yourself with digitalWrites(). That last trace could be done something like this

byte bytes_to_send[] = {1,2,3,4,5,6,7,8,9};
#define N_BYTES (sizeof(bytes_to_send) / sizeof(bytes_to_send[0]))

digitalWrite(enablePin, HIGH);
delayMicroseconds(100);
digitalWrite(enablePin, LOW);
SPI.transfer (bytes_to_send[0]);
digitalWrite(enablePin, HIGH);

for (int i = 1; i <  N_BYTES; i++) {
     digitalWrite(enablePin, HIGH);
     SPI.transfer (bytes[i]);
     digitalWrite(enablePin, LOW);
     delayMicroseconds(100);
}

Very rough and who knows is it is what the device needs re timing etc, but you could play with that until it looks the same as your trace.


Rob

Do you have any suggestions of what should i buy?
My local supplier can only get me parts from sparkfun, pololu, olimex.
I`ll try the code and let you know.

You have told us the protocol is 3LB but is there any documentation on how this protocol works else the LA trace is going to be a lot harder to decipher.
Is data direction only one way or does the display also send data back. If it sends back then your either missing the MISO line or the protocol is based on something like SISO and maybe the enable line is data direction?
Possibly the first byte with enable low is a request from display and the other bytes sent with enable high are to the display or the first one with enable low is a command and the others are data. Very difficult without some documentation.

Do you have any suggestions of what should i buy?

If you are referring to a logic analyser the best little LA around IMO is the Saleae Logic.


Rob

That over my funds. my whole salary is 300$ :smiley:
Do you know anything around 50$?:smiley:

There are clones that use the Saleae software, maybe as cheap as $15, have a google for them.

Like this MCU123 Saleae Logic clone - sigrok although I don't know what it costs.


Rob

I've ordered something up to 24Mhz, thx to riva.

This protocol is unidirectional. That I know for sure from a friend which works in diagnostics.
He had a unit that tested every pixel on that lcd. If the pixel was on he would had to press a button to go to the next pixel and so on.
Only the navigation unit or the cd-player is linked to those 3 wires.
As i said before it has 2 modes of functioning.
The cd-player mode (arduino code and how it works)is av here Kovo's blog: audi FIS 3-line protocol
For the navi mode to work I had to use a K-wire interface to switch it from one to the other.
The difference is that when using the cd-player mode, only the cd-player can display info on that top part of the lcd.
The bottom part of the lcd is inaccessible.
When using the navi mode the navigation unit will print the radio info or cd info on the top part and on the bottom part will display the arrows from the gps.
When you start the navi unit it will write on the bottom part Volskwagen Radio Navigation System.
The code for the cd mode is not working when navi mode is enabled.
I think it is because the Enable is not HIGH all the time you send the data. It is like a second clock now, rated at 12.5kHz with a 75% duty cycle.
AND
The clock is only 'clocking' when you send actual packets of data.

Another difference that i spotted is that on cd mode if i stop sending data, but maintain the clock and the enable the text will remain.
If i take the clock or the enable it will go off.
On navi mode if i stop the data or the clock or the enable, the text will remain until it gets a "lcd.clear" or new data. (i think)

Hi all, is this thread still active? I'm toying with 3LB interface on Octavia 1 2002 but can't find some info about navi mode to control the whole MAXI DOT display. Any advice please?