Control AXE133 LCD display with Serial.*****

Hi,

I have been trying for a little while to control a AXE133 LCD display with my Arduino Mega (Clone) with the Serial. commands but without success.

I found the AXE133Y library and tried to work backwards from that, without success.

In Picaxe programming, doing something like clearing the display is as simple as
"serout pin, N2400, (254, 1)"
I just can't seem to be able to send even just those two values to the display to clear it. I have it connected on TX1 pin at the moment, in the void setup(), I have Serial1.begin(2400)
I tried the followings

Serial1.(254);
Serial1.
(1);

or

Serial1.***(254,1);

with *** = print, println and write

nothing happens unless I run it in a loop. Then, all I get is random symbols on the display.
Is there a trick to it? Like holding the TX1 pin high before starting the transmission, or playing with the parity?

Any help would be great

Thanks,

Ben

Is there a trick to it?

I would expect:

Serial1.write(254);
Serial1.write(1);

to do it. I do note from the documentation though that a delay is required before you ask the display to do anything else. Try running it with a delay before and after.

Hi,

I tried again, and again,... tried different baud rates, reprogrammed the display to expect a pause between the two values. Nothing would work.
I ended up getting the logic analyser out to compare the waveform from the Picaxe (Working perfectly with the display) and the Arduino. Turns out the timing and data are correctly coming out of the Arduino but is inverted. The Picaxe rest low and the Arduino rests high.

Is there a software solution to that or do I need to put an inverter on the output of the Arduino?

Thanks

Well,...

I eventually worked it out. The problem isn't with the Arduino but with the display and the way it runs.
I reprogrammed the display to take in standard UART serial input (It was programmed to work with inverted input)

But then, I found another issue. The display runs a software serial on a digital pin, reads a value on the serial port, processes it and then go read the next one. Problem is, it is too slow and the next value's transfer has already started.

The only way around that I found is to insert a 10ms pause between each Serial.write but that means I have to split everything in 1 byte block like this:

int count = 0;
int LED = 13;

void setup() {
  Serial.begin(9600);
  Serial1.begin(2400);
  pinMode(LED, OUTPUT);
}

void loop() {
  Serial1.write(254);
  delay(10);
  Serial1.write(1);
  delay(100);
  Serial1.print("H");
  delay(10);
  Serial1.print("e");
  delay(10);
  Serial1.print("l");
  delay(10);
  Serial1.print("l");
  delay(10);
  Serial1.print("o");
  delay(10);
  Serial1.print(" ");
  delay(10);
  Serial1.print("!");
  delay(10);  
  Serial.println(count);
  delay(100);
  digitalWrite(13, HIGH);
  delay(50);
  digitalWrite(13, LOW);
  delay(1000);
  count = count + 1;
  delay(100);
}

Not practical. Is there a software solution to this, to automatically insert a pause between transmitted bytes? Or do I have to modify the display to connect the input to the Serial In pin of the microcontroler? (It uses a Picaxe 18M2)