sed1335 displaying multiple times the same text & graphi

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all, i'm in the need of a little support on the RA8835 Controller which is said to be exactly the same as the SED1335.

I used the Library from AVRfreaks ("Graphic LCD library for SED133x") but I'm getting quite weird results.
Actually it seems to me that the RA8835 isn't initialized properly and "thinks" that I have a smaller display. The thing it does is just display everything 4 Times. If I set a pixel at 0,0 I automatically get copies of it at 0,59 0,119 0, 179.
It's even the same with text. Line 0 is copied to line 6 and so on.
Drawing one big rectangle and writing a line full of 5x7
characters results in this:

I've been reading the Datasheet for hours now but I'm still not totally sure if I'm sending the right init. to the display.

The init sequence I'm using at the moment:

 lcd_write_command(0x40); 
  lcd_write_data(56); //38
  lcd_write_data(133); // Fx
  lcd_write_data(0x07);    // Fy
  lcd_write_data(39); // C/R
  lcd_write_data((LCD_XTAL / 64 / LCD_Y_SIZE) / 9);
  lcd_write_data(79);  
  
  lcd_write_data(30);    
  lcd_write_data(00);        
  // Scroll


  lcd_write_command(0x44); 
  lcd_write_data(0x00);    
  lcd_write_data(0x00);    
  lcd_write_data(159);
  lcd_write_data(0x00);      
  lcd_write_data(0x10);      
  lcd_write_data(159);


  
  // Overlay
  lcd_write_command(0x5b);  
  lcd_write_data(0); // or   
  
  // Display On/Off I
  lcd_write_command(0x58);
  //lcd_write_data(0x14);     
  lcd_write_data(84);  
  
  // Horizontal scroll
  lcd_write_command(0x5a);  
  lcd_write_data(0x00);     

     
  // Cursor format
  lcd_write_command(0x5d); 
  lcd_write_data(0x01);    
  lcd_write_data(0x06);    
  // Display On/Off II 
  lcd_write_command(0x59);   
  lcd_write_data(84);      
  // Curson direction  
  lcd_write_command(0x4c);          
  // CUrsor write  
  lcd_write_command(0x46);
  lcd_write_data(0x00); 
  lcd_write_data(0x00); 

The display is a two-panel 240x160 "BP240160" made by Bolymin.

Does anybody have experience with this RA8835 or has encountered similar problems as I have? :| :)

cheers,
Nik

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used a 1335 back in ought-ought, but its on my computer at work, and I'm at home. Funny... chinese guys can look at my computer at work from their home, but I'm too stupid to figure out how to do that. Wait this sounds cooler... "The ancients gave me the secret of the 1335 in the last millenium"

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's my init routine for the SED1335 that I wrote some time ago.

I remember I also stared myself stupid on the datasheet for a few days before I had it working.

When I finally got it working, i was so ecstatic that I dug up some oldskool 3D Rotating Cube code, and ported it to the NXP ARM7 I was using.

I even put it on youtube !:o

As you can see in the video I had a logic analyzer hooked up to it to see if all was going as I coded.
Don't mind the music though, seems a bit embarrassing now. I must of really been happy to get it working. 8)

The only thing limiting the frame rate was the bus, I pushed the timings to the limit, so you can see some garbage on the bottom of the LCD.

http://youtube.com/watch?v=SKaxWz6Krcg

