Loading...
Pages: [1]   Go Down
Author Topic: Arduino due with 4D systems LCD  (Read 297 times)
0 Members and 1 Guest are viewing this topic.
USA
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I bought the uLCD-32PTU (https://www.sparkfun.com/products/11677?) and it worked fine using it as a slave with Aduino uno R3 and mega 2560, but I have problems with the Arduino due. I explain: I first loaded the Serial Library for the Picaso (https://github.com/4dsystems/Picaso-Serial-Arduino-Library) to Aduino's library folder then loaded this code to an arduino uno:

Code:
#include <Picaso_Serial_4DLib.h>                
#include <Picaso_Const4D.h>
#define DisplaySerial Serial
Picaso_Serial_4DLib Display(&DisplaySerial);

void setup(void){
  pinMode(2, OUTPUT);
  DisplaySerial.begin(9600) ;
  Display.TimeLimit4D = 5000 ;
  
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(2, LOW);
  
  delay(3000);
  Display.gfx_Cls() ;
  Display.putstr("Hello World\n") ;
}

void loop(void){

}

Then connected power, ground RX and TX to the arduino uno, it worked fine (see pictures 1 and 2).
Then I connected and Arduino mega uploaded the same code and it worked fine.
Then I connected an Arduino due uploaded the same code, but there is problem, there are no serial communication on the Serial port and no display on the LCD screen. I am wondering if there is a problem bettween the Serial library for the Picaso and the Arduino due... (I hope I did not make a stupid mistake, pictures 3 and 4 might help).

Thank you in advance for your help.

Francois

PS: if your webbrwoser does not show the pictures, you can find them here: http://4d.websitetoolbox.com/post/Arduino-Due-problem-with-Serial-Library-6242552?pid=1277180252#post1277180252
« Last Edit: March 08, 2013, 01:44:52 pm by Francois » Logged

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

Solution found!

I showed the library to a friend and he found that a flush in the library was the problem... He says that it is a problem with the due's driver. (it's his opinion, I am not an expert)

Anyway, here is the solution: remove the flush in the Picaso_Serial_4DLib.cpp like this and it will work.

Code:
Picaso_Serial_4DLib::Picaso_Serial_4DLib(Stream * virtualPort) {
        _virtualPort = virtualPort;
//_virtualPort->flush();       // PROBLEM WITH ARDUINO DUE modified by Francois 3/8/2013
}
Logged

Pages: [1]   Go Up
Print
 
Jump to: