Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem 4550 X.3 Version
06-06-2012, 06:31 PM,
#11
RE: Problem 4550 X.3 Version
Hi Freddy,

I am sorry if it is not clear. I have updated the wiki to try and make it clearer. Essentially for a P8 board you should always use the first syntax line given in the wiki,

Quote:void lcd.begin(u8 lines, u8 dotsize)

i.e. there should only be two parameters. The P8 variant NEVER required three parameters for the lcd.begin function. Some of the older examples erroneously referred to the parameters used by lcd.begin as (row, column) but they were always (column, dotsize).

The way that lcd.begin (function _lcd_begin in lcd.lib.c) currently works it only looks to see if the first parameter (rows) is either 1 or greater than 1 and it only responds to the second parameter (dotsize) if the first parameter (rows) = 1, so it will respond to lcd.begin (2,0) and lcd.begin (16,2) exactly the same.

If you have a working example you could try compiling and running it first each of the following in turn :-

  1. lcd.begin(2,0)
  2. lcd.begin(1,0)
  3. lcd.begin(1,1)

If you display is capable of support the 5 x 10 mode, you may be able to see the additional "dots" being activated when you use lcd.begin(1,1).

There was problem with the LCD library that stopped it working correctly for P8 boards and this was fixed by Regis in X.3 r468. So if you want to use the LCD library it is simplest to use X.3 r468 as you have done. It may be possible to get it working in X.3 r399 by replacing the lcdlib.c and lcdlib.h files by those from r468 but as I have not got a P8 board I am not able to check that this works. There are a lot of other changes included between X.3 r339 and X.3 r468 so if you have a working version of X.3 r468 it is probably the better version to use.

There is a table showing which of the lcd library examples should compile OK on the wiki (http://wiki.pinguino.cc/index.php/Result...uidCrystal). If you do try the other examples, could you let me know which run OK for you together with the board you are using and I will update the table. If you use X.3 r468 all should entries in blue or green for your board should compile OK, although the autoscroll.pde example may not give the "correct" output.

Regards
Board = PIC32-Pinguino-OTG Rev C
OS = Linux Unbuntu 11.10 till 26 Apr 2012
OS = Linux Unbuntu 12:04 from 27 Apr 2012
Reply
06-07-2012, 08:54 PM,
#12
RE: Problem 4550 X.3 Version
Hello, did you upgrade to the revision 484, I can not, I get the same thing to you:
Local version under review is not control.
I have the revision 399, and I have problems with the LCD library, probe what is in another page of this forum on the subject, but does not work ... it seems like the Revison, if you can update, post the solution, thanks
Reply
03-02-2013, 11:17 PM,
#13
RE: Problem 4550 X.3 Version
I believe there is still a problem in X3 rev 399 for windoze with LCD driving. I am using 2550, and I have been trying to load a simple program to exercise the LCD, but it is not even correctly addressing the LCD.

The program complies OK, and uploads OK. The LCD (16 by1) stubbornly shows 8 blocks of black squares on the left side, the other 8 remain blank at all times and settings of the contrast control.

Using other programs I can exercise the ports of the 2550 driving LED's etc, so I am happy that the programming and uploading is working OK.

If I try previous suggestions, such as lcd.begin (16, 1, 0) I too get a compile error.

Is there a solution for this yet in Windows? I don't have any other OS environment available.

Thanks for any help
Dave
Reply
04-02-2013, 01:32 AM,
#14
RE: Problem 4550 X.3 Version
You can help by saying what your code is such as what your lcd.begin is.

3 params to it is stated to be wrong. What else did you try?

John
Reply
07-02-2013, 02:11 AM,
#15
RE: Problem 4550 X.3 Version
Here is the full code I'm trying to use:
void setup() {
// Initialise LCD pins:
lcd.pins(8, 9, 4, 5, 6, 7, 0, 0, 0, 0);
// set up the LCD's number of rows and dotsize:
lcd.begin(1, 0);

}

void loop() {
// put your main code here, to run repeatedly:
lcd.home();
//clear the LCD
lcd.clear();
//set the cursor to column 3, line 0
lcd.setCursor(3, 0);
// Print a message to the LCD.
lcd.print("hello, world!");
//delay before next line printed

}

This code compiles (I know that doesn't guarantee it runs!) but if I add #include <lcdlib.h> then the compile fails.

I assume something obvious is either wrong, or missing, but looking at the examples I see, and reading the posts and the wiki, I can't find it!
Thanks for your help
Dave
Reply
09-02-2013, 08:58 PM,
#16
RE: Problem 4550 X.3 Version
FYI :

Quote:but if I add #include <lcdlib.h> then the compile fails.

The IDE automatically includes lcdlib.h so you don't need to do it yourself.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
10-02-2013, 01:28 AM,
#17
RE: Problem 4550 X.3 Version
Quote:The IDE automatically includes lcdlib.h so you don't need to do it yourself.

Thanks - I'd worked that out! But I am still at a loss to see what should be in the code that isn't, or alternatively what I have got there that should not be present? If, on the other hand the code as written 'should' run, then does that point to a Windows rev 399 issue as a possibility? I don't have the luxury of an alternative OS platform to compare with.

Thanks,
Dave
Reply
10-02-2013, 10:06 AM,
#18
RE: Problem 4550 X.3 Version
The best would be to try x.4 last revision
(713). The bug you mention has been certainly fixed a long time ago.
Even better if someone make a Windows package with x.4 ;-)



(10-02-2013, 01:28 AM)daveg4hup Wrote:
Quote:The IDE automatically includes lcdlib.h so you don't need to do it yourself.

Thanks - I'd worked that out! But I am still at a loss to see what should be in the code that isn't, or alternatively what I have got there that should not be present? If, on the other hand the code as written 'should' run, then does that point to a Windows rev 399 issue as a possibility? I don't have the luxury of an alternative OS platform to compare with.

Thanks,
Dave
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
12-02-2013, 12:12 PM,
#19
RE: Problem 4550 X.3 Version
Thanks for the recommendation, Regis. I have to depend on otehrs to do that, as I don't have other platforms to start from, and nor do I have the knowledge of what needs to be done.

So there's a challenge to help all of us 'Windoze bound' Pinguino usres - can someone make an X.4 package for us, please?

Thanks,
dave
(10-02-2013, 10:06 AM)regis Wrote: The best would be to try x.4 last revision
(713). The bug you mention has been certainly fixed a long time ago.
Even better if someone make a Windows package with x.4 ;-)
Reply
25-06-2013, 01:23 PM, (This post was last modified: 25-06-2013, 01:26 PM by cluster.)
#20
RE: Problem 4550 X.3 Version
(12-02-2013, 12:12 PM)daveg4hup Wrote: Thanks for the recommendation, Regis. I have to depend on otehrs to do that, as I don't have other platforms to start from, and nor do I have the knowledge of what needs to be done.

So there's a challenge to help all of us 'Windoze bound' Pinguino usres - can someone make an X.4 package for us, please?

Thanks,
dave
(10-02-2013, 10:06 AM)regis Wrote: The best would be to try x.4 last revision
(713). The bug you mention has been certainly fixed a long time ago.
Even better if someone make a Windows package with x.4 ;-)

Hello,

Were you able to get LCD working? I am on x4 rev857 and tried LCD example in the example folder but it was not working, so I have written my own code, its working for 18f2550, i am posting code for you:
Code:
/*
This is a 16x2 LCD display demonstration. 25 Jun 2013
Author: Pranav Pareek (http://www.pranavpareek.com)

Connection as follows:
* VEE = GND
* EN = PORTC.6
* RS = PORTC.7
* RW = PORTB.4
* LCD D4 = PORTB.0
* LCD D5 = PORTB.1
* LCD D6 = PORTB.2
* LCD D7 = PORTB.3
* B/L+ = ICSP Pin 2
* B/L- = ICSP Pin 3

*/

#define EN 8
#define RS 9
#define RW 4
#define LED 12


void lcd_cmd_data(unsigned char cmd, int rs) {
    if(rs == 1) {
        digitalWrite(RS,HIGH);
    }
    else {
        digitalWrite(RS,LOW);
    }
    digitalWrite(EN,LOW);
    PORTB = ((cmd >> 4) & 0x0F);
    digitalWrite(EN,HIGH);
    delay(10);
    digitalWrite(EN,LOW);
    PORTB = (cmd & 0x0F);
    digitalWrite(EN,HIGH);
    delay(10);
    digitalWrite(EN,LOW);
}

void init_lcd() {
    digitalWrite(RW,LOW);
    digitalWrite(RS,LOW);
    digitalWrite(EN,LOW);
    PORTB = 0x03;
    delay(50);
    digitalWrite(EN,HIGH);
    digitalWrite(EN,LOW);
    delay(10);
    digitalWrite(EN,HIGH);
    digitalWrite(EN,LOW);
    delay(10);
    digitalWrite(EN,HIGH);
    digitalWrite(EN,LOW);
    delay(10);
    PORTB = 0x02;
    digitalWrite(EN,HIGH);
    digitalWrite(EN,LOW);
    lcd_cmd_data(0x28, 0);
    delay(250);
    lcd_cmd_data(0x0E, 0);
    delay(250);
    lcd_cmd_data(0x01, 0);
    delay(250);
    lcd_cmd_data(0x06, 0);
    delay(250);
    lcd_cmd_data(0x80, 0);
    delay(250);    
}

void puts_lcd(const char * string) {
    lcd_cmd_data(0x08, 0);
    while(*string) {
        lcd_cmd_data(*string++, 1);
    }
    lcd_cmd_data(0x0E, 0);
}

void pos_xy(int posX, int posY) {
    if(posX<40) {
        if(posY) {
            posX|=0b01000000;
        }
        posX|=0b10000000;
        lcd_cmd_data(posX, 0);
    }
}

void setup() {
    pinMode(RS,OUTPUT);
    pinMode(EN,OUTPUT);
    pinMode(RW,OUTPUT);
    pinMode(LED,OUTPUT);
    init_lcd();
    puts_lcd("  16x2 LCD Demo ");
    pos_xy(0,1);
    puts_lcd("PranavPareek.Com");
}

  void loop() {
    digitalWrite(LED,HIGH);
    delay(250);
    digitalWrite(LED,LOW);
    delay(250);
  }

demo:


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)