void lcd_init(void)
{
  u32 i;

  LCD_command(0x40);
  LCD_writeParam(0);
  LCD_writeParam(0);

  for (i=0;i<0xFFFFF;i++);

  /*=======================================================================================*/	
  /*                       Reg	 Value              Info                              */
  /* SYSTEM SET */
  LCD_command(0x40);			
  LCD_writeParam(0x30);	// 00h	 00110000 (0x30)	IV & Single Panel
  LCD_writeParam(0x87);	// 01h	 10000111 (0x87)	Horizontal Character size & (MOD=1)
  LCD_writeParam(0x07);	// 02h	 00000111 (0x07)	Vertical Character size
  LCD_writeParam(39);	  // 03h    39					 C/R   Characters/Row - 1
  LCD_writeParam(42);	  // 04h	 42					 TC/R  Total Character bytes / Row
  LCD_writeParam(239);	 // 05h    239				   L/F   Frame height in lines - 1			
  LCD_writeParam(40);	  // 06h    40                Horizontal Address Range 0
  LCD_writeParam(0x00);	// 07h	 00000000 (0x00)	Horizontal Address Range 1

  /* SCROLL */
  LCD_command(0x44);
  LCD_writeParam(0x00);	// 0Bh	 0x00				  Scn Blk 1 StrtAdr L	  [TEXT AREA]
  LCD_writeParam(0x00);	// 0Ch	 0x00				  Scn Blk 1 StrtAdr H	  [0x0000]
  LCD_writeParam(241);	 // 0Dh	 241					Scn Blk 1 Size
  LCD_writeParam(0x00);	// 0Eh	 0x00				  Scn Blk 2 StrtAdr L	  [GRFX AREA]
  LCD_writeParam(0x10);	// 0Fh	 0x10				  Scn Blk 2 StrtAdr H	  [0x1000]
  LCD_writeParam(241);	 // 10h	 241					Scn Blk 2 Size
  LCD_writeParam(0x00);	// 11h    0					   Scn Blk 3 StrtAdr L
  LCD_writeParam(0x00);	// 12h	 0					Scn Blk 3 StrtAdr H
  LCD_writeParam(0x00);	// 13h	 0					Scn Blk 4 StrtAdr L
  LCD_writeParam(0x00);	// 14h	 0					Scn Blk 4 StrtAdr H

  /* CSR FORM */
  LCD_command(0x5D);
  LCD_writeParam(0x07);	// 15h	7					Curs Width    
  LCD_writeParam(0x07);	// 16h  7					Curs Height	  b7=CM 0=underscore curs

  /* CSR DIR */
  LCD_command(0x4C);	//							Cursor Dir = Right

  /* OVLAY */
  LCD_command(0x5B);
  LCD_writeParam(0x01);	// 18h	0x01				2L / blk3-1 = txt / (L1 EXOR L2) OR L3

  /* HDOT SCR */
  LCD_command(0x5A);
  LCD_writeParam(0x00);	// 1Bh						Horizontal Scroll Rate = 1

  /* CSRW */
  LCD_command(0x46);
  LCD_writeParam(0x00); // 1Ch						Set Cursor Addr 0x0000
  LCD_writeParam(0x00);	// 1Dh

  /* MWRITE */
  LCD_command(0x42);    //                          Fill SAD1 with spaces
  for (i=0;i<1200;i++) LCD_writeParam(0x20);

  /* CSRW */
  LCD_command(0x46);
  LCD_writeParam(0x00); // 1Ch						Set Cursor Addr 0x1000
  LCD_writeParam(0x10);	// 1Dh

  /* MWRITE */
  LCD_command(0x42);    //                          Fill SAD2 with zero
  for (i=0;i<9600;i++) LCD_writeParam(0x00);

  /* DISP ON */
  LCD_command(0x59);
  LCD_writeParam(0x16); // A0h  00010110 (0x16)		SAD2:1 ON / No Flashing	& Curs Flash						

  /* CSRW */
  LCD_command(0x46);
  LCD_writeParam(0x00); // 1Ch						Set Cursor Addr 0x0000
  LCD_writeParam(0x00);	// 1Dh

  /* MWRITE */	
  LCD_command(0x42);	
  //LCD_writeParam('t');
  //LCD_writeParam('e');
  //LCD_writeParam('s');
  //LCD_writeParam('t');
}

bobgardner wrote:
I used a 1335 back in ought-ought, but its on my computer at work, and I'm at home. Funny... chinese guys can look at my computer at work from their home, but I'm too stupid to figure out how to do that. Wait this sounds cooler... "The ancients gave me the secret of the 1335 in the last millenium"

:o So Bob, You work at the pentagon then ?

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it"

Last Edited: Sun. Sep 16, 2007 - 02:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No... little 5 man outfit... bunch of engineers... no IT geeks.... leave all computers running on autopilot in peer to peer mode

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thx for the replies !

@thygate
I tried your settings (8x8 characters) and ohoh..magic! Now I have a little less "garbage" on the display :-)

The settings I had before were
C/R:40 (40*6 = 240)
fx:6

This sort of split my screen even in vertical direction.
Now I used:
FX:8
c/r:30(30*8 = 240..)

And the weird margin on the right side has gone. It now looks like the following:

It is as if the L/F Value wouldn't be computed correctly by the display.
The Datasheet tells me that L/F needs to be (display height / 2 ) - 1 if using a dual Panal display. (160 / 2) - 1 = 79 ... I am writing 79 to the display :|

Edit: If I try to write something to an Y Position > 40 (160/4) It just doesn't show up on the screen.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ahhhh!!! The riddle is solved!!
I've been thinking it was a two-panel display for all the time. I tried single panel mode a couple of times but nothing showed up at all, so I assumed it was a two-panel display.

Well, I switched back to single Panel mode and adjusted the contrast voltage a little bit-and guess what - all perfect now :-)

I would have never thought the contrast would change by changing the single/dualpanel mode...oh my god..wasted 2 days :roll:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nikbamert wrote:

I would have never thought the contrast would change by changing the single/dualpanel mode...oh my god..wasted 2 days :roll:

I thinks I actually had the exact same issue, wasted a few days on it aswell.

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The contrast changes, because the duty cycle for the pixels changes. It's the same thing when you go from one line to two line mode with character displays.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.