Pages: 1 ... 4 5 [6] 7   Go Down
Author Topic: Opel TID Display  (Read 26884 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Anon

Quote
Is there any working "method" / library to send text and symbols to the Display? Additionaly I would like to have something like a "example" code, which sends a simple "Hello world" to the display, to have something which I can begin learn with.
if your TID looks like this (well, minus the color) then you can find a working library in the post just above yours. In the library header there is a brief description of how methods works, but if you need help, just ask here.

Quote
Is there any "character table"? Is it possible to send only pre-defined characters and symbols, or it is possible to enable only single segments in order to "build" your own symbols?
As far as i could understand, you can only display letters (uppercase), numbers and few symbols (like + - . *). That being said, maybe some lower level communication could allow doing what you ask, but i don't have any information on the subject.

Quote
Is it possible to set up the TiD´s clock via Arduino? I am unsure if the TID get its time from the radio in case its connected, but in case its true, then there should be a method to forward received time from GPS/DCF to the TID´s clock.

Again, not that i know. The clock is run by a separate section, so the tid displays either the clock or what's incoming from the communication line, and wich one is selected by the voltage on a specific pin. Then again, the tid seems to store fault codes from the ecu, so there is probably more happening "under the hood", but i don't know how to access it.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Then again, the tid seems to store fault codes from the ecu, so there is probably more happening "under the hood", but i don't know how to access it.

These Faultcodes are only TID relevant.
As far as I understand from the schematics, there happens only a "Communication" over these wires.

9    SCL       
10    MRQ       
11    SDA       

the rest of them are only "Powersupply" and wires to the "Temperature" sensor. As far as we know, the 9 - 10 - 11 are connected to the Opel radio.

When you remove the radio (as I did) then there appear a faultcode in the TID if you press the two buttons simultaneously.
I don´t recall the Faultcode number, I can look up it later.

The second Code which appeared when I removed the whole TID from the car, and connected it only to a 12 V supply was something like F171
this means a problem with the temperature sensor.

So I don´t think that there is any connection to the ECU, considering the fact that I can read out the faultcodes with my laptop and can confirm that no faultcodes were stored in my ECU at the time the TID diplayed them.


Quote
As far as i could understand, you can only display letters (uppercase), numbers and few symbols (like + - . *). That being said, maybe some lower level communication could allow doing what you ask, but i don't have any information on the subject.

But You have to tell the TID what char to display? How do you send a command to display "ABC" for example?
I mean on low-level.

After reading the PDF here: http://wiki.carluccio.de/index.php/Opel_TID
I couldn´t find any hints, which bits or bytes send to the TID stands for which character.
So how did You determine them?


Quote
In the library header there is a brief description of how methods works, but if you need help, just ask here.

Well to understand the C language to its full detail is still a little hard for me.  smiley-grin But I will try.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well to understand the C language to its full detail is still a little hard for me.  smiley-grin But I will try.

what, in terms of coding capabilities, you need to display a message on your TID (again, if is the 8 carachters kind) is far from being a deep knowlege of the c language.

the following example displays the message "ABC" on the tid

Code:
#include <TID12.h>
TID MyTid(7,5,6);

void setup() {
MyTid.space1_init(0,7);
}

void loop() {
    MyTid.display_message("ABC",1,1);
}

if you have any question regarding this library i would be happy to help
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thx for the code, I will try it out. And yes I have a 8-char TID

But what I meant, is how do you exactly convert the "ABC" to the "TID-Signal"
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But what I meant, is how do you exactly convert the "ABC" to the "TID-Signal"
basically, the ASCII number corresponding to the carachter is sent to the display in serial fashion. The uppercase A, for example, corresponds to binary 1000001, so this number is sent to the tid, using serial communication with a specific protocol. In the carluccio page you linked before are specified all the timings and rules you need to follow in order to succesfully transmit data. Obviously a detailed explanation would be a bit longer, but the purpose of the library is to avoid users having to deal with all of this  smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But what I meant, is how do you exactly convert the "ABC" to the "TID-Signal"
basically, the ASCII number corresponding to the carachter is sent to the display in serial fashion. The uppercase A, for example, corresponds to binary 1000001, so this number is sent to the tid, using serial communication with a specific protocol. In the carluccio page you linked before are specified all the timings and rules you need to follow in order to succesfully transmit data. Obviously a detailed explanation would be a bit longer, but the purpose of the library is to avoid users having to deal with all of this  smiley

Well it worked .. at least a bit.

I could send a simple text to the TID. with

Code:
#include <TID12.h>
TID MyTid(7,5,6);

void setup() {
MyTid.space1_init(0,7);
}

void loop() {
    MyTid.display_message("12345678",1,1);
}

Although its not dynamic but static Text, there is already a problem. Every minute (when the clock on the TID counts a new minute) the display clears for 0,5-1 sec.

Nevermind when I try out two different strings for example:

Code:
MyTid.display_message("12345678",1,1);
delay(500);
MyTid.display_message("87654321",1,1);
delay(500);

It works somehow, but the timing is anything but accurate  smiley-lol

I mean instead of this pattern: -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Its something like this: ---___-_-__--____----__--______-___--_-_-_-_-_-_--_-____--___----

I tried to remove the delays to add another delays, to raise this speed value (X) in "MyTid.display_message("87654321",X,1);"
But no success.

Additionally I would like to try the following to have some dynamic output to send to the TID like if I would want to display the engines "RPM" or something. Smooth and fast refresh rate is very important.....:

Code:
#include <TID12.h>
TID MyTid(7,5,6);

void setup() {

MyTid.space1_init(0,7);

}

void loop() {
  int i = 0;
  for(i=0;i<1000;i++)
  {
  MyTid.display_message(i,1,1);
  delay(500);
  }
}

it says.

Code:
sketch_may12a.ino: In function 'void loop()':
sketch_may12a:14: error: invalid conversion from 'int' to 'const char*'
sketch_may12a:14: error: initializing argument 1 of 'String::String(const char*)'
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Although its not dynamic but static Text, there is already a problem. Every minute (when the clock on the TID counts a new minute) the display clears for 0,5-1 sec.
not sure if there is a way to inibith that, but happens on mine and other's too. Can't remember if someone already posted why it happens and how to avoid that.

Quote
it works somehow, but the timing is anything but accurate  smiley-lol

I mean instead of this pattern: -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Its something like this: ---___-_-__--____----__--______-___--_-_-_-_-_-_--_-____--___----

try with the following code:

Code:
MyTid.clear_space(1);
MyTid.display_message("12345678",1,1);
delay(500);
MyTid.clear_space(1);
MyTid.display_message("87654321",1,1);
delay(500);


Quote
it says.

Code:

sketch_may12a.ino: In function 'void loop()':
sketch_may12a:14: error: invalid conversion from 'int' to 'const char*'
sketch_may12a:14: error: initializing argument 1 of 'String::String(const char*)'

just remember that the display_message method (or was it called function?  smiley-red) requires a string argument. I'm shure there are lighter and more elegant ways to do this, but i would just do this:

Code:
MyTid.display_message(String(i),1,1);

a final note: don't expect crazy refresh rates from this display. I am shure that the library itself could be improved a lot by a good programmer (which certainly i am not  smiley-sweat) but in the end the timings of the tid need to be respected for everything to work.

To get more speed, you can try tweaking a parameter in the TID12.h header

Code:
#define tid_delay 25

seems to me that with 25 everything works fine even on the atmega328 and the speed is reasonable, but you can try and reduce it.
« Last Edit: May 12, 2014, 02:44:53 pm by Giovanni83 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well its a bit better but something like this

https://www.youtube.com/watch?v=Gck8UfNMQiw

would still be impossible.

I don´t know, today when I ´ve connected the arduino (which is on an experimental board along with the TID wiring) I got an "unknown device".   

When I´ve disconnected the 12 V powersupply adapter for the TID which is on a common GND with the arduino. The arduino was recognized correctly.

Maybe there is an interference. Between the powersupply and arduino. (Arduino get its powersupply from the USB port and the TID is connected to a separate circuit only the TID´s GND (and of course the SCL/SDA/MRQ) is connected to the Arduino)

btw

Quote
works fine even on the atmega328

why "even" on the "atmega328" what´s bad about it? Are there better alternatives?

Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
why "even" on the "atmega328" what´s bad about it? Are there better alternatives?

nothing bad about it, but initially i developed the library on arduino mega (atmega1280), then when i tried it on the atmega328 was sluggish, so i reworked the code.

btw, to make the text scroll like in the video you posted, you just have to write a string longer than the space, and for the meter using all the symbols use the bargraph function

Code:
#include <TID12.h>
TID MyTid(7,5,6);
int i=0;
void setup() {
MyTid.space1_init(0,7);
}

void loop() {
   i++;
   if (i>255) i=0;
   MyTid.display_message("THIS STRING IS UNNECESSARILY LONG. NOW IT'S EVEN LONGER  ",30,1);
   MyTid.bargraph(i);
}


you can also write up to 3 different strings, each one rolling at a different speed

Code:
#include <TID12.h>
TID MyTid(7,5,6);

void setup() {
MyTid.space1_init(0,2);
MyTid.space2_init(3,5);
MyTid.space3_init(6,7);
}

void loop() {
    MyTid.display_message("ABCD ",5,1);
 MyTid.display_message("1234 ",15,2);
 MyTid.display_message("MNO",30,3);
}


also, from the description your circuit seems fine, just double check that there are no bad connections or short circuits
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes the first one seems to work pretty well.

Maybe I just don´t get the concept of "C".

But Anyway I used this one

Code:
#include <TID12.h>
TID MyTid(7,5,6);
int i=0;
void setup() {
MyTid.space1_init(0,7);
Serial.begin(9600);
}

void loop() {
   delay(200);   
   i++;
   if (i>255) i=0;
   MyTid.display_message(String(i),30,1);
   MyTid.bargraph(i);
   Serial.println(i);
}

To be able to compare the serial output with the actual output of the TID
But there are many glitches, or numbers left out. I will upload a video of it soon if it helps.

Btw I am using the Arduino Nano, if I didn´t mentioned it before.

If I understood it correctly the "30" in " MyTid.display_message(String(i),30,1);" is the scrolling speed, although its not necessary when the string is max 8 chars long. But if I set it to "1" in this "dynamic" case its much more buggy then. Even if there is no scrolling just a updating number.


So I don´t understand what happens when you add a "delay(X)" in your Loop function, and if it affect or even is a conflict between this two values.


Let´s take this as an example:

Code:
#include <TID12.h>
TID MyTid(7,5,6);
int i=0;
void setup() {
MyTid.space1_init(0,7);
}

void loop() {
   i++;
   if (i>255) i=0;
   MyTid.display_message("THIS STRING IS UNNECESSARILY LONG. NOW IT'S EVEN LONGER  ",30,1);
   MyTid.bargraph(i);
}

It´s pretty fast scrolling text, so when I put a delay in it, it should reduce the scrolling speed then or not?

So is this "30" equal to a "delay(30)" so the program stucks in the "display_message" function for 30ms, before it continues?

Or does the "loop()" function go on nevermind whatever happens in "display_message()"?


Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the scrolling mechanism is handled inside the tid12 library. To avoid wasting cpu cycles the scroll timing, wich is the time the function needs to wait between one movement of the string to the left and the next, is not done using a delay function. Say the display_message function has just shifted the string one step left: the current time (millis()) is marked down in a "timestamp" variable and the function is not executed again until the value of millis() is >= timestamp+timing, meanwhile the cpu can keep doing is business. When you set the speed value in the display_message call, basically you are changing the timing value in the example above (and btw, in the tid12.h there are some brief explanations to all the functions available and their parameters).

Now, more to the point of your questions

Quote
To be able to compare the serial output with the actual output of the TID
But there are many glitches, or numbers left out. I will upload a video of it soon if it helps

i got to admit that i never run this test. There is a speed value at wich there are no glitches?


Quote
Btw I am using the Arduino Nano, if I didn´t mentioned it before.
still an atmega 328/168, so no problems here

Quote
If I understood it correctly the "30" in " MyTid.display_message(String(i),30,1);" is the scrolling speed, although its not necessary when the string is max 8 chars long. But if I set it to "1" in this "dynamic" case its much more buggy then. Even if there is no scrolling just a updating number.
well, this is a consequence of the mechanism explained at the beginning: even if the string is shorter than the space available, the display it's not actually updated until the required time is passed, so the lower the speed, the "buggier" it will look.

Quote
So I don´t understand what happens when you add a "delay(X)" in your Loop function, and if it affect or even is a conflict between this two values.

-the cpu waits for  delay(x) milliseconds
-then executes the display_message function
-which checks if the required amount of time, dependant from the speed argument, is elapsed
-if the above it's true, the display is updated, if not, the  program exits the function
-and the cpu waits again for delay(x) milliseconds

so if  delay(x) is smaller than the timing that display_message must wait, you can have a counter (like i++) that increases without being showed on the tid.

Quote
It´s pretty fast scrolling text, so when I put a delay in it, it should reduce the scrolling speed then or not?
yes it should

Quote
So is this "30" equal to a "delay(30)" so the program stucks in the "display_message" function for 30ms, before it continues?
no, the speed parameter is just an arbitrary number for setting the speed, so 1=slowest and 255=fastest. The actual time between updates is calculated as

1000/speed (ms)

so for a speed of 30 should be around 33ms, while for a speed of 1 is one second. Before you start guessing why i choose those numbers: well, i just wrote the function this way to have the crude mechanism going, and then never bothered with fine tuning the values smiley-sweat
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So you mean, once called "display_message" or "clear_space". Everytime a timestamp is stored and the fuction refuse to change or display content for the given time in ms even if I call it in the program?

Well ok this explains it, and it explain the glitches and lost values from the "i" variable, because I was indeed expecting the "display_message" function is "forced" to display the string when you call it.

But with this "independent" timing you need a different code. And take care of the right delays. I will play with it and see if it helps.

Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So you mean, once called "display_message" or "clear_space". Everytime a timestamp is stored and the fuction refuse to change or display content for the given time in ms even if I call it in the program?
true for display_message, while clear_space executes every time it's called

Quote
But with this "independent" timing you need a different code. And take care of the right delays. I will play with it and see if it helps.
the idea behind this is to avoid wasting cpu cycles on updating the display when it's not a prioity, but if you want a quick refresh just use the maximum speed value, you shouldn't really worry about timing.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone!
I just got an old Opel Corsa B and i wrote a sketch on arduino which displays the car's speed and rpm on the TID. But it's not that fast. It updates the display only about 1-2 times a second.  smiley-confuse
The engine's rpm signal is taken from the green wire on pin 9 on the dashboard connector.
Speed signal from pin 12 on the TID connector.
I'm not that experienced in programming so i would appreciate any suggestions for improvements or other features.
Thanks Giovanni83 for the library!  smiley

So here is the code:
Code:
#include <TID12.h>

TID MyTid(7,5,6);

const int sdv = 8;
const int rpm = 9;

int sdvvalue;
int rpmvalue;

float sdvfloat;
float rpmfloat;

int sdvstate = 0;
int rpmstate = 0;
int sdvstateold = 0;
int rpmstateold = 0;

int sdvhcount = 0;
int rpmhcount = 0;

int sdvbreak = 0;
int rpmbreak = 0;

int start = 0;

int rpm2s = 0;
int rpm3s = 0;

int rpmh = 0;
int rpmh2 = 0;

int sdv2s = 0;

int sdvh = 0;

unsigned long time;
unsigned long timeold;
unsigned long timediff;
unsigned long timediff2;

char rpmdisp[4];
char sdvdisp[3];

void setup()
{
  MyTid.space1_init(0,3);
  MyTid.space2_init(5,7);
  pinMode(sdv, INPUT);
  pinMode(rpm, INPUT);
}

void loop()

{
  while (start == LOW)
  {
    MyTid.display_message("OPEL",1,1);
    MyTid.display_message("ACC",1,2);
    rpmstateold = rpmstate;
    rpmstate = digitalRead(rpm);
    delay(20);
    if (rpmstate == HIGH && rpmstateold == LOW)
    {
      start = 1;
      delay(20);
      MyTid.clear_space(1);
      delay(20);
      MyTid.clear_space(2);
    }

  }

  timeold = micros();      
  while(rpmhcount < 10)
  {  
    rpmstateold = rpmstate;
    rpmstate = digitalRead(rpm);
    delayMicroseconds(150);
    if (rpmstate == HIGH && rpmstateold == LOW)
      rpmhcount++;
    time = micros();
    timediff2 = time - timeold;
    if (timediff2 > 375000)                      //800 rpm --> 375000
    {
      rpmbreak = 1;
      break;
    }            
  }
  time = micros();

  rpmhcount = 0;

  timediff = time - timeold;

  rpmfloat = float(timediff);

  rpmfloat = (1 / (rpmfloat / 1000000)) * 300;                   // green wire gives 2 signals per rotation --> (10*60)/2

  rpmvalue = int(rpmfloat);

  rpmh = rpmvalue / 1000;

  rpmh2 = rpmvalue / 100;

  rpm2s = rpmh2 - (rpmh * 10);

  rpm3s = (rpmvalue / 10) - (rpmh2 * 10);

  rpmdisp[0] = '0' + rpmh;
  rpmdisp[1] = '0' + rpm2s;
  rpmdisp[2] = '0' + rpm3s;
  rpmdisp[3] = '0' + (rpmvalue % 10);
  rpmdisp[4] = '\0';

  if (rpmbreak == HIGH)
  {  
    rpmdisp[0] = '0';
    rpmdisp[1] = '0';
    rpmdisp[2] = '0';
    rpmdisp[3] = '0';
  }

  rpmbreak = 0;

  MyTid.display_message(rpmdisp,1,1);

  if (rpmvalue < 1000)
    MyTid.bargraph(0);
  else if (rpmvalue < 1500)
    MyTid.bargraph(26);
  else if (rpmvalue < 2000)
    MyTid.bargraph(52);
  else if (rpmvalue < 2500)
    MyTid.bargraph(77);
  else if (rpmvalue < 3000)
    MyTid.bargraph(104);
  else if (rpmvalue < 3500)
    MyTid.bargraph(130);
  else if (rpmvalue < 4000)
    MyTid.bargraph(156);
  else if (rpmvalue < 4500)
    MyTid.bargraph(182);
  else if (rpmvalue < 5000)
    MyTid.bargraph(208);
  else if (rpmvalue < 5500)
    MyTid.bargraph(234);
  else if (rpmvalue < 6000)
    MyTid.bargraph(255);
  else MyTid.bargraph(255);


  timeold = micros();
  while(sdvhcount < 10)  
  {  
    sdvstateold = sdvstate;
    sdvstate = digitalRead(sdv);
    delayMicroseconds(150);
    if (sdvstate == HIGH && sdvstateold == LOW)
      sdvhcount++;
    //ab hier
    time = micros();              
    timediff2 = time - timeold;    
    if (timediff2 > 393750)                                        //393750 --> 5 km/h
    {
      sdvbreak = 1;
      break;
    }                          

  }
  time = micros();

  sdvhcount = 0;

  timediff = time - timeold;

  sdvfloat = float(timediff);

  sdvfloat = (1 / (sdvfloat / 1000000)) * 1.96875;      //(1.750 / 32) * 10 = 0.546875  ,    3.6*0.546875 = 1.96875, 1.750 = tire size

    sdvvalue = int(sdvfloat);

  sdvh = sdvvalue / 100;

  sdv2s = (sdvvalue / 10) - sdvh * 10;

  sdvdisp[0] = '0' + sdvh;
  sdvdisp[1] = '0' + sdv2s;
  sdvdisp[2] = '0' + (sdvvalue % 10);
  sdvdisp[3] = '\0';

  if (sdvbreak == HIGH)
  {  
    sdvdisp[0] = '0';
    sdvdisp[1] = '0';
    sdvdisp[2] = '0';
  }

  sdvbreak = 0;

  MyTid.display_message(sdvdisp,1,2);
}
Logged

Offline Offline
Full Member
***
Karma: 8
Posts: 145
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just for info...
http://veramon.czweb.org/en_pp_astra_g.html
Logged

Pages: 1 ... 4 5 [6] 7   Go Up
Jump to: