Arduino Forum

Forum 2005-2010 (read only) => Hardware => Development => Topic started by: Cheater on Jan 15, 2008, 01:02 pm

Title: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 15, 2008, 01:02 pm
No one has made a LCD shield yet which I find odd. Is there any interest for one?
I could even make it use my cool 3 pin LCD interface or even I2C, SPI and serial.

Also serial backpacks are relatively pricey and not as useful as they could be.
In theory I could make a backpack which cost $10 and also provided SPI and I2C interfaces.
For comparison, SparkFun's is $17 and only provides serial.

What do you guys think?
Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Jan 15, 2008, 01:41 pm
Although I am now past that point on my current project, I would have been very interested in an I2C LCD shield for $10.

I would think that I2C and serial support for LCDs at that price would be useful to many.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 15, 2008, 05:03 pm
Well for the backpack I've calculated approx costs.

The PCB is a tiny 1.5 inches by 0.75 inches which at BatchPCB means $5 per board.
It would be $2.50 if I can shave off a fraction off a inch.
At Futurlec for buying 100 of them its just over a dollar a board.

Components wise I can get them singly for about $3.50.
Buying in bulk would slash that amount.

Specs:
ATmega8 running at 16mhz.
Contrast control via trimpot.
Ability to turn the LCD's backlight on/off (power saving or for getting attention).
I2C, Serial and SPI all avaliable.
ICSP header for programming.

Software:
The software will be GPLed naturally. :)
I'll probably put the Arduino bootloader on it so it can be easily updated.
The serial protocol will probably be compatible with other serial backpacks.
The SPI and I2C protocols will be a efficient protocol which I'll work out.
Sample code will be provided for interfacing it with the Arduino using all three methods.

So is there enough interest for me to make a batch of about 25 boards?
Title: Re: LCD shield and/or LCD serial backpack
Post by: mellis on Jan 15, 2008, 05:14 pm
Sounds cool.

If you do want to put the Arduino bootloader on it, you should probably do a lot of testing to make sure it doesn't cause any problems.  If people are sending serial commands to the chip (intended to control the LCD) while the bootloader is active, it could get confused and never launch the code that controls the LCD.  The latest ATmega168 bootloader has some code to try to prevent these sorts of problems, but it's not perfect, and it's not in the current ATmega8 bootloader.  Also, you'll need to balance out the need for the bootloader to have a reasonable delay (so people can actually time an upload properly) vs. having the LCD being responsive quickly.  One idea would be to have a jumper on a digital pin that the bootloader checks when it starts - immediately running the LCD application if it's LOW (or HIGH).  We didn't do that on the Arduino because we didn't want to dedicate a pin to it or add an extra jumper to the board, but it might make sense for this application.  There might even be commented code in the bootloader to handle it.  :)
Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Jan 15, 2008, 05:44 pm
Quote
So is there enough interest for me to make a batch of about 25 boards?

I am in for one.

Presumably you will be using the RW line rather than delays to determine when the LCD is ready to accept data.

Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 15, 2008, 06:08 pm
Quote
Presumably you will be using the RW line rather than delays to determine when the LCD is ready to accept data.

Yep. Its got a dedicated chip so there is no need to cut corners with the pins. :)

Also I just realised that I can make the backlight brightness variable.
Title: Re: LCD shield and/or LCD serial backpack
Post by: VenPixel on Jan 15, 2008, 06:39 pm
Quote
Quote
Presumably you will be using the RW line rather than delays to determine when the LCD is ready to accept data.

Yep. Its got a dedicated chip so there is no need to cut corners with the pins. :)

Also I just realised that I can make the backlight brightness variable.


Not sure if you have taken a look at Peter Anderson's K107 (http://phanderson.com/) backpack. Should at least provide a good reference for designing your own backpack..
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 15, 2008, 07:11 pm
Quote
If you do want to put the Arduino bootloader on it, you should probably do a lot of testing to make sure it doesn't cause any problems.

Sorry I missed your post.

If they are using it with a Arduino then it wouldnt matter at all because they would have to wait anyway.
Ladyada has a hack which starts the program if anything other than 00 is sent to the bootloader so that would also work.
I might put a SMD jumper on to enable/disable it. Just solder over it to enable.

The K107 looks good but it has a awful number of limitations.
I can steal some ideas from its software though. :)
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 16, 2008, 01:22 pm
Ok I've finished fiddling with it. Here is the design so far:

(http://img207.imageshack.us/img207/2583/beta1wm5.th.png) (http://img207.imageshack.us/my.php?image=beta1wm5.png)

I ditched the ICSP connector to save space.
Since I'm breaking out SPI anyway, it'll be simple to make a adaptor.
The labels need to be moved around a bit as well.

It should be breadboard compatible and you'd be able to use a DIP-16 socket if you wanted.
You can also solder it directly to a LCD or even put a socket on it so its removable.

Any feedback?

Also what kind of transistor should I use?
It controls the backlight so it needs to handle about 200mA.
Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Jan 16, 2008, 04:41 pm
Looking good!

More a passing thought then a suggestion, but I was wondering if you would gain real estate and lower cost replacing the contrast pot with a  transistor and capacitor  driven from a spare onboard pwm pin.  Providing the arduino with software commands to increase and decrease contrast may be more convenient then getting at the pot.
Title: Re: LCD shield and/or LCD serial backpack
Post by: VenPixel on Jan 16, 2008, 04:56 pm
Quote
Looking good!

More a passing thought then a suggestion, but I was wondering if you would gain real estate and lower cost replacing the contrast pot with a  transistor and capacitor  driven from a spare onboard pwm pin.  Providing the arduino with software commands to increase and decrease contrast may be more convenient then getting at the pot.


Other people may have had different experiences but I have always found that I only adjust the contrast once.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 17, 2008, 09:52 am
Its certainly possible.
Even if it is set only once its probably cheaper.
The value can be stored in EEPROM once the optimal contrast is found or it can be changed dynamically.
Title: Re: LCD shield and/or LCD serial backpack
Post by: leKuk on Jan 17, 2008, 12:21 pm
hej cheater, great idea! just 2 questions: do you target a special LCD or is your board supposed to be a general garphics card? i'm asking this, because i use these monochrome nokia displays (monochrome, 84px x 48px). i have the code working and really would like to work on a library if someone would be willing to assist. the problem with this display is, that it works on 3.3v and comes with a pretty annoying connector which like cries for a custom board.

sparkfun is selling the display including a board (no backlight) for $35. http://www.sparkfun.com/commerce/product_info.php?products_id=8428
the display only is available for about $5 / 4$. the color displays (OLED) i'v been looking need 3.3v (some 3.6v) as well. you could keep that in mind when configuring the atmegas brown out detection and stuff. plus maybe you find one of these mobile phones display connectors to be worth supportable. i guess there are a million different, still it might be something to investigate.

my second question is a general question on your first design. do you (or anyone) have experience on running an atmega on the internal oscillator at 8Mhz? just maybe you don't need the crystal and can save that space. if the communication uses a clock line i wouldn't see a problem with timing or speed. what do think?

i'm using ladyada's bootloader hack as well, and have no problems uploading sketches to the 8Mhz/3.3v at 19.200 bps using just RX/TX. "run program on power up" is a great feature (and something i would suggest for the official arduino bootloader! to upload a sketch you reset the board with the reset button).

i'm for the software controlled contrast and backlight by the way. they can be used for cool effects.

as for a backlight  transistor: i think bc-337 and 2n2222 would be suited. at least these i've found to meet very often, and if i remember correctly support a max of 400mA (or was it 800?).

if we could find a reasonable priced way to get them here to berlin, i'd be interested in at least 2 of these :-)

//kuk


Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Jan 17, 2008, 01:04 pm
Quote
... i use these monochrome nokia displays (monochrome, 84px x 48px). i have the code working and really would like to work on a library if someone would be willing to assist.

I don't want to hijack this thread but I have a few of these and would be interested in helping with a library. It would be great if cheater could support these displays in his shield, but if not then it may be worth starting another thread to discuss this.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 17, 2008, 01:32 pm
Quote
hej cheater, great idea! just 2 questions: do you target a special LCD or is your board supposed to be a general garphics card?

This is designed for a standard HD44780 character LCD, not a graphical one.
The idea however can be adapted to nearly anything.

Quote
i'm asking this, because i use these monochrome nokia displays (monochrome, 84px x 48px). i have the code working and really would like to work on a library if someone would be willing to assist. the problem with this display is, that it works on 3.3v and comes with a pretty annoying connector which like cries for a custom board.

I'd assist if I had one. ;)

Quote
my second question is a general question on your first design. do you (or anyone) have experience on running an atmega on the internal oscillator at 8Mhz? just maybe you don't need the crystal and can save that space. if the communication uses a clock line i wouldn't see a problem with timing or speed. what do think?

I dont have experience with it but I have ordered a bunch of ATtiny chips to play with along with two ATmega32's.
So in a week or two I will have experience running them without a crystal. :)

Space isnt a issue with my design.
The width is constant because I want it to fit in a DIP socket and the length is also constant because it needs to match a LCD's pin out.

The crystal is dirt cheap and is faster and more reliable. Why not have it? :)
For smaller designs I probably wouldnt have one though.

Quote
as for a backlight  transistor: i think bc-337 and 2n2222 would be suited. at least these i've found to meet very often, and if i remember correctly support a max of 400mA (or was it 800?).

I found a SMD one which says its max current is 800mA so that should be fine.

The backlight shouldnt cause much of a problem anyway.
I've got a neat setup where I control 4 20x4 LCDs from three pins with individual backlight control.
A 595 can power the backlights just fine even with massive capacitors which make a cool fading effect.

Quote
if we could find a reasonable priced way to get them here to berlin, i'd be interested in at least 2 of these :-)

Australia to Berlin should be fine. :)

I'm getting a 128x64 graphical LCD (a larger one, not a tiny one. KS0108B controller) so I can definitely help with graphical routines for any LCD and a library for similar LCDs.
Just need to dust off my trigonometry. :)

I could also make a backpack or shield for other LCDs which does all the hard work and provides Serial/I2C/SPI interfaces.
Making one for a PSP LCD (with touch screen even) would be bloody cool. :D
Title: Re: LCD shield and/or LCD serial backpack
Post by: follower on Jan 19, 2008, 04:11 pm
Quote
i use these monochrome nokia displays (monochrome, 84px x 48px). i have the code working and really would like to work on a library if someone would be willing to assist.

Ooo, yes. :-) I have an LCD wired up here but haven't tested it because I got distracted by the whole network thing... :D

Here are my Arduino and Nokia LCD notes (http://code.rancidbacon.com/LearningAboutArduinoNokiaLCD) probably not much use currently but thought I'd throw them on the pile.

--Phil.
Title: Re: LCD shield and/or LCD serial backpack
Post by: leKuk on Jan 19, 2008, 05:53 pm
Here's a basic code to display text, lines and dots. Original c code came from Massimo. I already posted it to the forum, but thing get easily lost here. i know it should be up on the playground. but me too got distracted from it by other projects. The circuit i use never got updated, like i planned, using a proper 3,3v regulator for the display. i'm doing other stuff lately with arduino running on 3.3v so i might get back to it.

here the lazy circuit http://flickr.com/photos/12058013@N07/2203300707/ using 4 diodes to reduce voltage to appr. 3.2v and voltage dividers for communication.
here's a basic version of the code [again here, and not on the playground, so maybe we could clean it up build a library from it together]:
Code: [Select]

//  arduino pinout for LCD.
int CONTROL_LED=12;
int LCD_POWER_PIN      =       11;
int LCD_DC_PIN         =        2; //  PB0  4  Data Command
int LCD_CE_PIN         =        3; //  PB2  5  /CS   active low chip select ??
int SPI_MOSI_PIN       =        4; //  PB3  3  Serial   line
int LCD_RST_PIN        =        5; //  PB4  8   /RES RESET
int SPI_CLK_PIN        =        6; //  PB5  2  CLOCK


#define LCD_X_RES                  84
#define LCD_Y_RES                  48



#define LCD_CACHE_SIZE             ((LCD_X_RES * LCD_Y_RES) / 8)

/*--------------------------------------------------------------------------------------------------
Type definitions
--------------------------------------------------------------------------------------------------*/



#define    LCD_CMD  0
#define    LCD_DATA  1

#define    PIXEL_OFF   0
#define    PIXEL_ON    1
#define    PIXEL_XOR   2

#define    FONT_1X  1
#define    FONT_2X  2


typedef unsigned int               word;

// Public function prototypes

void LcdInit       ( void );
void LcdClear      ( void );
void LcdUpdate     ( void );
void LcdGotoXY     ( byte x, byte y );
void LcdChr        ( int size, byte ch );
void LcdStr        ( int size, char *dataPtr );
void LcdPixel      ( byte x, byte y, int mode );
void LcdLine       ( byte x1, byte y1, byte x2, byte y2, int mode );
void LcdSendCmd ( byte data, int cd );


// This table defines the standard ASCII characters in a 5x7 dot format.


// Global Variables

byte  LcdCache [ LCD_CACHE_SIZE ];

int   LcdCacheIdx;
int   LoWaterMark;

int   HiWaterMark;
boolean  UpdateLcd;
char sign;

// This table defines the standard ASCII characters in a 5x7 dot format.
static const byte FontLookup [][5] =
{
 {
   0x7E, 0x11, 0x11, 0x11, 0x7E     }
 ,   // A
 {
   0x7F, 0x49, 0x49, 0x49, 0x36     }
 ,   // B
 {
   0x3E, 0x41, 0x41, 0x41, 0x22     }
 ,   // C
 {
   0x7F, 0x41, 0x41, 0x22, 0x1C     }
 ,   // D
 {
   0x7F, 0x49, 0x49, 0x49, 0x41     }
 ,   // E
 {
   0x7F, 0x09, 0x09, 0x09, 0x01     }
 ,   // F
 {
   0x3E, 0x41, 0x49, 0x49, 0x7A     }
 ,   // G
 {
   0x7F, 0x08, 0x08, 0x08, 0x7F     }
 ,   // H
 {
   0x00, 0x41, 0x7F, 0x41, 0x00     }
 ,   // I
 {
   0x20, 0x40, 0x41, 0x3F, 0x01     }
 ,   // J
 {
   0x7F, 0x08, 0x14, 0x22, 0x41     }
 ,   // K
 {
   0x7F, 0x40, 0x40, 0x40, 0x40     }
 ,   // L
 {
   0x7F, 0x02, 0x0C, 0x02, 0x7F     }
 ,   // M
 {
   0x7F, 0x04, 0x08, 0x10, 0x7F     }
 ,   // N
 {
   0x3E, 0x41, 0x41, 0x41, 0x3E     }
    // O

 ,   // Y
 {
   0x61, 0x51, 0x49, 0x45, 0x43     }
   //Z
};
/*--------------------------------------------------------------------------------------------------

Name         :  LcdSendCmd

Description  :  Sends data to display controller.

Argument(s)  :  data -> Data to be sent
cd   -> Command or data (see/use enum)

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdSendCmd ( byte data, int cd )
{


 byte i = 8;

 byte mask;



 //

 if ( cd == LCD_DATA )
 {
   digitalWrite(LCD_DC_PIN,HIGH);
 }
 else
 {
   digitalWrite(LCD_DC_PIN,LOW) ;
 }




 while(0 < i) {

   mask = 0x01 << --i; // get bitmask and move to least significant bit
   // cause edge to fall
   digitalWrite(SPI_CLK_PIN,LOW); // tick
   delayMicroseconds(400);
   // set out byte
   if(data & mask){ // choose bit

     digitalWrite(SPI_MOSI_PIN,HIGH); // send 1

   }
   else{

     digitalWrite(SPI_MOSI_PIN,LOW); // send 0

   }

   // cause edge to rise

   digitalWrite(SPI_CLK_PIN,HIGH); // tock
   delayMicroseconds(400);





 }


}

//end of part 1
Title: Re: LCD shield and/or LCD serial backpack
Post by: leKuk on Jan 19, 2008, 05:55 pm
part 2 of the sketch
Code: [Select]



/*--------------------------------------------------------------------------------------------------

Name         :  LcdInit

Description  :  Performs MCU SPI & LCD controller initialization.

Argument(s)  :  None.

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdInit ( void )
{

 int m;


 //  Toggle display reset pin.
 digitalWrite(LCD_RST_PIN,LOW);
 delay(40);
 digitalWrite(LCD_RST_PIN,HIGH);

 //  Enable SPI port: No interrupt, MSBit first, Master mode, CPOL->0, CPHA->0, Clk/4
 // SPCR = 0x50;



 LcdSendCmd( 0x21, LCD_CMD );  // LCD Extended Commands.
 LcdSendCmd( 0xB3, LCD_CMD );  // Set LCD Vop (Contrast). //B1
 LcdSendCmd( 0x04, LCD_CMD );  // Set Temp coefficent. //0x04

 LcdSendCmd( 0x13, LCD_CMD );  // LCD bias mode 1:48. //0x13
 LcdSendCmd( 0x20, LCD_CMD );  // LCD Standard Commands, Horizontal addressing mode.

 LcdSendCmd( 0x0C, LCD_CMD );  // LCD in normal mode. 0x0d for inverse
 // LcdSendCmd( 0x0D, LCD_CMD );

 //  Reset watermark pointers.
 LoWaterMark = LCD_CACHE_SIZE;
 HiWaterMark = 0;
 


 
   LcdClear();
 LcdUpdate();
}

/*--------------------------------------------------------------------------------------------------

Name         :  LcdContrast

Description  :  Set display contrast.

Argument(s)  :  contrast -> Contrast value from 0x00 to 0x7F.

Return value :  None.

Notes        :  No change visible at ambient temperature.

--------------------------------------------------------------------------------------------------*/
void LcdContrast ( byte contrast )
{
 //  LCD Extended Commands.
 LcdSendCmd( 0x21, LCD_CMD );

 // Set LCD Vop (Contrast).
 LcdSendCmd( 0x80 | contrast, LCD_CMD );

 //  LCD Standard Commands, horizontal addressing mode.
 LcdSendCmd( 0x20, LCD_CMD );
}

/*--------------------------------------------------------------------------------------------------

Name         :  LcdClear

Description  :  Clears the display. LcdUpdate must be called next.

Argument(s)  :  None.

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdClear ( void )
{
 int i;

 for ( i = 0; i < LCD_CACHE_SIZE; i++ )
 {
   LcdCache[i] = 0x00;
 }

 //  Reset watermark pointers.
 LoWaterMark = 0;
 HiWaterMark = LCD_CACHE_SIZE - 1;

 UpdateLcd = true;
}

/*--------------------------------------------------------------------------------------------------

Name         :  LcdGotoXY

Description  :  Sets cursor location to xy location corresponding to basic font size.

Argument(s)  :  x, y -> Coordinate for new cursor position. Range: 1,1 .. 14,6

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdGotoXY ( byte x, byte y )
{
 LcdCacheIdx = (x - 1) * 6 + (y - 1) * 84;
}

/*--------------------------------------------------------------------------------------------------

Name         :  LcdChr

Description  :  Displays a character at current cursor location and increment cursor location.

Argument(s)  :  size -> Font size. See enum.
ch   -> Character to write.

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdChr ( int size, byte ch )
{
 byte i, c;
 byte b1, b2;
 int  tmpIdx;

 if ( LcdCacheIdx < LoWaterMark )
 {
   //  Update low marker.
   LoWaterMark = LcdCacheIdx;
 }

 if ( (ch < 0x20) || (ch > 0x7b) )
 {
   //  Convert to a printable character.
   ch = 65;
 }

 if ( size == FONT_1X )
 {
   for ( i = 0; i < 5; i++ )
   {
     LcdCache[LcdCacheIdx++] = FontLookup[ch - 65][i] << 1;
   }
 }
 else if ( size == FONT_2X )
 {
   tmpIdx = LcdCacheIdx - 84;

   if ( tmpIdx < LoWaterMark )
   {
     LoWaterMark = tmpIdx;
   }

   if ( tmpIdx < 0 ) return;

   for ( i = 0; i < 5; i++ )
   {
     c = FontLookup[ch - 32][i] << 1;
     b1 =  (c & 0x01) * 3;
     b1 |= (c & 0x02) * 6;
     b1 |= (c & 0x04) * 12;
     b1 |= (c & 0x08) * 24;

     c >>= 4;
     b2 =  (c & 0x01) * 3;
     b2 |= (c & 0x02) * 6;
     b2 |= (c & 0x04) * 12;
     b2 |= (c & 0x08) * 24;

     LcdCache[tmpIdx++] = b1;
     LcdCache[tmpIdx++] = b1;
     LcdCache[tmpIdx + 82] = b2;
     LcdCache[tmpIdx + 83] = b2;
   }

   //  Update x cursor position.
   LcdCacheIdx += 11;
 }

 if ( LcdCacheIdx > HiWaterMark )
 {
   //  Update high marker.
   HiWaterMark = LcdCacheIdx;
 }

 //  Horizontal gap between characters.
 LcdCache[LcdCacheIdx++] = 0x00;
}

/*--------------------------------------------------------------------------------------------------

Name         :  LcdStr

Description  :  Displays a character at current cursor location and increment cursor location
according to font size.

Argument(s)  :  size    -> Font size. See enum.
dataPtr -> Pointer to null terminated ASCII string to display.

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdStr ( int size, char *dataPtr )
{
 while ( *dataPtr )
 {
   LcdChr( size, *dataPtr++ );
 }
}
Title: Re: LCD shield and/or LCD serial backpack
Post by: leKuk on Jan 19, 2008, 06:01 pm
part 3 (this is long. note that i kept running out of memory while getting this together fot the atmega8. that's why there are no small letters in the font bitmap)
Code: [Select]


/*--------------------------------------------------------------------------------------------------

Name         :  LcdPixel

Description  :  Displays a pixel at given absolute (x, y) location.

Argument(s)  :  x, y -> Absolute pixel coordinates
mode -> Off, On or Xor. See enum.

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdPixel ( byte x, byte y, int mode )
{
 word  index;
 byte  offset;
 byte  data;

 if ( x > LCD_X_RES ) return;
 if ( y > LCD_Y_RES ) return;

 index = ((y / 8) * 84) + x;
 offset  = y - ((y / 8) * 8);

 data = LcdCache[index];

 if ( mode == PIXEL_OFF )
 {
   data &= (~(0x01 << offset));
 }
 else if ( mode == PIXEL_ON )
 {
   data |= (0x01 << offset);
 }
 else if ( mode  == PIXEL_XOR )
 {
   data ^= (0x01 << offset);
 }

 LcdCache[index] = data;

 if ( index < LoWaterMark )
 {
   //  Update low marker.
   LoWaterMark = index;
 }

 if ( index > HiWaterMark )
 {
   //  Update high marker.
   HiWaterMark = index;
 }
}

/*--------------------------------------------------------------------------------------------------

Name         :  LcdLine

Description  :  Draws a line between two points on the display.

Argument(s)  :  x1, y1 -> Absolute pixel coordinates for line origin.
x2, y2 -> Absolute pixel coordinates for line end.
mode   -> Off, On or Xor. See enum.

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdLine ( byte x1, byte y1, byte x2, byte y2, int mode )
{
 int dx, dy, stepx, stepy, fraction;

 dy = y2 - y1;
 dx = x2 - x1;

 if ( dy < 0 )
 {
   dy    = -dy;
   stepy = -1;
 }
 else
 {
   stepy = 1;
 }

 if ( dx < 0 )
 {
   dx    = -dx;
   stepx = -1;
 }
 else
 {
   stepx = 1;
 }

 dx <<= 1;
 dy <<= 1;

 LcdPixel( x1, y1, mode );

 if ( dx > dy )
 {
   fraction = dy - (dx >> 1);
   while ( x1 != x2 )
   {
     if ( fraction >= 0 )
     {
       y1 += stepy;
       fraction -= dx;
     }
     x1 += stepx;
     fraction += dy;
     LcdPixel( x1, y1, mode );
   }
 }
 else
 {
   fraction = dx - (dy >> 1);
   while ( y1 != y2 )
   {
     if ( fraction >= 0 )
     {
       x1 += stepx;
       fraction -= dy;
     }
     y1 += stepy;
     fraction += dx;
     LcdPixel( x1, y1, mode );
   }
 }

 UpdateLcd = true;
}

/*--------------------------------------------------------------------------------------------------

Name         :  LcdUpdate

Description  :  Copies the LCD cache into the device RAM.

Argument(s)  :  None.

Return value :  None.

--------------------------------------------------------------------------------------------------*/
void LcdUpdate ( void )
{
 int i;
 
//always update everything for the moment
LoWaterMark = 0;
HiWaterMark = LCD_CACHE_SIZE - 1;


 if ( LoWaterMark < 0 ){
   LoWaterMark = 0;
 }
 else if ( LoWaterMark >= LCD_CACHE_SIZE ){
   LoWaterMark = LCD_CACHE_SIZE - 1;
 }

 if ( HiWaterMark < 0 ){
   HiWaterMark = 0;
 }
 else if ( HiWaterMark >= LCD_CACHE_SIZE ){
   HiWaterMark = LCD_CACHE_SIZE - 1;
 }

 //  Set base address according to LoWaterMark.
 LcdSendCmd( 0x80 | (LoWaterMark % LCD_X_RES), LCD_CMD );
 LcdSendCmd( 0x40 | (LoWaterMark / LCD_X_RES), LCD_CMD );

 //  Serialize the video buffer.
 for ( i = LoWaterMark; i <= HiWaterMark; i++ )
 {
   LcdSendCmd( LcdCache[i], LCD_DATA );
 }

 //  Reset watermark pointers.
 LoWaterMark = LCD_CACHE_SIZE - 1;
 HiWaterMark = 0;

 UpdateLcd = false;
}



and finally setup() and our loop()
Code: [Select]

void setup() {

 beginSerial(19200);
 //power control led
 pinMode(CONTROL_LED,OUTPUT);


 pinMode(LCD_RST_PIN,OUTPUT);
 pinMode(LCD_DC_PIN ,OUTPUT);
 pinMode(LCD_CE_PIN ,OUTPUT);
 pinMode(SPI_MOSI_PIN ,OUTPUT);
 pinMode(SPI_CLK_PIN,OUTPUT);

 //power the display
 //not used in this sketch. the display was powered permanently
// pinMode(LCD_POWER_PIN,OUTPUT);

 //start
 digitalWrite(CONTROL_LED, HIGH);
 LcdInit();
 
}

void loop() {
LcdLine ( 0, 0, 83, 47, 2 );
 LcdChr(1,(char)'A');
 LcdStr(1, "BCDEFG");
 LcdUpdate();
}




//kuk
Title: Re: LCD shield and/or LCD serial backpack
Post by: brianbr on Jan 21, 2008, 07:01 am
Quote
The K107 looks good but it has a awful number of limitations.


Just to clarify some things sort of mis-stated above. Peter Anderson http://www.phanderson.com created the LCD1x7 and LCD1x8 series of PIC chips (currently 16F648A) that serve as the core of the serial to parallel conversion for a HD44780 character based LCD display. He sells the chip and packages a schematic with it.

The K107 is a pcb I designed to house Peter's chip. It s a flexible design which can accomodate 2x7, 1x10, 1x14, and 1x16 pin configurations (2x8 has been added to Rev 4 of the board which will go to production runs in the next month or so). Peter's firmware allows handling of 2x16, 2x20, 2x24, 2x40, 4x16 and 4x20 character geometries (software selectable). The signal input can be TTL TRUe or RS232 INVerted (jumper selectable) and can be had in 2400 baud, 9600 baud, or 19200 baud. The serial baudrate is fixed in firmware specifically to avoid the potential problems, some of which have been discussed above. The K107 board with an Anderson chip comes up running every time. The Anderson firmware provides for all the expected LCD controls, as well as customizable characters, customizable startup splash screen,  4 line high numerals for large displays, etc.

The Anderson chip uses the PIC internal UART and has a 64 character buffer so a very busy display may require some 1-40 ms delays. LCD displays are not fast devices these delays are going to happen no matter how fast you get data to the control board, whether it be serial, SPI or I2C

I wrote a complete library for the K107 based upon the TX part of Software Serial. I run my displays at 19200 on my Arduino and BBB boards all the time with no problems.

I would be interested to know exactly what you feel are the 'awful number of limitations'

 The K107 Serial LCD Controller can be seen at http://www.wulfden.org/k107/ and my Freeduino offerings (incuding some bundles with K107 boards and displays) can be seen at http://www.wulfden.org/freeduino/freeduino.shtml.

 By the way, while the original Anderson design called for a TIP41C (TO220) to PWM the display backlight. That was overkill. I found that a 2N4401 (TO92) in the negative line of the LED backlight was more than adequate for even  the brightest 4x20 backlit displays. I have sold nearly 2000 K107 boards and not one user has complained of the 4401 burning up or getting hot.


cheers ... BBR


Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 23, 2008, 02:27 am
Quote
I would be interested to know exactly what you feel are the 'awful number of limitations'

Most of the reasons why I think its limited are due to the software.

The only hardware complaint is its not very small. :)
While board area doesnt matter much, yours is rather thick.

