Go Down

Topic: Serial1 on Mega not working (Arduino 0021) (Read 1 time) previous topic - next topic


I am trying to get the Serial1 object to work. I have connected a serial OLED display to my Mega. All is working perfectly. That stops when I try to connect the display to Serial1.

I have used Serial1 on the past (Arduino 0018) then it was working. An yes, I have selected the Mega board in the IDE.

Any ideas would be appreciated.


What operating system are you on?  Can you be more specific about what you change and what difference in behavior you see?  Can you post a simplified but complete sketch that demonstrates the same problem?


I will try to be more specific. I am using OSX 10.5.8 (Intel Mac Pro).

The following code is a summary of what I am doing:
Code: [Select]
#include <HardwareSerial.h>

HardwareSerial *HardwareSerialObj;

void setup(void){
 HardwareSerialObj = &Serial1;

void loop(void){
HardwareSerialObj->println("Hello world");

HardwareSerialObj can have value Serial of Serial1. My 4D OLED driver is doing the same. That way I can provide the UART to use as a parameter.

My OLED is working perfectly when I use the Serial object. Serial1 doesn't work. I see that some objects are drawn on the OLED but some are not. To me it looks like that the Serial1 connect is unstable and loosing data?

Go Up