Go Down

Topic: Opel TID Display (Read 29626 times) previous topic - next topic

tuccer

Hi
I have a Triple Info Display (TID) in my Opel. I want to send data to the screen via Arduino. I find all the info about how to send the stuff but i dont know how to write the libary for the display.
The infos are here: http://www.carluccio.de/index.php/Opel_TID in German.
The second part is the circuit, i find also a sample circuit but it is not Arduino based.
http://www.rolandgruber.de/OpelTID_e.htm
I think the transistors can work with the arduino but i have to connect one PNP and one NPN to each other for controlling the SDA, SCL and MRQ lines. Is it right?
I hope somebody can help me.
Thanks in advance.

tuccer

tuccer

Well, finaly i find a code, but there some expressions that i dont know. Can somebody explain for me?? (I'm very newbe in the Programming). The most important is that i want to know is which pin  the MRQ, SDA, SCL. What are the PortC and PortB, PINB, PINC,.. etc, and the unit8_get stuff.
Thanks
Here is the code:

/****************************************************************/
/*                                                              */
/*              Opel Astra G TID Ansteuerung                    */
/*                     I2C-Protokol                             */
/*                                                              */
/****************************************************************/

#include <Wire.h>
#define TID 0x9B
#define _SCL  5
//#define _SCL_in    1
#define _MRQ  4
//#define _MRQ_in    3
#define  _SDA  4
//#define _SDA_in    5
#define PIN


void setup()
{
  SDA_high();
  SCL_high();
  MRQ_high();

}

void loop()
{
  MRQ_low();
  SDA_low();
  while(get_SDA());        //warte bis SDA low
  delay(50);
  MRQ_high();
  while(!get_SDA());        //warte bis SDA high
  delay(50);
  SDA_low();
  delay(50);
  SCL_low();
  delay(50);
   Wire.begin();
   Wire.beginTransmission(TID);
   MRQ_low();
   Wire.send(0x01); // Schalte Symbole aus
   Wire.send(0x01); // Schalte Symbole aus
   Wire.send(0x01); // Schalte Symbole aus
   Wire.send(0x85);// B
   Wire.send(0x8A);// E
   Wire.send(0xA4);// R
   Wire.send(0x8F);// G
   Wire.send(0x83);// A
   Wire.send(0x9B);// M
   Wire.send(0x83);// A
   Wire.send(0xA7);// S
   Wire.send(0x86);// C
   Wire.send(0x9E);// O
   delay(50);
   MRQ_high();
   Wire.endTransmission();
   SDA_high();
   SCL_high();
   MRQ_high();
   delay(1000);
}


void MRQ_high(void)
{
  PORTB &= ~(1<<_MRQ  );
}

void MRQ_low(void)
{
  PORTB |= (1<<_MRQ);
}

void SCL_high(void){
  PORTC &= ~(1<<_SCL);
}

void SCL_low(void)
{
  PORTC |= (1<<_SCL);
}

void SDA_high(void)
{
  PORTC &= ~(1<<_SDA);
}

void SDA_low(void)
{
  PORTC |= (1<<_SDA);
}


uint8_t get_MRQ(void)
{
  return (PINB & (1<< _MRQ));
}

uint8_t get_SCL(void)
{
  return (PINC & (1<< _SCL));
}

uint8_t get_SDA(void)
{
  return (PINC & (1<< _SDA));
}



tomasi

Hi tuccer. Im new into programming. As i could notice , portA and stuff are related to arduino port manipulation. Check this:
http://www.arduino.cc/en/Reference/PortManipulation

tuccer

Thanks, I will read the port manipulation, maybe i can better understand the code.

Thanks again.

bill2009

The wire library is used for I2C serial communications - have a look at this documentation which explains SDA etc
http://www.arduino.cc/en/Reference/Wire

the code
Code: [Select]

#define _MRQ  4
.....and...
void MRQ_high(void)
{
  PORTB &= ~(1<<_MRQ  );
}

Is seting a  particular pin on avr port B to 0 (which is odd given that it's called MRQ_high).  I believe that it is equivalent to Arduino digital pin 12.  See the port manipulation ref'd earlier and http://arduino.cc/en/Hacking/Atmega168Hardware

We could puzzle our way through all this but  really, your best bet would be to poke around where you found the code and see if there's a connection diagram. 

I'm interested in the project though.  Can you show us the display?  How will you get access to it?

tuccer

Thanx for your help!
So the TID ( Triple Info Display) display is a stock part in the Opel cars ( in my case the Astra F) and its made for the stock radio to show the radio data and the time with the temperature. The radio has no built in display and its connected with some wire to the TID. Because i don't have the original radio, and i want to use the screen. 
The screen :

It is the Corsa TID but mine is the same.
The problem is that this communication is not clean I2C, because i have an MRQ pin and it is must be use to start and stop the transmit. If  you see my links the german will explain the complete protocol. 

I find some BASCOM codes but i totally don't know the Bascom Basic.

And of curse where i find the code there was no wireing diagrams or any explanations.
So lets play puzzle :D or rewrite the code in arduino language. I test the code with the Arduino IDE and i's can complie so it is can be use with the arduino.

-thanks in advance and sorry for my english, i am a Hungarian guy.

Budd

Hey Tuccer, Have you already succeeded in connecting the TID? And where did you find the code? Maybe there is a newer improved version?

bobale

#7
Dec 23, 2012, 04:38 am Last Edit: Dec 23, 2012, 05:18 am by bobale Reason: 1
Has anyone had any success interfacing Arduino with Opel TID display? I've found many, many codes in different programming languages, but I'm not advanced enough to translate them into code which will work with Arduino.

I know that asking someone to translate code would be too much to ask, but is there any way someone could help a little here? As the code is too long to share in one post, here is the complete code http://codetidy.com/4239/. A chunk of code is dedicated for voltage measurement and display, and I'm not interested in it, so I don't need that.

Mostly, I'm confused about these initializations:

Code: [Select]
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
TCCR0=0x00;
TCNT0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer1 Stopped
// Mode: Normal top=0xFFFF
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer2 Stopped
// Mode: Normal top=0xFF
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;

// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
MCUCR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;

// USART initialization
// USART disabled
UCSRB=0x00;

// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

// ADC initialization
// ADC Clock frequency: 250,000 kHz
// ADC Voltage Reference: AVCC pin
ADMUX=ADC_VREF_TYPE & 0xff;
ADCSRA=0x85;

// SPI initialization
// SPI disabled
SPCR=0x00;

// TWI initialization
// TWI disabled
TWCR=0x00;


Do I need any of these initializations for this code to work in Arduino?

Edit:
I've found Arduino code that looks like it shoud work, but as my Arduino hasn't yet arrived, I have no way of checking it:

Code: [Select]
#include <Wire.h>
void setup() {
  pinMode(2, OUTPUT);
 Wire.begin();

digitalWrite(2, LOW);
delay(200);
digitalWrite(2, HIGH);
delay(200);
Wire.beginTransmission(0x94);
digitalWrite(2, LOW);
Wire.write(0x10);
Wire.write(0x01);
Wire.write(0x8C);
Wire.write(0xA4);
Wire.write(0x8A);
Wire.write(0x8A);
Wire.write(0xB5);
Wire.write(0x40);
Wire.write(0x8C);
Wire.write(0x9B);
digitalWrite(2, HIGH);
Wire.endTransmission();
}

void loop() {}  


It seems that this code follows procedure for sending text to the LCD:
1:Idle state all lines are high.
2:Pull MRQ low for a short period and let it go high again.
3:Send a "I2C Start"
4:Send the address byte, 0x94
5:Pull MRQ low.
6:Send 13 data bytes. (The 8 character display uses 10 databytes)
7:Let MRQ go high
8:Send "I2C Stop"

What do you guys think?

MarkT

Quote

I think the transistors can work with the arduino but i have to connect one PNP and one NPN to each other for controlling the SDA, SCL and MRQ lines. Is it right?


No, I2C is an open-collector bus, PNP pull-up transistors would stop it working.

Quote

Do I need any of these initializations for this code to work in Arduino?

No, the Arduino software does its own initialization.

The code you found is assuming particular pins for each of the three pins, namely:
MRQ  - pin 12   (port B, bit 4)
SCL - pin A5   (standard hardware SCL pin, port C bit 5)
SDA - pin A4  (standard hardware SDA pin, port C bit 4).

To pull MRQ low for instance the MRQ_low() routine sets pin 12 to HIGH, since pin 12 turns on the NPN transistor
(the collector of which thus pulls MRQ low).


[ all port/pin numbers apply to Uno (ATmega328 chip) ]
[ I won't respond to messages, use the forum please ]

bobale

I'll check everyting once my Arduino arrives, and then I'll report back here.

Giovanni83

Hello everyone, newbie here.

After three days of headache and frustration (great way to spend the holidays :smiley-eek:) i came up with some working arduino code to drive my TID

mind you, i can't write a proper library of functions because... i don't know how  :smiley-sweat:

so here it is an arduino project that just writes the letter G on the third position of a 8 letters display, needs additional work to make it actually useful, but it's a good start i think.



https://www.box.com/s/be3ia25iven1ygk3rwzn

bobale

Hats off to you. But I can see you haven't used Arduino's I2C lib. Now, I have a question about parity: is that a part of standard I2C protocol? I mean, can I just ditch those lines of code and use Wire library? I have to ask because I can't try this as my Arduino hasn't arrived yet.

Giovanni83

I have tried arduino wire library as well as two other i2c libraries (one being the base upon i created the sketch above), but none of those worked for this display, so i think parity is not part of the i2c protocol

bobale

I was really hoping we could use Wire library, it would be so much simpler. Well, never mind, I'll at least learn how to make libraries, if someone doesn't do that before me.

Giovanni83

#14
Dec 31, 2012, 04:21 pm Last Edit: Dec 31, 2012, 04:24 pm by Giovanni83 Reason: 1
uhm, making a library out of it wasn't as hard as i thought, so here it is:

Opel TID arduino library 1.0

the public functions are slightly smarter than the basic one i wrote yesterday, so now you can write directly a message, and if it's longer than 8 chars it will roll, and you can selectively toggle every symbol, clear only the text/symbols  while leaving the other untouched

Go Up