Here is a list of software issues I can think of in my jet lagged state. ;)
Title: Re: LCD shield and/or LCD serial backpack
Post by: brianbr on Jan 24, 2008, 04:57 am
Quote
Quote
I would be interested to know exactly what you feel are the 'awful number of limitations'

Most of the reasons why I think its limited are due to the software.

The only hardware complaint is its not very small. :)
While board area doesnt matter much, yours is rather thick.

Here is a list of software issues I can think of in my jet lagged state. ;)
  • Its not open in any sense of the word. The chip is a black box.
  • Fixed serial speed.
  • You can only use serial while SPI and I2C can be more useful in many circumstances.
  • No feedback. I'm thinking of implementing 'slow down' feedback so if the buffer gets full then data isnt lost.
  • Its a 'dumb' chip. It only does what its told. It cannot do any cool things like automated custom character animation or ticker displays which are perfectly possible and reduces the load for the device controlling it.
  • It cannot be upgraded. If Peter makes a new version then you need to buy a new chip.


The board size is dictated much by the real estate required for the various hole sets to connect to various pinouts, and by my desire to keep the board as a through-hole project to make it useable by a broader range of hobbyists. the ExpressPCB boards is a bit thick, but since I aimed it at being hung onto the back of the display by it connector, the extra thickness serves to strengthen  the board.

Granted it is 'closed.' Peter's chip is proprietary.  The income through the years from that chip alone has gone a long way to fund projects for his students. I have no problem with that. As for 'upgrades' and 'having to buy a new chip' there's been one upgrade  almost two years ago and  a 'silent' upgrade (no chip designation change) two months ago (Fixed a bug John Carter and I each discovered independently that had been around for three years without being discovered).

I don't see fixed baudrate as a problem. The tradeoff in variable baudrates can be erratic, unpredictable startup.

No Feedback ... that would be nice, the cost is another connection  and i/o line

SPI/I2C ... yes, it could be handy, but again more complexity.

You are right and wrong about 'special features' there is some provision to send binary commands that could enable dot-row/column scrolling and other 'special effects.' But that indeed does pass an increased burden on the host processor.


cheers ... BBR
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Jan 24, 2008, 09:59 am
Quote
I don't see fixed baudrate as a problem. The tradeoff in variable baudrates can be erratic, unpredictable startup.

I've got a simple solution to users borking their baud rates. :)
Just a a pair of contacts. Short them out with a screwdriver or similar and apply power. Resets to defaults.

Quote
No Feedback ... that would be nice, the cost is another connection  and i/o line

The feature would be completely optional. I2C and SPI can have a polled mode where the host asks if its ok to send.
If your using serial and dont have a spare gpio then you just ignore it.

Quote
You are right and wrong about 'special features' there is some provision to send binary commands that could enable dot-row/column scrolling and other 'special effects.' But that indeed does pass an increased burden on the host processor.

Well I did say that the chip was 'dumb' and only did what it was told. :)
I dont see why you wouldnt add in special effects considering the chip is mostly idling and it cant be using too much flash space.

I'll hopefully have a beta firmware in a week or two. :D
Then I can get a prototype going and calculate costs and stuff like that.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Atmoz on Feb 02, 2008, 05:13 pm
Quote
Here's a basic code to display text, lines and dots. Original c code came from Massimo. I already posted it to the forum, but thing get easily lost here. i know it should be up on the playground. but me too got distracted from it by other projects. The circuit i use never got updated, like i planned, using a proper 3,3v regulator for the display. i'm doing other stuff lately with arduino running on 3.3v so i might get back to it.

here the lazy circuit http://flickr.com/photos/12058013@N07/2203300707/ using 4 diodes to reduce voltage to appr. 3.2v and voltage dividers for communication.
here's a basic version of the code [again here, and not on the playground, so maybe we could clean it up build a library from it together]:
Code: [Select]


....



Wow, that sounds very nice 8-)
I'm a starter with this "Arduino" things, but it looks really nice all this!!

The code what you've wrote (in 4 parts) is that only for a ATmega168 (for the Arduino) ??
Or can I use it also for example a ATmega48 or something?

Thanks in advance,

Atmoz
Title: Re: LCD shield and/or LCD serial backpack
Post by: leKuk on Feb 02, 2008, 05:29 pm
hi atmoz,

the code should be easily portable. in fact the original code was written for a pic if i rememeber correctly. the only arduino specific thing should be the pins definition at the beginning.

best, kuk
Title: Re: LCD shield and/or LCD serial backpack
Post by: Atmoz on Feb 02, 2008, 05:56 pm
Quote
hi atmoz,

the code should be easily portable. in fact the original code was written for a pic if i rememeber correctly. the only arduino specific thing should be the pins definition at the beginning.

best, kuk



Hello Kuk,

Thanks for the fast reply.
Sounds really nice again!! So only change

Code: [Select]

int LCD_POWER_PIN = 11;
int LCD_DC_PIN    = 2; //  PB0  4 Data Command
int LCD_CE_PIN    = 3; //  PB2  5 /CS   active low chip select ??
int SPI_MOSI_PIN  = 4; //  PB3  3 Serial   line
int LCD_RST_PIN   = 5; //  PB4  8 /RES RESET
int SPI_CLK_PIN   = 6; //  PB5  2 CLOCK



into the right pins at an ATmega48?
Nothing else? clockspeeds, timings, etc??

[edit]

I don't have a Arduino yet, so I can't test it. Therefore I ask this :)
Title: Re: LCD shield and/or LCD serial backpack
Post by: leKuk on Feb 02, 2008, 06:27 pm
note that the out commented port names are from the original code. well, so i guess it was AVR rather than pic.
Quote

Nothing else? clockspeeds, timings, etc??


ok. good you're asking again.
there's a little arduino specific stuff inside which boils down to delayMicroseconds() at some places, i think. your compiler should warn you if there's more. you can just replace them with something else that "delays" the program. but i've not touched the code for over a year. it really was on of the first thing i hacked together when i got my first board. i just posted it to encourage others to work with the display.

timing isn't crucial here because of the spi clock line. i think the display was very tolerant. but really, if your not working with the arduino IDE at all, you might be better of checking out those links provided by follower a few posts up. the only thing "special" about my code is that it works on an arduino like it is. plus, i removed the lowercase letters from the bitmap to make it fit into an atmega8. more a bug than a feature.

kuk

Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 06, 2008, 08:14 am
Ok I've been perfecting the PCB and double checking prices.
It looks like I can easily make them for $10 each. :)

I'll plan how I'm going to organize distributing them and then I will start making. :)
Title: Re: LCD shield and/or LCD serial backpack
Post by: Atmoz on Feb 06, 2008, 10:24 am
Quote
Ok I've been perfecting the PCB and double checking prices.
It looks like I can easily make them for $10 each. :)

I'll plan how I'm going to organize distributing them and then I will start making. :)


Sounds good :D
Let us know when they are ready. I think I'll order some :) (and hopefully the shipment costs aren't that much...)

And thanks for the answer kuk!

Regards,

Atmoz
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 07, 2008, 12:24 am
Assuming Australia Post calls it a letter and not a parcel, shipping will only be about $3.85 AUD. :)
To the US it should take about 4 - 6 days.

This is using Australia Post's online calculator so it may not be exact. I need to find out more details.
http://www1.auspost.com.au/pac/int_letter.asp
Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Feb 07, 2008, 11:24 am
Cheater, sounds good, looking forward to hearing when you are ready to ship.

According to the oz post web site, items smaller than 260mm x 360mm and under 20mm in thickness count as a letter.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 08, 2008, 03:01 am
http://www.megaupload.com/?d=AXTX2AHO
There is the brd and sch files for it. Can someone double check it? ;)

It features a ATmega8 core with Power, SPI, I2C, Serial, Reset and Wait pins on one side.
The other side matches a LCD's pinout including backlight pins.

Two transistors power the contrast and the backlight.
The contrast one has a capacitor to try and smooth out the voltage. I'm thinking 0.1uf but I'm not sure.
I'm also not sure if the resistor on the contrast transistor is required. If it isnt then it means less parts to worry about.

The pull up resistor for the reset pad will be 10k.
I'm not sure about the lcd backlight one. I use 100ohms on my lcds and it works fine but I'll be reading the datasheets to be sure.

Any suggestions for part values would be greatly appreciated.
I'm going for low part count because Futurlec only sells in batches of 5,000 and I dont want too many different values.
My main concern is the contrast capacitor.
Title: Re: LCD shield and/or LCD serial backpack
Post by: leKuk on Feb 08, 2008, 09:08 am
looks like you have to be registered to get the file from megaupload!? maybe rather post an image file, so we can see it here?

Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Feb 08, 2008, 10:56 am
Quote
looks like you have to be registered to get the file from megaupload!? maybe rather post an image file, so we can see it here?

kuk, you just have to wait a minute before it does the download. The invitation to register is for instant downloads.

I got the file and a quick glance on eagle looks good. But I don't have enough PCB design experience to review the design.
Title: Re: LCD shield and/or LCD serial backpack
Post by: leKuk on Feb 08, 2008, 11:06 am
ah, thanks. i think i got distracted by the german translation of the page :-) looked like a redirect.
Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Feb 08, 2008, 01:46 pm
kuk, es gibt kein problem  :)


cheater, I have 3 or 4 LCDs in my parts box and wonder if its worth testing the contrast and backlight circuits on them using my arduino. If you want to modify the transistor driver code so it works with the arduino's  timers running on a 16mhz clock then I would be happy to test this on my breadboard.

I don't need the code for the LCD data for this test but would be happy to look at that if it would help you.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 08, 2008, 10:13 pm
Thanks mem. I'd love it if you could test PWM with a 0.1uf capacitor on the contrast.
I'd do it but I dont seem to have any transistors around. I could scrounge one....

No code yet. I'll whip it up once I get the PCBs. :)
Just test with AnalogWrite for now.

I've created a Sourceforge project for this to keep everything nice and tidy.
I'll be setting it up today.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 09, 2008, 01:32 am
Just tested (very roughly) without a transistor and it seems that the contrast acts just like a normal LED.
Ripple isnt a problem. A 0.1uf capacitor should just smooth things out a bit though.

Ok last questions:
Is a resistor required on the LCD's backlight? Sparkfun doesnt use one. I'd imagine it would be fine.
And is a resistor required on the transistor's base? I wouldnt think so.

I will be rather happy if I can ditch two resistors. :)
I'll then be able to order.

Current parts list (assuming I can ditch two resistors):
2x 0.1uf 0805 capacitor
2x BC817 SMD NPN transistor (0.8A max)
1x 10k 0805 resistor
1x ATmega8 QTFP
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 10, 2008, 10:07 pm
My bad. The ATmega8 doesnt have enough PWM and I forgot about slave select. :)
I've now got it with a ATmega168 which has more PWM and more space which should be good.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 11, 2008, 07:25 am
Just a update: I have the OpenLCD website up.
http://openlcd.sourceforge.net/

Eagle files (completely different to whats posted above) are in SF's release system.
http://sourceforge.net/project/showfiles.php?group_id=217002

Can someone do a quick check on the circuit to make sure it will work before I order a large stack of them?
I figured that its only slightly more to get ~138 of them as it is to get 25 of them so why not.
I dont want that many coasters though. ;)
Title: Re: LCD shield and/or LCD serial backpack
Post by: chrisco on Feb 12, 2008, 08:49 am
Just a question: You do not provide a ground signal to your SPI, SER and I2C connectors. I would have expected these to have a ground since they are not differential. Am I missing something?
Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Feb 12, 2008, 07:12 pm
Cheater, The 3d view shows the header pins for the LCD and arduino interface on the same side of the board.  If I am visualising this correctly, I presume the arduino interface header will be mounted on the opposite side of the board to the LCD header.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 12, 2008, 08:53 pm
Quote
Just a question: You do not provide a ground signal to your SPI, SER and I2C connectors. I would have expected these to have a ground since they are not differential. Am I missing something?

Yes your missing the 5V and the GND connector on it. ;)
The user will have to connect all the grounds together themselves if power and signal are coming from two different sources.
Quote
Cheater, The 3d view shows the header pins for the LCD and arduino interface on the same side of the board.  If I am visualising this correctly, I presume the arduino interface header will be mounted on the opposite side of the board to the LCD header.

Yep. The 3d view looks pretty but its not perfect.

Btw xSmurf made me add RS232 to the list of interfaces it supports. :)
Going to see if I can fit a crystal on it, if not then I'll order.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Severino2020 on Feb 14, 2008, 02:09 am
There was a demo of a LCD shield at the last NYC hack lab.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 14, 2008, 05:37 am
Well 100 PCBs are now coming to me along with 4,000 capacitors and 5,000 resistors. :)
I'll have enough to populate 30 PCBs. The Atmel chips get expensive quicky ($100 for 30).

Around half are earmarked for this first run so about 10 will be for sale. :)
If they are popular then I can have another batch ready within about 5 days after that.

Quote
There was a demo of a LCD shield at the last NYC hack lab.

Interesting. Got a url?
Title: Re: LCD shield and/or LCD serial backpack
Post by: tkbyd on Feb 14, 2008, 10:57 am
A shield is great for some things... particuarly "plugging in" lots of connections to something external. However, to add an LCD panel to my Arduino, I only need to tap the serial line and 5v and 0v if I spend $8 for a complete kit of parts (except the panel itself) for the great little LCD panel controller from ModernDevice.com (no "S" in that). It is an implementation of Peter Anderson's #117.

"Except the panel..." The kit lets you interface a wide range of panels to the Arduino. Hence the need to purchase it "separately". ModernDevice offer a selection. Some only $12, if memory serves.

It should even be possible to drive the thing from something other than the serial out pin, but that would entail a little more software work. If you are willing to use the serial pin (and that won't stop you uploading programs to the Arduino) then all you need is.....

setup()
{
serial.start(9600);
}
loop()
{
serial.Print("Hello world");
}

Why reinvent an already available wheel? There are so many other worthy projects waiting out there!!

(My only association with ModernDevice: Happy customer.)
Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Feb 14, 2008, 11:37 am
Quote
A shield is great for some things... particuarly "plugging in" lots of connections to something external. However, to add an LCD panel to my Arduino, I only need to tap the serial line and 5v and 0v if I spend $8 for a complete kit of parts (except the panel itself) for the great little LCD panel controller from ModernDevice.com (no "S" in that). It is an implementation of Peter Anderson's #117.

"Except the panel..." The kit lets you interface a wide range of panels to the Arduino. Hence the need to purchase it "separately". ModernDevice offer a selection. Some only $12, if memory serves.

It should even be possible to drive the thing from something other than the serial out pin, but that would entail a little more software work.

Why reinvent an already available wheel? There are so many other worthy projects waiting out there!!

(My only association with ModernDevice: Happy customer.)
If  TTL serial is the only interface required then the board kit in your  link is a dollar cheaper (on the moderndevice.com page its shown as $9 plus shipping). But for some applications (like mine), the hardware serial port is not available (its used for data logging to a PC) and the baud rate (even at 19200) is too slow to use a software uart. For those of us that have real time applications that need something like an i2c interface, a serial only board won't cut it.

But even if my application didn't require the higher prformance, the board being discussed in this  thred has greater appeal for me because for the cost of an extra dollar its much more flexible than a serial only board.

Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 14, 2008, 11:54 pm
Quote
Why reinvent an already available wheel? There are so many other worthy projects waiting out there!!

Reasons?
I can list them:


I actually wanted to buy a serial LCD controller but I couldnt find any which were half decent.
They were all closed source and only had TTL Serial and maybe RS232 interfaces.

Also I have a source which sells LCD panels at $7.90 for 16x2 with backlight in single quantities or $5.90 in bulk.
$12 can buy two. ;)

[EDIT] Oh and if these LCD controllers are popular then I will be going on to tackle things like graphical LCDs and other trickier hardware. [/EDIT]
Title: Re: LCD shield and/or LCD serial backpack
Post by: chrisco on Feb 15, 2008, 12:28 am
I thin the other reason is that it is a lot of fun :)

The 16x2 LCD board is great and I would also be interested in the Graphics board. I am thinking of using this with "sensor shields", e.g. I want to monitor the depth of a water tank using a pressure sensor.Chris
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 15, 2008, 12:51 am
Quote
I thin the other reason is that it is a lot of fun :)

Oh of course. :D
Title: Re: LCD shield and/or LCD serial backpack
Post by: John_Ryan on Feb 15, 2008, 01:37 am
Quote
Quote
Why reinvent an already available wheel? There are so many other worthy projects waiting out there!!

Reasons?
I can list them:

  • Mine is faster and can do more. (ATmega168 vs PIC with 4k flash)
  • Mine is completely open, both hardware and software. The 117 is code protected and no source is provided.
  • Mine has four different interfaces (SPI, I2C, TTL Serial and RS232) compared to only TTL Serial on the 117.
  • Mine is cheaper. $10 for premade and $8 for a kit (SMD components however).
  • Mine is significantly smaller. Under a third of the size of the ModernDevice board.
  • And probably a few other reasons I've forgotten. :)


I actually wanted to buy a serial LCD controller but I couldnt find any which were half decent.
They were all closed source and only had TTL Serial and maybe RS232 interfaces.

Also I have a source which sells LCD panels at $7.90 for 16x2 with backlight in single quantities or $5.90 in bulk.
$12 can buy two. ;)

[EDIT] Oh and if these LCD controllers are popular then I will be going on to tackle things like graphical LCDs and other trickier hardware. [/EDIT]


I'm convinced. I'm currently enjoying my relationship with I2C so I'm keen to see what else I can add to the chain.

So, for 2 units ($20) including 2 16x2 LCD panel's ($12), it's $32 + shipping. Sounds a bit light.

When will they be available off-the-shelf?
Title: Re: LCD shield and/or LCD serial backpack
Post by: xSmurf on Feb 15, 2008, 09:17 am
Quote
Just a question: You do not provide a ground signal to your SPI, SER and I2C connectors. I would have expected these to have a ground since they are not differential. Am I missing something?


Told you Cheats...
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 15, 2008, 10:46 pm
Quote
Told you Cheats...

Why cant the SPI use the same GND as the power? :-?
There is a GND pin right next to VCC.
Title: Re: LCD shield and/or LCD serial backpack
Post by: xSmurf on Feb 16, 2008, 05:40 am
Oh they can, that's not the issue. Afaik, the issue is that it's not clear to the user that these lines must be tied together; especially since gnd is already filled.

EDIT: Funny enough, someone just posted this :P
Quote
As a rule of thumb, you always need to connect the ground between two devices which talk to each other.

Title: Re: LCD shield and/or LCD serial backpack
Post by: blalor on Feb 20, 2008, 09:18 pm
Nick, I'm definitely interested in your OpenLCD project.   I started playing around with a 16x2 display last night, starting with the 8 bit interface and then going to 4, and then this morning I was thinking that it should be simple (and cheap) to delegate control to another Arduino chip.  Lo and behold, I stumble upon this thread!  ;D  So, please keep us posted on your progress!  I'd love to see some code in the SF SVN repository... (hint, hint! ;))
Title: Re: LCD shield and/or LCD serial backpack
Post by: blalor on Feb 20, 2008, 09:34 pm
Ok, so now that I'm thinking about it, is the ATmega168 going to be running the Arduino bootloader (and thus be reprogrammable by other Arduino users) or will it have its own "OS"?
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 20, 2008, 10:48 pm
Quote
Ok, so now that I'm thinking about it, is the ATmega168 going to be running the Arduino bootloader (and thus be reprogrammable by other Arduino users) or will it have its own "OS"?

It will be a Arduino but the reprogramming feature will be optional.

Basically the EEPROM will store a whole pile of settings.
One of the settings will be if you want the bootloader turned on or not. :)

I should get the PCBs early next week hopefully.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 22, 2008, 11:02 am
Update: The PCBs are on their way and will arrive on Monday.
Now to chase up the components.....
Title: Re: LCD shield and/or LCD serial backpack
Post by: blalor on Feb 22, 2008, 12:40 pm
Quote
Update: The PCBs are on their way and will arrive on Monday.
Now to chase up the components.....

Sweet!  The more I build up my current project (an intervalometer for my camera), the more I realize I need some way to offload the LCD connections somewhere else.  I'm using every single pin and I still want to do things like toggle the backlight and add another button or two.  Ugh.  And I'm already using 4 bit mode, which is noticeably slower than 8 bit!
Title: Re: LCD shield and/or LCD serial backpack
Post by: aballen on Feb 24, 2008, 07:14 am
Cheater will this support the KS0108 graphical LCDs?
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 24, 2008, 07:23 am
Quote
Cheater will this support the KS0108 graphical LCDs?

No it wont but thats next on my list if these take off.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 25, 2008, 12:11 pm
Update: The PCBs have arrived. All 109 of them. :D

Boy are they tiny. About the width of my thumb and its significantly longer than them. ;)
Should be fun soldering. 11 components have to fit in to that tiny space.
Title: Re: LCD shield and/or LCD serial backpack
Post by: aballen on Feb 26, 2008, 03:45 am
cheater are you going to sell them?  I would like to pick one up for a 4x20 I have
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Feb 26, 2008, 08:35 am
Quote
cheater are you going to sell them?  I would like to pick one up for a 4x20 I have

Yeah just waiting on the SMD parts to go on the PCBs.
Should have some made along with all the programming done in a couple of weeks.

If you want to see the PCBs then go here: :)
http://flickr.com/photos/23538048@N02/sets/72157603990507227/
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Mar 03, 2008, 12:08 pm
I have a *really* shocking ability to judge sizes from a photo.
0805 is freaking tiny. ;)

I've finally gotten all the parts and I've got one board half done.
TQFN parts are a pain. Nearly got it first shot but cant line it up properly now. :(
I'll try again tomorrow.
Title: Re: LCD shield and/or LCD serial backpack
Post by: aballen on Mar 17, 2008, 02:09 am
whats the word cheater, been over a month since your last post on this one?
Title: Re: LCD shield and/or LCD serial backpack
Post by: Cheater on Mar 17, 2008, 02:14 am
I've got a whole pile soldered up. :)

Problem is programming them now.
I need to figure out a way to attach the programmer without soldering anything.
Its difficult. :(
Title: Re: LCD shield and/or LCD serial backpack
Post by: Digger450 on Mar 20, 2008, 05:33 am
How about pogo pins a.k.a. bed of nails?
Title: Re: LCD shield and/or LCD serial backpack
Post by: spiffed on Mar 20, 2008, 06:34 am
Copper finishing nails and a block of wood make an ideal test bed.
I find the easiest method is to place the PCB over the block of wood and drill _tiny_ holes through any vias/holes in the board and through the wood (use a drill press). From this I can usually bang copper nails in nice and straight.

How you wire the test bed is an exercise for the reader. Perhaps an Arduino pumping data into the board and also emulating an HD44780 comparing input to expected output?
Title: Re: LCD shield and/or LCD serial backpack
Post by: sunnymag on Apr 15, 2008, 08:55 am
so what ever happened to your project?

did you get them programmed?
Title: Re: LCD shield and/or LCD serial backpack
Post by: jmonroe on Apr 25, 2008, 06:14 pm
Yeah, if you get these programmed and for sale, I think I would be interested in one.  Software Serial is just not cutting it for me.
Title: Re: LCD shield and/or LCD serial backpack
Post by: mikeasl on Apr 29, 2008, 05:00 pm
Just to add my order for 2 of these... Please update us on your progress....
Mike...

Title: Re: LCD shield and/or LCD serial backpack
Post by: salsaman on Sep 16, 2008, 04:16 am
ping.... ing.... ing....?

this thing on?

sure would love a few of these LCD backpacks...:)

any word?  it has been a little while...
Title: Re: LCD shield and/or LCD serial backpack
Post by: follower on Sep 16, 2008, 03:29 pm
Given his recent absence from IRC I think Cheater has been a little...distracted. :D

--Phil.
Title: Re: LCD shield and/or LCD serial backpack
Post by: yabb2008 on Sep 17, 2008, 12:31 am
There is an LCD shield available from NUELECTRONICS in the UK
Title: Re: LCD shield and/or LCD serial backpack
Post by: ipatt on Sep 18, 2008, 02:01 pm
Hi, I'm interested in getting 3 to 5. Are they shields or backpacks? How do I order and what is the cost? Do you have a site with photos?

Thanks
Title: Re: LCD shield and/or LCD serial backpack
Post by: mem on Sep 18, 2008, 02:23 pm
there is info on the nuelectronics lcd shield here:
http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=2

and the sparkfun lcd backpack here: http://www.nkcelectronics.com/serial-enabled-lcd-backpack.html
Title: Re: LCD shield and/or LCD serial backpack
Post by: seratechi on Sep 18, 2008, 05:34 pm
If there are enough people interested, we are glad to host for a new batch of PCBs. Check it out here: http://www.seeedstudio.com/depot/propanganda-pcb-service-for-open-source-works-p-111.html

:)
Title: Re: LCD shield and/or LCD serial backpack
Post by: JustinHoMi on May 17, 2009, 07:33 am
Any progress?
Title: Re: LCD shield and/or LCD serial backpack
Post by: vinnygx3pimp on Jun 07, 2009, 05:39 am
I'll buy one
Title: Re: LCD shield and/or LCD serial backpack
Post by: thoed on Oct 04, 2009, 03:25 pm
I tried reading the previous.. 6 pages.. haha got a headache! So hopefully this wasn't discussed too much, but,

Is there a library for this? I'm looking to turn my Atmega 168, or 8 into well, an LCD controller that works via Serial. (I don't really need I2C or SPI, just seems like more unneeded code!:D)

I did see most of the serial backpacks use the PIC16blahblah, but I'd prefer to stick with AVR.

But I agree, count me in for one!
Title: Re: LCD shield and/or LCD serial backpack
Post by: florinc on Oct 04, 2009, 03:44 pm
Did you guys see this?
http://www.sureelectronics.net/goods.php?id=969
Title: Re: LCD shield and/or LCD serial backpack
Post by: mowcius on Oct 05, 2009, 03:56 pm
Well it's not an arduino LCD shield but it is cool with the controller and because it's from sureelectronics it's really cheap!

I like it! :D

Mowcius
Title: Re: LCD shield and/or LCD serial backpack
Post by: Reggie on Oct 11, 2009, 12:15 am
How does the backlight work on these LCDs?  Is it a pair of coloured leds?  I've got a backlight from a broken LCD (the backlight still works) but it looks different to the nuelectronics shield backlight, the busted one has a single anode/cathode pair of pins that are on a white bit of plastic that is the base, the nuelectronics has 2 pairs of A/K and look like they go into to little square lumps of plastic (like leds :D) .  

The busted one looks like an EL panel style light box, although I thought they need specific power supplies for driving them, I just connected the AK to a pair of 5v with a resistor. I don't want to destroy it as it can be used elsewhere but i would like to know about swapping out either the whole nuelectronics backlight or if it simply means replacing some leds that would be cool as I'd prefer a red backlight  or maybe even break out my own RGB kind of thing for it (red for protecting night vision as bright green/blue light is a pita for astronomy).
Title: Re: LCD shield and/or LCD serial backpack
Post by: mowcius on Oct 11, 2009, 12:58 pm
Quote
How does the backlight work on these LCDs?  Is it a pair of coloured leds?  I've got a backlight from a broken LCD (the backlight still works) but it looks different to the nuelectronics shield backlight, the busted one has a single anode/cathode pair of pins that are on a white bit of plastic that is the base, the nuelectronics has 2 pairs of A/K and look like they go into to little square lumps of plastic (like leds) .  


They are normally tiny surface mount LEDs on the bottom of the display with a diffuser... They are not easy to replace.

Quote
red for protecting night vision as bright green/blue light is a pita for astronomy


Yes, red is best for astronomy... :D Just out of interest, what is the astronomy project? I haven't seen many around...

Regards,

Mowcius
Title: Re: LCD shield and/or LCD serial backpack
Post by: Reggie on Oct 11, 2009, 03:52 pm
Hi Mowicus, This is our project: http://tech.groups.yahoo.com/group/sgl_observatory_automation/  the part of the project that I am coding/building  is the dew heater control, to keep moisture off the objective (Front lens on a telescope) while we take long exposure images.  the main part of the project at the moment is the focuser controller, it ties in with the astronomy software to allow us to do things like autofocus (or at least it will do when we're finished).  Most of the stuff in our project has been done before, we're just pulling it together to work with newer kit and a cheap fairly robust development board platform, arduino gives us that and a basis for other projects.

There are quite a few random DIY astronomy projects and electronic mods around, some really phenominal ones (Given the technology), the best 2 or 3 are EQMod, the Philips Toucam/SPC900NC Long exposure/amp off mod and anything that involves a canon EOS DSLR (IR Filter removal and replacement, peltier cooling/coldfinger mod) :D

EQMod takes a standard skywatcher EQ mount and adds (for free) so many software enhancements its untrue.

The long exposure mod is a little add on circuit that allows you to control long exposure on a philips toucam/vesta/spc9009c webcam via the serial port.

IR Filter removal on a canon (or nikon) DSLR increases the cameras sensitivity to Ha by about 5x, reducing exposure time and noise in the process.  The peltier mod cools the CCD/Cmos sensor reducing amp noise to a point where its almost non-existent :)

Head over to http://stargazerslounge.com/ and take a look around in the equipment>>DIY section, there are quite a few mods, one guy is working on an observatory dome automation project where the opening in the observatory roof tracks the orientation of the telescope so he doesn't have to continually move the opening himself throughout the night.
Title: Re: LCD shield and/or LCD serial backpack
Post by: mowcius on Oct 12, 2009, 12:23 pm
Cool, I will have a detailed look at that a bit later...

Mowcius
Title: Re: LCD shield and/or LCD serial backpack
Post by: Reggie on Oct 12, 2009, 01:45 pm
I had a good look over the SPC900nc webcam mods again last night, Dived through some datasheets etc. I'd like to expand on them software wise if its possible.  I originally did the 'dead bug' method which is just a switch IC that's pulled high/low by the serial port when high it stops the sensor clocking out the data.  

As a method it works but its crude, you can't always grab the correct frame when you a taking the 'snapshot' so I'd like to delve a little deeper to work out the timing delays, I'd also like to try and talk to the video processor/mu/ccd Sensor directly and grab my own data and take control of the special function registers, it all looks serial/spi or i2c based until it hits the usb cable.
Title: Re: LCD shield and/or LCD serial backpack
Post by: Niord on Oct 14, 2009, 01:18 am
I want one!! It sound great.
Title: probelm between connection- nokia 3310 lcd and arduino
Post by: nathanas on Jun 22, 2010, 11:06 pm
hi guys!
I am reading articles for 2-3 days about the nokia lcd and arduino programming.
I have my Nokia 3310 LCD but i can't manage to make it work...


nothing happens to the lcd when I upload the code...It never turns on.
I have gt it out of a working Nokia, and it was working before...
I don't know how to test if it works....
the pins are connected correctly.

WHat is wrong???The lCD should write "hello world!" when i power on my arduino....
I have the Duemilanove board!
Title: Re: LCD shield and/or LCD serial backpack
Post by: nathanas on Jun 22, 2010, 11:08 pm
the link of the code is this one....
http://www.arduino.cc/playground/Code/PCD8544
I use the first part with the "hello world!" message!

Its the first time I try to connect an LCD, so whatever you think is obvius, it might not be for me...
please help me finish my first lcd project!
thank you!
Title: Re: LCD shield and/or LCD serial backpack
Post by: nathanas on Jun 23, 2010, 07:59 pm
someone to help???
Title: Re: LCD shield and/or LCD serial backpack
Post by: nathanas on Jun 26, 2010, 05:04 pm
i think the first time i connected the pins in reverse...
so at pin 1 i connected pin8  etc.
is it possible for the lcd to be burned?
The code on the atmega was the fisrst part of the example..
Title: Re: LCD shield and/or LCD serial backpack
Post by: yashar on Jan 21, 2011, 11:45 am
Hi All,

I have a TTL module (USB to Serial), can I use it serially to write on LCD 16x2 in real time?

Thanks in advance.
Yashar