Poll
Question: Would like the 160x128 GLCD f/sparkfun ported to GLCD v.3?
Would liKe it to be included. - 33 (84.6%)
Don't care. - 5 (12.8%)
Wouldn't like it to be included. - 1 (2.6%)
Total Voters: 16

Pages: 1 ... 6 7 [8]   Go Down
Author Topic: Beta version of GLCD library version 3  (Read 20234 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 0
Posts: 449
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks PaulS,

Here is the full setup():
Code:
void setup(){
  GLCD.Init();                                            
  GLCD.SelectFont(SystemFont5x7);
  setTime(23,59,40,23,11,2010);                          
  Alarm.alarmRepeat(alarmH,alarmH,alarmS, AlarmTone);    
  Alarm.delay(0);
  TonoAlarma.begin(2);                                  
  GLCD.CursorToXY(40, GLCD.CenterY-3);
  GLCD.print("Arduino-based Clock");
  delay(5000);
[glow]  ClearScreen(WHITE);[/glow]
  }
:

Thanks!

[edit]SOLVED!!
As soon as i posted it, i saw the error. the line should say:
[glow]GLCD.ClearScreen();[/glow]

I made a detailed review of the code for a long time without to see the problem... incredible. So thanks PaulS for your comment.
Thanks a lot!
[/edit]
« Last Edit: November 24, 2010, 03:08:44 pm by madepablo » Logged

San Pedro, CA.
Offline Offline
Full Member
***
Karma: 3
Posts: 155
My head HURTS!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anyone having the 160x128 Graphic LCD from sparkfun.com (pn: 08799), want to see it included in GLCD v3? Take the poll and let's see how many people do.

Thanks,
DJ
Logged

DigitalJohnson

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm looking to do a project with a Teensy 2.0 (or maybe Arduino) which will use a Graphics LCD. I'm not very experienced in this field, so I would like to use a graphs LCD that already has a library written for it. I wanted to buy a 128x64 LCD, but all of them are small, being about 2.5" in length.

Is there anything bigger? I found the Sparkfun one, but it's in different dimensions. I just want a bigger dot size, or possibly a bigger LCD, even color, so long as there is a Teensy or Arduino library for it.

Thanks!  smiley-grin
Logged

London
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,
I posted a topic here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1289677923/1#1

..and was asked to move it to this thread  smiley

As far as I've been led to believe this is an AVRDude issue, the explanation of which seems to make sense so far. I also understand there is a way of turning off the AVRDude 'smart' upload to get round this problem but can't seem to track down any info on this. Since encountering this problem ( took me 2 days and lots of hair pulling to pin it down..!  :'( ), I've simply altered my bitmaps and everything works fine.

As an aside, great though the GLCD library is, I found the lack of a 'switch' to divert the graphics routines to a frame buffer seriously limiting for my purposes. If I had a request for a follow up version, I would ask the writers of the library to tweak the code to allow this optional facility. In the meantime, I'm writing some graphics routines for my project that will allow me to display a variety of analogue style gauges for sensor input display. This necessitates use of a frame buffer in SRAM coupled with a slightly modified GLCD DrawBitmap routine to dump this to the display. This allows the graphics to be easily updated as there are no screen erase issues to contend with and makes for smooth animation and also allows the use of a background bitmap that can be pulled from PROGMEM and placed in the frame buffer to be animated over. So far, I've written basic plot, line ( modified GLCD routine ) and circle routines for drawing onto the frame buffer.  Ideally I would like to convert/use all the GLCD routines and add generic bit block transfer/scrolling routines. Doing the graphics this way is much faster and cleaner, especially if you've got lots of stuff going on. The limiting factor in terms of fps will be the transfer of the frame buffer to the GLCD. With a basic screen fill/erase cycle using the line routine, I appear to be able to get at least 30fps but at this speed you are starting to seriously hit the ability of the display to actually paint the pixels fast enough on the screen without leading to fading effects. Actually, this fading effect could be put to good use, with the right timing, in theory it would be possible to produce ( albeit limited ) 'greyscale' images... smiley-wink

Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2648
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

saiello,

On the bitmap/avrdude issue.

It may actually be an interaction between avrdude and the Arduino bootloader code. Its been a while since I looked at either but I do remember that the Arduino bootloader chose to ignore certain commands and I seem to recall it ignored one of the chip erase commands. The bootloader tended to work even though it ignored the erase command as it erased each page as it was written rather than erase the entire chip, but if avrdude never comes back and writes the pages of 0xff, then things will not work properly.
For code this is probably not ever going to be an issue as the "garbage" pages left behind will not have any code that would be executed.
But for data, it could cause real problems.

I'll have to take a peek at the avrdude code and the Arduino Bootloader to see if this is what is happening.
If it is, it is really an error in the Arduino Bootloader as the bootloader is the one that said it erased something when it didn't.

------ With respect to the Frame buffer.

Michael and I have discussed using a frame buffer several times.
It has its pluses and minuses; mostly pluses, but it does require a significant amount of very precious memory and cannot be used on the smaller AVR chips.
It's also quite a big change to the code to really do it correctly
because the current code "knows" how expensive data accesses are
and so it trades quite a bit complexity and code size to avoid
as many lcd data accesses as possible. The code, primarily the text
rendering code could be simplified quite a bit if it had direct access
to the frame buffer.

I experimented with a write-through cache frame buffer.
A write through cache on top of the existing code isn't
as effective as a  code re-write to use a dedicated frame buffer but
it is very easy to do and was only about5- 6 lines of code changes to the current library.
This was mainly intended to support displays that are write-only
using something like a SPI interface.
It actually worked quite a bit better than I thought it would.
The write-through cache mode doubled the through put of the
FPS demo sketch.
(A re-write for frame buffer would be significantly faster)

There are some quick an dirty ways to add in frame buffer support.
What I did with my experimental frame buffer code was to
hook the frame buffer into the ReadData()/WriteData() routines.
That way,  no upper level code has to be re-written and there were only 5 new lines of code.
In my case, reads, never went to the real hardware but were returned
from the frame buffer and writes went to both the real hardware and the frame buffer.

Depending on your situation, you might be able to use this same method
or something similar.
For example, rather than having to re-write any code, you could:
- Rename the existing ReadData()/WritData() routines to say glcdReadData()/glcdWriteData().
- create new ReadData()/WriteData() that use a frame buffer.
- add a glcdBufferFlush() routine that flushes the frame buffer
whenever you want/need to by calling the new glcdWriteData() routine
(which is really the old/original WriteData()) to dump the frame buffer to the physical display.

While not as efficient as it could be, it would be very minimal code changes and all the existing functions would continue to work.
You would just have to make sure to call the glcdBufferFlush() routine whenever you wanted to update the physical display.

--- bill
« Last Edit: November 30, 2010, 03:28:09 pm by bperrybap » Logged

London
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Bill,
Yes, that's exactly the sort of thing I was looking to do, modify the ReadData() and WriteData() routines in glcd_Device to work from a frame buffer. For flushing (modified DrawBitmap):

Code:
void glcd::glcdFlushFB(Image_t *FrameBuffer)
{

uint8_t width, height;
uint8_t i, j;

  width = *FrameBuffer++;
  height = *FrameBuffer++;

  for(j = 0; j < height / 8; j++) {
     glcd_Device::GotoXY(0, (j*8) );
       for(i = 0; i < width; i++) {
             uint8_t displayData = *FrameBuffer++;
             glcdWriteData(displayData);
       }
  }
}

Having a buffer does use up 1KB of SRAM ( for 128x64 LCD's ), so yes, not practical for smaller AVR's. An option to invoke use of a buffer,  say in a call to GLCD::Init passing a pointer to the start of a frame buffer would have been very handy for those that have the memory to spare, allowing the opportunity to use traditional animation techniques...!   smiley-wink
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am just getting into arduinos. I bought a kit with a glcd after I read it was well supported and saw the demo running on it (on youtube)

I want to thank the people behind this library, from what i read so far it seems to be well documented so a complete newbie (like me) can get into it.

Main thing I am missing for the projects I have in mind is touch screen. Plenty to be found on ebay, but I don't think they are supported (yet).
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there guys,

thanks for the hard work, excellent job!

i just tested the library on a 128x64 glcd and works perfect, i have an arduino MEGA 2560  (not 1280)  , arduino 0021, and win 7 64 bits.

now i am testing all the features you made for this library

the pdf and html guide are perfect, a few tips i can give:

- compatiblity with MEGA 2560 ( i know is just modify some lines in include files, but it would be great if not)

im really new in arduino world (about 2 weeks),  i was wondering, i have a tft color 320x240 glcd, but i cant find any library to control it with my arduino MEGA 2560, it is posible with this library ?  

another thing, it would be great to add this library a touchscreen call function, almost all new 128x64 glcd come with touchscreen.

thanks for all!!


Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have just started using arduino's.
I wanted to compile this library for Atmega32.
I am using Usbasp to program my board.

board.txt configuration

Quote
ESATarduino.name=ESATarduino
ESATarduino.upload.protocol=usbasp
ESATarduino.upload.maximum_size=7168
ESATarduino.upload.speed=19200

ESATarduino.build.mcu=atmega32
ESATarduino.build.f_cpu=16000000L
ESATarduino.build.core=arduino

I have changed ks0108.h to include atmega32 definitions.

Quote
#if defined(__AVR_ATmega32__)
#include "ks0108_Mega.h"
[/color]

But on compiling following errors come :

Quote
D:\cvavr\arduino-0021\arduino-0021\hardware\arduino\cores\arduino\WInterrupts.c: In function 'attachInterrupt':
D:\cvavr\arduino-0021\arduino-0021\hardware\arduino\cores\arduino\WInterrupts.c:90: error: 'EICRA' undeclared (first use in this function)
D:\cvavr\arduino-0021\arduino-0021\hardware\arduino\cores\arduino\WInterrupts.c:90: error: (Each undeclared identifier is reported only once
D:\cvavr\arduino-0021\arduino-0021\hardware\arduino\cores\arduino\WInterrupts.c:90: error: for each function it appears in.)
D:\cvavr\arduino-0021\arduino-0021\hardware\arduino\cores\arduino\WInterrupts.c:91: error: 'EIMSK' undeclared (first use in this function)
D:\cvavr\arduino-0021\arduino-0021\hardware\arduino\cores\arduino\WInterrupts.c: In function 'detachInterrupt':
D:\cvavr\arduino-0021\arduino-0021\hardware\arduino\cores\arduino\WInterrupts.c:135: error: 'EIMSK' undeclared (first use in this function)
[/color]

Is there a need of any modifications in the library to compile it with mega32 ?

Thanks,

(i am using sketch from ks0108 library)



« Last Edit: January 11, 2011, 05:08:43 am by dakudiv » Logged

Pages: 1 ... 6 7 [8]   Go Up
Jump to: