CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

LCD nokia clone + 16F877

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest09
Guest







LCD nokia clone + 16F877
PostPosted: Mon Jan 12, 2009 1:48 pm     Reply with quote

Hi dear friends.

I'm reading this post
http://ccsinfo.com/forum/viewtopic.php?t=26461&highlight=nokia+6100
so i was thinking to give a try with some cheap nokia 6100 clone (sparkfun).

Does anyone knows how to connect such LCD to 16F877 ?
Can i convert the code for use with 16F877 ?
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Jan 12, 2009 5:27 pm     Reply with quote

The page on the Sparkfun site has lots of links to documents and code examples, even example code for a PIC16F87x written in CCS-C.
I've never seen an Electronics site with so much practical product info. What more do you want??? They even provide code for your processor!

Quote:
Can i convert the code for use with 16F877 ?
I don't know you can do it. Wink
Guest09
Guest







PostPosted: Tue Jan 13, 2009 2:03 pm     Reply with quote

Embarassed Mr. Green
I know i can't Very Happy

I didn't buy this lcd yet because i got some old ones from nokia 3200.
I pull them out.

My problem is more on hardware side - for now :-).
There are few examples with picmicro and 6100 but I can't find some "how to connect" tutorial for 3200 LCD. I found pinouts but heeeee ?
Code:

2   Gnd   
3   MBus   
4   Vpp   
7   FBus Rx   
8   FBus Tx   
A   Vbat+   
B   BSI   
C   BTemp

Which pins on 16F877 should I use ?
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Wed Jan 14, 2009 2:24 am     Reply with quote

Example PIC 16F87x code for CCS Compiler:
http://www.sparkfun.com/datasheets/LCD/nokial6100_ccs_c.zip
Guest








PostPosted: Wed Jan 14, 2009 7:41 am     Reply with quote

OK on the 16f877 side but what about LCD side ?
What pins of the LCD should i use, what is what.

Thank you for your help!.


LCD_RESET PIN_C0
LCD_CS PIN_C1
SPI_CLK PIN_C3
SPI_DI PIN_C4 //unused
SPI_DO PIN_C5

------------------------------------------
2 Gnd
3 MBus
4 Vpp
7 FBus Rx
8 FBus Tx
A Vbat+
B BSI
C BTemp
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Jan 14, 2009 8:02 am     Reply with quote

The pinout is at the bottom of the page referenced by the first link you gave
http://www.sparkfun.com/commerce/product_info.php?products_id=569

    Pin breakout from source code:
    LCD_CS PIN_C1
    SPI_CLK PIN_C3
    SPI_DI PIN_C4 //unused (means you don't connect this one)
    SPI_DO PIN_C5

    From Sparkfun Pinout List:
    1. VCC-Digital (3.3V)
    2. RESET -------> LCD_RESET PIN_C0
    3. SDATA -------> SPI_DO PIN_C5
    4. SCK ----------> SPI_CLK PIN_C3
    5. CS ------------> LCD_CS PIN_C1
    6. VCC-Display (3.3V)
    7. N/C
    8. GND
    9. LED GND
    10. LED V+ (6-7V)

Looks pretty straightforward to me.
Guest








PostPosted: Wed Jan 14, 2009 8:21 am     Reply with quote

Thank you dyeatman but i didn't buy this LCD yet.
Instead of this i found some old LCD's from cellular phones ( to save the environment :-) )

Sony ericsson t290
Sony ericsson t100
Nokia 3200

The pinouts that i posted are from nokia 3200.

2 Gnd
3 MBus ---
4 Vpp ---
7 FBus Rx ---
8 FBus Tx ---
A Vbat+
B BSI ---
C BTemp ---

I dont know what is FBus RX and TX, BSI, BTemp.
In cca 2 hours i will send photos and pinouts of other two model's, so please be so kind and help me out.
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Jan 14, 2009 9:30 pm     Reply with quote

What you are lisiting is the pinout of the phone not the LCD.

From what i can determine the LCD is the same one as the 6100 and has the pinout I listed earlier.

A couple of links with more info. The second one has a hookup schematic for the LCD to a PIC.

www.quantumtorque.com/content/view/32/37/

www.forum.lcdinfo.com/viewtopic.php?t=586&postdays=0&postorder=asc&highlight=3200&start=75

.
Guest








PostPosted: Thu Jan 15, 2009 1:37 am     Reply with quote

What you are lisiting is the pinout of the phone not the LCD.
- aaaaaaaa, damn.

OK, i gonna try to connect it and see what will happen :-)

Thank you for your reply's !
Guest








PostPosted: Thu Jan 15, 2009 1:58 am     Reply with quote

Sorry, one more thing.
Do you know if there is some compatibile CCS driver for sony ericcson T100 LCD. I search for on the forum but whitout succes.

I am going to search for hardware connection.

Thank you.
TYSON
Guest







stuck, NOKIA 6100 knock off LCD to PIC18F4580
PostPosted: Fri Jan 23, 2009 4:03 pm     Reply with quote

Can anyone help?
I just purchased a nokia 6100 lcd last week from sparkfun and have modified code for my 18f4580 chipset, I have modified from the example provided with lcd breakaway board Marcus Russell wrote.

After modifiy code I have been abler been troubleshooting for several days now with no luck. All I have is a the backlight working with blue screen and I have verified that the clock signal from my pic looks correct.

Could someone take a look at my code to see if I am missing something?
I know its alot to ask.....

Also I have verified that the driver/controller is an EPSON S1D15G10

Code:
//// Marcus Russell, modified by Tyson
//// Russell Evolutions Inc.
//// Nokia 6100 LCD with Epson S1D15G10 Controller
////  sample initialization program for PIC16LF872 in CCS C  3-14-07
////
//// Based on Spark Fun Electronics Code by Owen Osborn 1-22-05
////   with thanks to David Carne of SFE for DISCTL help
////   and user 'Ttelmah' from CCS C forum for SSPEN bit idea for 9-bit hardware SPI
////
//// You are free to use this code for any purpose.
////
////
//// START OF HEADER FILE ////

//#include <16F872.h>
#include <18f4580.h>
//#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //Crystal Osc (20Mhz)
#FUSES PUT                      //Power Up Timer
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOBROWNOUT               //Don't Reset when brownout detected
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD                    //No EE protection
#FUSES NOWRT                    //Program memory not write protected
#device ICD=TRUE
//#fuses HS,NOWDT,NOPROTECT,NOLVP
//#use delay(clock=20000000)

#use delay(clock=20000000)
#define LCD_RESET   PIN_D4
#define LCD_CS      PIN_D5
#define SPI_CLK     PIN_D6
#define SPI_DI      PIN_D1 //unused
#define SPI_DO      PIN_D7

#define REDLED PIN_E0
#define GRNLED PIN_E2
#define BLULED PIN_A2

#bit SSPEN = 0x14.5   // bit to turn on/off hardware SPI

// Epson S1D15G10 Command Set

#define DISON       0xaf
#define DISOFF      0xae
#define DISNOR      0xa6
#define DISINV      0xa7
#define SLPIN       0x95
#define SLPOUT      0x94
#define COMSCN      0xbb
#define DISCTL      0xca
#define PASET       0x75
#define CASET       0x15
#define DATCTL      0xbc
#define RGBSET8     0xce
#define RAMWR       0x5c
#define RAMRD       0x5d
#define PTLIN       0xa8
#define PTLOUT      0xa9
#define RMWIN       0xe0
#define RMWOUT      0xee
#define ASCSET      0xaa
#define SCSTART     0xab
#define OSCON       0xd1
#define OSCOFF      0xd2
#define PWRCTR      0x20
#define VOLCTR      0x81
#define VOLUP       0xd6
#define VOLDOWN     0xd7
#define TMPGRD      0x82
#define EPCTIN      0xcd
#define EPCOUT      0xcc
#define EPMWR       0xfc
#define EPMRD       0xfd
#define EPSRRD1     0x7c
#define EPSRRD2     0x7d
#define NOP         0x25

#define ENDPAGE     132
#define ENDCOL      130


////  START OF MAIN .C SOURCE FILE ////

//#include "<path to .h file cut from above>"
#use fast_io(C)

void pset(unsigned char color, unsigned char x, unsigned char y);
void spi_command(int);
void spi_data(int);

void main()
{


   int16 i,x;

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_spi(SPI_MASTER|SPI_L_TO_H|SPI_XMIT_L_TO_H|SPI_CLK_DIV_4);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED, 0, 1);
   set_tris_c(0x00);   // all outputs, can change to mask only hardware SPI bits if needed
   set_tris_d(0x00);   
   // reset display
   for (x=0;x<10;x++){
   
   output_low (SPI_CLK);
   output_low (SPI_DO);
   output_high (LCD_CS);
   output_low (LCD_RESET);
   delay_ms(100);
   output_high (LCD_RESET);

   //init'd, now drop CS to send commands/data and raise when finished

    spi_command(DISCTL);  // display control
    spi_data(0x0C);      // 12 = 1100 - CL dividing ratio [don't divide] switching period 8H (default)
    spi_data(0x20);      // 32 = (128/4)-1 (round up) number of display lines for scanning
    spi_data(0x0C);      // 12 = 1100 - number of lines to be inversely highlighted
    spi_data(0x00);

    spi_command(COMSCN);  // common scanning direction
    spi_data(0x01);
    // 0 0 0 =   1 -> 80   81 -> 160
    // 0 0 1 =   1 -> 80   81 <- 160
    // 0 1 0 =   1 <- 80   81 -> 160
    // 0 1 1 =   1 <- 80   81 <- 160

    spi_command(OSCON);  // internal oscialltor ON

    spi_command(SLPOUT);  // sleep out

    spi_command(VOLCTR);  // electronic volume, this is the contrast/brightness
    spi_data(0x23);   // volume (contrast) setting - fine tuning
    spi_data(0x03);   // internal resistor ratio - coarse adjustment

    spi_command(PWRCTR);  // power ctrl
    spi_data(0x0f);      //everything on, no external reference resistors
    delay_ms(100);

    spi_command(DISINV);  // invert display mode

    spi_command(DATCTL);  // data control
    spi_data(0x00);   // normal display of page/column address, page scan direction
    spi_data(0x00);   // normal RGB arrangement
    spi_data(0x01);   // 8-bit grayscale

    spi_command(RGBSET8);   // setup 8-bit color lookup table  [RRRGGGBB]
    //RED
    spi_data(0);
    spi_data(2);
    spi_data(4);
    spi_data(6);
    spi_data(8);
    spi_data(10);
    spi_data(12);
    spi_data(15);
    // GREEN
    spi_data(0);
    spi_data(2);
    spi_data(4);
    spi_data(6);
    spi_data(8);
    spi_data(10);
    spi_data(12);
    spi_data(15);
    //BLUE
    spi_data(0);
    spi_data(4);
    spi_data(9);
    spi_data(15);

    spi_command(NOP);  // nop

  pset(0b11100000, 0, 0); // red pixel top left (also sets start of bulk write, see pset routine)

  for (i = 1; i <= 16900; i++) {  // 130x130 = 16900
      spi_data(0b11100000);   // fill screen red
  }

  spi_command(DISON);   // display on

  //while (1) {  // main program loop.  just blinks A0 to show chip is running
  for (i=0;i<3;i++){
      output_toggle(REDLED);
      output_toggle(GRNLED);
      output_toggle(BLULED);
      delay_ms(100);}
      //}
   output_high(REDLED);
}
}

void pset(unsigned char color, unsigned char x, unsigned char y){
//  sets the starting page(row) and column (x & y) coordinates in ram,
//  then writes the colour to display memory.  The ending x & y are left
//  maxed out so one can continue sending colour data bytes to the 'open'
//  RAMWR command to fill further memory.  issuing any other command
//  finishes RAMWR.

  x += 2;                  // for some reason starts at 2

  spi_command(PASET);   // page start/end ram
  spi_data(x);
  spi_data(ENDPAGE);

  spi_command(CASET);   // column start/end ram
  spi_data(y);
  spi_data(ENDCOL);

  spi_command(RAMWR);    // write
  spi_data(color);
}

void spi_command(int dat){

   output_low(LCD_CS);      // enable chip
   SSPEN = 0;               // shut off hardware SPI allowing direct access to SPI in/out pins
   output_low (SPI_DO);     // output low on data out (9th bit low = command)
   output_high (SPI_CLK);
   delay_cycles(1);         // send clock pulse
   output_low (SPI_CLK);
   SSPEN=1;                 // turn hardware SPI back on
   spi_write(dat);          // make PIC do the work for the command byte
   output_high(LCD_CS);     // disable

}

void spi_data(int dat){

   output_low(LCD_CS);      // enable chip
   SSPEN = 0;               // turn off hardware SPI allowing us direct access to SPI in/out pins
   output_high (SPI_DO);    // output high on data out (9th bit high = data)
   output_high (SPI_CLK);
   delay_cycles(1);         // send clock pulse
   output_low (SPI_CLK);
   SSPEN=1;                 // turn hardware SPI back on
   spi_write(dat);          // make PIC do the work for the data byte
   output_high(LCD_CS);     // disable
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 23, 2009 4:15 pm     Reply with quote

Quote:
//#include <16F872.h>
#include <18f4580.h>

#bit SSPEN = 0x14.5 // bit to turn on/off hardware SPI

Download the 18F4580 data sheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/39637c.pdf
Look at this page on page 80 in the Acrobat Reader. It shows that
the SSPEN bit is in the SSPCON1 register.
Quote:
TABLE 5-2: REGISTER FILE SUMMARY (PIC18F2480/2580/4480/4580) (CONTINUED)


Now look at this table on page 73 of the data sheet in the Acrobat reader.
What is the address of the SSPCON1 register for the 18F4580 ?
Find the correct address and modify the value shown in bold above.
Quote:
TABLE 5-1: SPECIAL FUNCTION REGISTER MAP FOR
PIC18F2480/2580/4480/4580 DEVICES
hobiadami



Joined: 17 Oct 2006
Posts: 35
Location: City of Concrete

View user's profile Send private message Visit poster's website ICQ Number

Nokia 6100 LCD
PostPosted: Thu Jan 27, 2011 12:29 pm     Reply with quote

I'll try to interface the Nokia 6100 LCD to a pic 16F877a by using the CCS C software given at Sparkfun site.

Below are the images of the LCD that I found at a local cell phone spares shop for around 3.5$ each. It has got a green pcb and connecting wires so it should have an Epson controller. But on a page of LCD photos, an LCD similar to mine was listed as having the phillips controller. Is there a way to be sure? or can anyone verify it by its photos? Well I could have compiled the code and tested on the chip and LCD but asking on the forum might save some of my hair from going white I guess. Any help is appreciated. Thanks in advance.

http://img8.imageshack.us/i/dscn0005g.jpg/

http://img13.imageshack.us/i/dscn0007v.jpg/

http://img375.imageshack.us/i/dscn0006d.jpg/
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group