Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem 4550 X.3 Version
31-05-2012, 03:42 AM,
#1
Problem 4550 X.3 Version
Hi everyone,

I installed the IDE X.3 and some LCD programs that was working on beta 09-5 is not working anymore. I changed the lcd command to lcd.pins, compile is OK, and after send, the run led blinks and the program doesn´t work.

The pinguino is the Tiny 18F4550 version, and the LCD pins are:
rs = 8 enable = 9 (in 4 bit mode) D4 = 4 D5 = 5 D6 = 6 D7 = 7.

This is the code that i´m using:

#define PIC18F4550
#define HOUR 18
#define MIN 19

//declaracao de variaveis
uchar counter = 0;
uchar sec = 0;
uchar min = 0;
uchar hour = 0;

float num;

void setup(){
//4 bits mode, dont use last four pins ...
lcd.pins(8, 9, 4, 5, 6, 7, 0, 0, 0, 0); // RS, E, D4 ~ D7

//LCD format
lcd.begin(4, 1);



//Setup buttons
pinMode(HOUR, INPUT);
pinMode(MIN, INPUT);
}

void loop()
{
// Output string
lcd.home();
lcd.print("RELOGIO!"); // Output char

if (counter>9){
counter = 0;
sec++;
}

if (sec>59){
sec = 0;
min++;
}

if (min>59){
min = 0;
hour++;
}

if (hour>23){
hour = 0;
}


lcd.setCursor(0, 1);

if (hour < 10)
lcd.print("0");
lcd.printNumber(hour, 10);

if (min < 10)
lcd.print(":0");
else
lcd.print(":");
lcd.printNumber(min, 10);

if (sec < 10)
lcd.print(":0");
else
lcd.print(":");
lcd.printNumber(sec, 10);

//set hour and min
if(digitalRead(HOUR) == LOW)
hour++;
if(digitalRead(MIN) == LOW)
min++;

counter++;

delay(100); //just a fine tune to get 100ms with this!

delay(100);
Reply
05-06-2012, 01:42 AM,
#2
RE: Problem 4550 X.3 Version
I have the same problem! I can't even run the example on X.3.. on X.2 runs fine...
Reply
05-06-2012, 10:29 PM,
#3
RE: Problem 4550 X.3 Version
Hi guys,
I think I fixed the bug in rev. 468 (svn repository).
Please use u8 instead of uchar in your programs.
You don't need to " #define 18F4550 ", The IDE does it automatically for you.
Please tell me if it works :

#define HOUR 18
#define MIN 19

//declaracao de variaveis
u8 counter = 0;
u8 sec = 0;
u8 min = 0;
u8 hour = 0;

float num;

void setup(){
//4 bits mode, dont use last four pins ...
lcd.pins(8, 9, 4, 5, 6, 7, 0, 0, 0, 0); // RS, E, D4 ~ D7

//LCD format
lcd.begin(4, 1);



//Setup buttons
pinMode(HOUR, INPUT);
pinMode(MIN, INPUT);
}

void loop()
{
// Output string
lcd.home();
lcd.print("RELOGIO!"); // Output char

if (counter>9){
counter = 0;
sec++;
}

if (sec>59){
sec = 0;
min++;
}

if (min>59){
min = 0;
hour++;
}

if (hour>23){
hour = 0;
}


lcd.setCursor(0, 1);

if (hour < 10)
lcd.print("0");
lcd.printNumber(hour, 10);

if (min < 10)
lcd.print(":0");
else
lcd.print(":");
lcd.printNumber(min, 10);

if (sec < 10)
lcd.print(":0");
else
lcd.print(":");
lcd.printNumber(sec, 10);

//set hour and min
if(digitalRead(HOUR) == LOW)
hour++;
if(digitalRead(MIN) == LOW)
min++;

counter++;

delay(100); //just a fine tune to get 100ms with this!

delay(100);

}
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
06-06-2012, 05:02 AM,
#4
RE: Problem 4550 X.3 Version
hi regis,

I do it, and dont work for me... still not showing anything on LCD...
Reply
06-06-2012, 10:30 AM,
#5
RE: Problem 4550 X.3 Version
Hi,
I've just tested it with a LCD 2x16 on a Pinguino 4550 and it works fine for me.
Please show me your code.


(06-06-2012, 05:02 AM)FreddyC1985 Wrote: hi regis,

I do it, and dont work for me... still not showing anything on LCD...
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
06-06-2012, 03:08 PM,
#6
Photo  RE: Problem 4550 X.3 Version
Hi regis, and thankyou for give a closer look to this issue!.

These is the code that I try on x.3 r399 (compile but it dosnt show LCD)

Code:
#define HOUR 18
#define MIN 19

//declaracao de variaveis
u8 counter = 0;
u8 sec = 0;
u8 min = 0;
u8 hour = 0;

float num;

void setup(){
//4 bits mode, dont use last four pins ...
lcd.pins(8, 9, 0, 1, 2, 3, 0, 0, 0, 0); // RS, E, D4 ~ D7

//LCD format
lcd.begin(2, 0);



//Setup buttons
pinMode(HOUR, INPUT);
pinMode(MIN, INPUT);
}

void loop()
{
// Output string
lcd.home();
lcd.print("RELOGIO!"); // Output char

if (counter>9){
counter = 0;
sec++;
}

if (sec>59){
sec = 0;
min++;
}

if (min>59){
min = 0;
hour++;
}

if (hour>23){
hour = 0;
}


lcd.setCursor(0, 1);

if (hour < 10)
lcd.print("0");
lcd.printNumber(hour, 10);

if (min < 10)
lcd.print(":0");
else
lcd.print(":");
lcd.printNumber(min, 10);

if (sec < 10)
lcd.print(":0");
else
lcd.print(":");
lcd.printNumber(sec, 10);

//set hour and min
if(digitalRead(HOUR) == LOW)
hour++;
if(digitalRead(MIN) == LOW)
min++;

counter++;

delay(100); //just a fine tune to get 100ms with this!

delay(100);

}

   




and this is the code that i run on X.2 r293, Compile and run just fine...

Code:
#define HOUR 18
#define MIN 19

//declaracao de variaveis
u8 counter = 0;
u8 sec = 0;
u8 min = 0;
u8 hour = 0;

float num;

void setup(){
//4 bits mode, dont use last four pins ...
lcd(8, 9, 0, 1, 2, 3, 0, 0, 0, 0); // RS, E, D4 ~ D7

//LCD format
lcd.begin(2, 0);



//Setup buttons
pinMode(HOUR, INPUT);
pinMode(MIN, INPUT);
}

void loop()
{
// Output string
lcd.home();
lcd.print("RELOGIO!"); // Output char

if (counter>9){
counter = 0;
sec++;
}

if (sec>59){
sec = 0;
min++;
}

if (min>59){
min = 0;
hour++;
}

if (hour>23){
hour = 0;
}


lcd.setCursor(0, 1);

if (hour < 10)
lcd.print("0");
lcd.printNumber(hour, 10);

if (min < 10)
lcd.print(":0");
else
lcd.print(":");
lcd.printNumber(min, 10);

if (sec < 10)
lcd.print(":0");
else
lcd.print(":");
lcd.printNumber(sec, 10);

//set hour and min
if(digitalRead(HOUR) == LOW)
hour++;
if(digitalRead(MIN) == LOW)
min++;

counter++;

delay(100); //just a fine tune to get 100ms with this!

delay(100);

}
   



as yo can see, the only change that i do is lcd() function replaced by lcd.pins() on x.3 version...
Reply
06-06-2012, 03:24 PM, (This post was last modified: 06-06-2012, 03:24 PM by regis.)
#7
RE: Problem 4550 X.3 Version
Try with lcd.begin(16, 2);
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
06-06-2012, 04:00 PM, (This post was last modified: 06-06-2012, 04:33 PM by FreddyC1985.)
#8
RE: Problem 4550 X.3 Version
still the same, but documentation of lcd.begins says that

Code:
lcd.begin(u8 cols, u8 lines, u8 dotsize)
Parameters
cols = number of columns of the LCD display (no longer used)
lines = number of lines of the LCD display
dotsize = 0 or 1, should always be 0 unless lines = 1 when it can be 0 or 1.
dotsize = 0 puts the display in 5 x 8 dot mode.
dotsize = 1 puts the display in 5 x 10 dot mode if the display supports it .

so
lcd.begins (2, 0);
16 character are taken for granted (I think)
2 lines
5x8 dot mode

correct me if I wrong.

I download r468 on my ubuntu with script of YeisonEng http://yeisoneng.blogspot.com/2012/05/pi...de-x3.html and work perfectly...

so problem is in my windows install 399 version dont know why...
Reply
06-06-2012, 04:54 PM,
#9
RE: Problem 4550 X.3 Version
Hi Freddy,

the current version of the wiki for lcd.begin (http://wiki.pinguino.cc/index.php/Lcd.begin) has the title :-

Quote:P32 (from X.3 r363 01 May 2012 till X.3 r461 26 May 2012)

just before the line you include in your post, i.e. it only applies to X.3 for P32 between r363 and r461. It does not apply to P8 nor to P32 outside of the revision numbers given. For all other versions the first syntax given in the wiki applies, i.e. only lines and dotsize are included in the function call. Also in the section you quote it does note after "cols" "(no longer used)". I hope that is clear. I will edit the wiki to put the "cols" line in italics which hopefully will make it clearer.

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-06-2012, 05:19 PM, (This post was last modified: 06-06-2012, 05:51 PM by FreddyC1985.)
#10
RE: Problem 4550 X.3 Version
hi mf01

I'm not quite understand,

in my case I have a 16x2 lcd with a p8
so lcd.begin() should be
lcd.begin(16, 2, 0);

if I tried to compiles, output give me an error 101: too many parameters...

if I use lcd.begin(2, 0) works fine, and if i use lcd.begin(16, 2) works fine too... so I'm a little confuse...

on the other hand, I download r468 on my ubuntu with script of YeisonEng http://yeisoneng.blogspot.com/2012/05/pi...de-x3.html and work perfectly...

so problem is in my windows computer that have a 399 version which is the latest available download for this platform...

regards!

I overwrite the files on windows, with the files of ubuntu, an now is working fine! thankyou all for the help..! soon i'l will be posting my projects.... greettings!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)