Sed13305f help!


Closed Thread
Results 1 to 8 of 8

Thread: Sed13305f help!

  1. #1
    Join Date
    Apr 2011
    Posts
    4

    Default Sed13305f help!

    Hello! i'm also new here..

    I need to send a bmp image to display(HITACHI 640X24 WITH SED13305F) but i don't know how to ,I have a program to convert bmp to asm or bas .
    So,my question is: how to include generated files to my program?
    Code:
    'HITACHI LCD 640X240 MONOCHROME 
    
    @ DEVICE PIC16F876A  ,PWRT_ON,BOD_OFF,WDT_OFF,LVP_OFF,HS_OSC
    DEFINE OSC 10		
    trisa=%00000000
    trisb=%00000000
    trisc=%00000000
    CMCON = 7
    ADCON1= 7			'Make all pins digital
    PORTA=0
    PORTB=0
    PORTC=0
    '==================================================================
    'Set pins for output
    dat      var PORTB    ;D0=21 TO D7=28      
    a0       var PORTC.0   ;11
    rd       var PORTC.1   ;12      
    wr       var PORTC.2   ;13    
    cs       var PORTC.3   ;14 
    rst       VAR PORTC.4  ;15
                        
    cs = 0 		
    RD = 0
    wr=0
    
    'Constants used
    SYS_SET		    con	$40
    SYS_SLEEP	    con	$53
    SYS_CGRAM_ADDR	con	$5C
    SYS_SCROLL	    con	$44
    SYS_SCROLL_RATE	con	$5a
    SYS_CUR_FORM	con	$5d
    SYS_CUR_ADDR	con	$46
    SYS_CUR_READ	con	$47
    SYS_CUR_DIR_RT	con	$4c
    SYS_CUR_DIR_LT	con	$4d
    SYS_CUR_DIR_UP	con	$4e
    SYS_CUR_DIR_DN	con	$4f
    SYS_OVER_LAY	con	$5b
    SYS_MWRITE	    con	$42
    SYS_MREAD	    con	$43
    LCD_DISP_ON	    con	$59
    LCD_DISP_OFF	con	$58
    LCD_INVERSE	    con	$ff
    LCD_NORMAL	    con	$00
    LCD_GRH         con $960  ;GRAPHIC HOME ADDRESS
    
    LCDL1		con	0	'Line 1
    LCDL2		con	80	'Line 2
    LCDL3		con	160	'Line 3
    LCDL4		con	240	'Line 4
    LCDL5		con	320	'Line 5
    LCDL6		con	400	'Line 6
    LCDL7		con	480	'Line 7
    LCDL8		con	560	'Line 8
    LCDL9		con	640	'Line 9
    LCDL10 CON 720
    LCDL11 CON 800
    LCDL12 CON 880
    LCDL13 CON 960
    LCDL14 CON 1040
    LCDL15 CON 1120
    LCDL16 CON 1200
    LCDL17 CON 1280
    LCDL18 CON 1360
    LCDL19 CON 1440
    LCDL20 CON 1520
    LCDL21 CON 1600
    LCDL22 CON 1680
    LCDL23 CON 1760
    LCDL24 CON 1840
    LCDL25 CON 1920
    LCDL26 CON 2000
    LCDL27 CON 2080
    LCDL28 CON 2160
    LCDL29 CON 2240
    LCDL30 CON 2320
    
    
    'General Variables used
    gl_cmd		var	BYTE
    gl_cur      var BYTE
    gl_byte		var	BYTE
    gl_i		var	BYTE
    gl_j		var BYTE
    gl_addr		var	WORD
    gl_set      var byte
    RST=0
    PAUSE 1
    RST=1
    RD = 1
    pause 100
    goto main		'Jump over subroutines
    '===== SUBROUTINES ============
    'Data
    send_dat:
    	a0	= 0        
    	dat	= gl_byte
     goto gl_strobe
    'Command 
    send_cmd:                   
    	a0	= 1
    	dat 	= gl_cmd
    'Write
    gl_strobe:
    	wr	= 0
    	@ nop
    	wr	= 1
    	a0   = 0	
    return
    
    
    'Clear Graphic Screen
    gl_grfclr:
    	gl_cmd = SYS_CUR_ADDR	'CSRW command
    	gosub send_cmd
    	gl_byte = $60
    	gosub send_dat
    	gl_byte = $09
    	gosub send_dat	
    	gl_cmd = SYS_CUR_DIR_RT	 'Cur movement right
    	gosub send_cmd	
    	gl_cmd = SYS_MWRITE
    	gosub send_cmd	
            gl_byte = $00
    	for gl_i = 1 to 240      ;pixel  V
    	   for gl_j = 1 to 80    ;bytes H
    		gosub send_dat
    	   next gl_j
    	next gl_i
    return
    
    'Clear Text screen
    gl_txtclr:
    	gl_cmd = SYS_CUR_ADDR	'CSRW command
    	gosub send_cmd
    	gl_byte = $00
    	gosub send_dat
    	gl_byte = $00
    	gosub send_dat
    	
    	gl_cmd = SYS_CUR_DIR_RT	'Cur movement right
    	gosub send_cmd
    	gl_cmd = SYS_MWRITE
    	gosub send_cmd
    	gl_byte = " "	'ASCII Space
    	for gl_i = 1 to 30
    	   for gl_j = 1 to 80
    		gosub send_dat
    	   next gl_j
    	next gl_i
    
    return
    	 
    
    'Setup LCD
    gl_init:	                
    	gl_cmd = SYS_SET
    	gosub send_cmd   
    	for gl_i = 0 to 7                       
    		            'P1  P2  P3  P4  P5  P6  P7  P8
            lookup gl_i,[$30,$07,$07,$4F,$54,$EF,$50,$00],gl_byte                      
            gosub send_dat
    	next gl_i
    
    	'scroll
    	gl_cmd = SYS_SCROLL
    	gosub send_cmd
    	for gl_i = 0 to 5 ' sad1   sl1  sad2   sl2   sad3     
    		  lookup gl_i,[$00,$00,$EF,$60,$09,$EF],gl_byte 
    		gosub send_dat     
    	next gl_i
    	'Hdot
    	gl_cmd = SYS_SCROLL_RATE
    	gosub send_cmd
    	gl_byte =$00
    	gosub send_dat
    
    	'Overlay
    	gl_cmd = SYS_OVER_LAY
    	gosub send_cmd
    	gl_byte = $01 
    	gosub send_dat
    
    	'DISP OFF
    	gl_cmd =LCD_DISP_OFF
    	gosub send_cmd
    	gl_byte = %00010110
    	gosub send_dat
    	
    	'Clear Text screen
    	gosub gl_txtclr
    	
    	'Clear Graphic screen
    	gosub gl_grfclr	
    	
    	'CSRW set cursor home
    	gl_cmd = SYS_CUR_ADDR
    	gosub send_cmd
    	gl_byte = $00
    	gosub send_dat
    	gl_byte = $00
    	gosub send_dat
    	
    	gl_cmd = SYS_CUR_DIR_RT
    	gosub send_cmd
    	gl_byte = SYS_MWRITE
    	gosub send_dat
    	gl_byte = $00
    	gosub send_dat
    	gl_byte = $00
    	gosub send_dat
    
    
    	'CSR FORM
    	gl_cmd =SYS_CUR_FORM
    	gosub send_cmd
    	gl_byte = $04
    	gosub send_dat
    	gl_byte = $86
    	gosub send_dat
    
    	'DISP ON
    	gl_cmd = LCD_DISP_ON
    	gosub send_cmd
    	                            
    	gl_byte = $16	'cursor off $35 
    	gosub send_dat
    
    	'CSR DIR
    	gl_cmd = SYS_CUR_DIR_RT
    	gosub send_cmd
    return
    'Routine to set the address
    gl_setaddr:
    	'CSRW set cursor home
    	gl_cmd = SYS_CUR_ADDR       'Address command
    	gosub send_cmd
    	gl_byte = gl_addr.BYTE0     'Vram text memory starts at $0000 and graphics at $960
    	gosub send_dat
    	gl_byte = gl_addr.BYTE1
    	gosub send_dat
    	gl_cmd = gl_cur	            'Set cursor movement to left,right,up or down
    	gosub send_cmd
    return	
    'End of subroutines
    
    '============================================
    '  MAIN PROGRAM 
    '============================================
    
    main: 
    	gosub gl_init		'Initialize display
    	PAUSE 10
    
    
     mesages:
     
    'draw a border around LCD
    '============================
    
    '
    'Left vert Line
    	gl_addr = LCD_GRH + 0 	      'Graphic home position $960 2400
    	gl_cur  = SYS_CUR_DIR_DN      'Cur movement to right
    	gosub gl_setaddr
    
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	gl_byte =$ff
    
    	for gl_i = 0 to 239		     ;vertical 240
    		gosub send_dat
    	next gl_i
    
    'Right vert Line
    	gl_addr = LCD_GRH + 79      'Graphic home position $960 2400
    	gl_cur  = SYS_CUR_DIR_DN      'Cur movement to right
    	gosub gl_setaddr
    
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	gl_byte = $ff
    
    	for gl_i = 0 to 239		      ;vertical address
    		gosub send_dat
    	next gl_i
    
    
    
    'Top Line
    	gl_addr = LCD_GRH + 0 	      
    	gl_cur  = SYS_CUR_DIR_RT      'Cur movement to right
    	gosub gl_setaddr
    
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	gl_byte = $ff		'All bits set
    
    	for gl_i = 0 to 79		       
    		gosub send_dat
    	next gl_i
    
    'Bottom Line
    	gl_addr  = LCD_GRH + $4AB0; 
    	gl_cur  = SYS_CUR_DIR_RT    
    	gosub gl_setaddr
    
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	gl_byte = $ff		
    
    	for gl_i = 0 to 79		
    		gosub send_dat
    	next gl_i	
    
    ;===================================================================================================
    ; Layer 1 text 
    ;=================================================================================================== 
     
    	gl_addr = LCDL2+1      'Line 1 and 1 bytes to right
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr	
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
     
    for gl_i = 0 to 8                                        
    		lookup gl_i,["LINIA 2 "],gl_byte
    		gosub send_dat
    	next gl_i
    
    
    	gl_addr = LCDL4 + 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr	
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
     
    for gl_i = 0 to 8 
    		      lookup gl_i,["LINIA 4 "],gl_byte
    		gosub send_dat
    	next gl_i	
    
    	gl_addr = LCDL6 + 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	for gl_i = 0 to 8
    	      lookup gl_i,["LINIA 6 "],gl_byte
    		gosub send_dat
    	next gl_i
    
    	
      	gl_addr = LCDL8 + 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
      	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd   
                          
    for gl_i = 0 to 47   
            lookup gl_i,["LINE 8 "],gl_byte
    		gosub send_dat
    	next gl_i
    	
     
     
    	gl_addr = LCDL10+ 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr	
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd 
           
    	for gl_i = 0 to 9                                                           
    		 lookup gl_i,["LINIA 10 "],gl_byte
    		gosub send_dat
    	next gl_i
    
    	gl_addr = LCDL12+ 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd                    
    	for gl_i = 0 to 9 
    		 lookup gl_i,["LINIA 12 "],gl_byte
    		gosub send_dat
    	next gl_i	
    ;
    	gl_addr = LCDL14+ 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd      
    	for gl_i = 0 to 57
    		    lookup gl_i,["LINE 14 @ HITACHI SP21H001 LCD PANEL 640X240 & SED13305F "],gl_byte
    		gosub send_dat
      	next gl_i
    
    	gl_addr = LCDL16+ 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	for gl_i = 0 to 9
    
    		lookup gl_i,[" LINE 16 "],gl_byte
    		gosub send_dat
    	next gl_i
    
    	gl_addr = LCDL18+ 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	                          
    	for gl_i = 0 to 9                
             lookup gl_i,["LINIA 18 "],gl_byte
    		gosub send_dat
    	next gl_i
    	
    		gl_addr = LCDL20+ 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	                         
    	for gl_i = 0 to 9                 
             lookup gl_i,["LINIA 20 "],gl_byte
    		gosub send_dat
    	next gl_i
    	
    			gl_addr = LCDL22 + 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
        
    	for gl_i = 0 to 8                 
             lookup gl_i,["LINIA 22 "],gl_byte
    		gosub send_dat
    	next gl_i
    	
    			gl_addr = LCDL24 + 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	                         
    	for gl_i = 0 to 8                 
             lookup gl_i,["LINIA 24 "],gl_byte
    		gosub send_dat
    	next gl_i
    	
    	
    				gl_addr = LCDL26 + 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    ;	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	                            
    	for gl_i = 0 to 9                
             lookup gl_i,["LINIA 26 "],gl_byte
    		gosub send_dat
    	next gl_i
    
    
    			gl_addr = LCDL28 + 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    ;	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	                            
    	for gl_i = 0 to 9                
             lookup gl_i,["LINIA 28 "],gl_byte
    		gosub send_dat
    	next gl_i
    	
    		gl_addr = LCDL30 + 1     
    	gl_cur  = SYS_CUR_DIR_RT
    	gosub gl_setaddr
    	'MWRITE
    	gl_cmd =SYS_MWRITE
    	gosub send_cmd
    	                          
    	for gl_i = 0 to 9                    
             lookup gl_i,["LINIA 30 "],gl_byte
    		gosub send_dat
    	next gl_i	
    
     goto mesages
    
    end
    '====================
    '   END OF PROGARM   
    '====================

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Sed13305f help!

    You will need to extract the picture information from your BMP file and then send bit per bit to your display. You will also need to resize your BMP file to 640X240 before attempting to transfer the picture.

    Read the Tutorial "Bitmap_File_Format_Information" @ the given link, to understand how to extract the data needed.

    http://gpwiki.org/index.php/VB:Tutor...at_Information

    Cheers

    Al.
    All progress began with an idea

  3. #3
    Join Date
    Apr 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Sed13305f help!

    Thanks for the answer, I am looking for an example for how to include the file generated from bitmap converter(asm,bas,h....)
    Attached Images Attached Images  

  4. #4
    Join Date
    May 2011
    Posts
    3


    Did you find this post helpful? Yes | No

    Default Re: Sed13305f help! Hitachi SP21H001 LCD

    Hello I´m new hear and i have a request.
    Can anybody post or link any kind of document whit the hitachi sp21h001 pinout and tell me if it´s possible to use this controller whith it(http://cgi.ebay.co.uk/SED1335-SED133...item2c55442203) ?
    Thanks in advance.

  5. #5
    Join Date
    Apr 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Sed13305f help!

    here it is!
    Attached Images Attached Images    

  6. #6
    Join Date
    May 2011
    Posts
    3


    Did you find this post helpful? Yes | No

    Default Re: Sed13305f help!

    Many many thanks for your attention for this subject.
    Because i´m new in grafical lcd´s can i connect the controller direct to the pc and use software like smart lcd or other? If you have any schematic for this hitachi sp21h001 i will apreciate mutch.Thanks to all.
    Sérgio Coelho

  7. #7
    Join Date
    Apr 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Sed13305f help!

    There is everything you need already posted ....
    Attached Images Attached Images  
    Attached Files Attached Files

  8. #8
    Join Date
    May 2011
    Posts
    3


    Did you find this post helpful? Yes | No

    Default Re: Sed13305f help!

    thank you very much by your patience.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts