Conflict with LCD Display AXE133 and Serial Monitor

Hi everyone,
I have a project that prints some informational lines to the serial monitor while it executes it's tasks. We were asked to add an LCD display with this information to make it more easily viewable. We added a Serial LCD kit AXE133 to use as few pins as possible since we have very few available. With this LCD we're using only analog pin 5 as output for the screen.

My problem is that I haven't been able to use both the LCD screen and serial monitor in conjunction (this would be ideal since I still want to display more information on the serial monitor). If I try to use both outputs none of them will actually display anything, however the remaining code will still work.

I'm using Serial.begin(9600) to start up the serial monitor and using standard Serial.print commands throughout the code. For the LCD I'm using the AXE133Y.h library and the included .print commands.

Any idea why I'm having this issue and how to fix it? I tried setting Serial.begin to 2400 since I read somewhere that's the baud rate at which the LCD works but I'm having the same result.

Thanks in advance for any help you can give me.

** EDIT **

I have since partially solved my problem although through an unorthodox method. I modified my code so that whenever I need to print to the serial monitor I start it with Serial.begin and once I have printed the text I close it with Serial.end. This adds a lot of unnecessary code and processing though so I'd like to avoid it.

ricardolainez:
I have since partially solved my problem although through an unorthodox method. I modified my code so that whenever I need to print to the serial monitor I start it with Serial.begin and once I have printed the text I close it with Serial.end. This adds a lot of unnecessary code and processing though so I'd like to avoid it.

That may be unorthodox, but that is what you have to do.

The AXE133 needs the serial port. The serial monitor needs the serial port.
You will have to share the serial port.

Buy a 16x2 LCD and use LiquidCrystal.h These types of LCDs don't need the serial port.

Hello ricardolainez, i use these LCD modules and have no problems with the serial port. You can send your code and i will compare it with mine.

ieee488, mabe Ricardo has not enough pins disponible to use some parallel LCD.

Regards, David.

Can't you use a software serial port for the LCD? Software serial library comes with the IDE and the Altsoft serial is available.

I've run into the same problem with the Axe133Y using an Uno. I want to Rx a data stream from another unit, then display it on the OLED, so there is a constant stream of data coming in on Serial. I took a look at the Axe133 lib and it seems the problem is down to the bit shifting out at a certain rate to emulate 2400 baud, I don't have a digital scope of logic analyser to get a closer look at the data stream to see what the issue is, but I guess its missing some beats due to the incoming serial.

From AXE133Y.cpp

#define bitWidth 417 //microseconds; Equates to 2400 baud

void AXE133Y::writeByte(uint8_t foo)
{
digitalWrite(_pin, HIGH); //start bit starts here
delayMicroseconds(bitWidth);
//shift a byte out to the hardware pin
for (byte mask = 0x01; mask; mask <<= 1) {
if (foo & mask) digitalWrite(_pin, LOW);
else digitalWrite(_pin, HIGH);
delayMicroseconds(bitWidth);
}
digitalWrite(_pin, LOW); //end bit starts here
delayMicroseconds(bitWidth);
delayMicroseconds(300); //this is the inter-byte delay
}

Works fine on boot-up with initial message on the OLED, but once the data starts coming on the serial and serviced, the above code just doesn't work. I have tried a few digital out pins, same .... no tweaks seem to work either, even turning off the Serial before printing to the OLED doesn't work, as suggested above. def. case for an I2C i/f'ed display.

Other option here is to go the Mega route and rewrite the libraries to use one of the UART serial ports, the Pixaxe daughterboard on the OLED wants 2400 baud comms.

Other thing I don't like in the AXE133 librariy is the use of the String object, I have had big hassles with this and have taken all use of it out my code. I thought this may be the issue here, so I changed the libs to use char arrays, but that didn't make any difference with this problem.