Searching \ for '[PIC]: PIC to Graphic LCD problem!!' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/lcd/pic.htm?key=lcd
Search entire site for: 'PIC to Graphic LCD problem!!'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: PIC to Graphic LCD problem!!'
2000\06\28@170740 by smerchock, Steve

flavicon
face
Friends,

I have been working on a graphic display project for awhile now.
I am using a display (128x128) with a T6963C controller in it. The problem
is that
I had it working with up to 255 bytes (maybe 256?) but started to mess with
the code below. I didn't make a backup or print out the routine that worked
(I know, extremely careless and dumb!!) and now I can't even get the darn
thing
to work at all. I didn't work on it for a month and forgot everything I did.
Can somebody that is familiar with interfacing to a graphic lcd please help
me out!!
Most of my code is taken from Steve Lawthers information, beside the fact
that he was
very helpful in a few emails we exchanged.

Basically I figured that since it didn't work anymore, I put the "led_on"
routine to tell
me where it stopped execution. It does not perform the "led_on" that comes
after the
addwf  PCL,F command. I'm stumped (tired?!). The "led_on" sub-routine was
used as an
indicator, and it will be removed!! I checked everything else, looks OK. I
think I'm
missing something obvious.

Anyways, if anybody could help me out I would appreciate it. Hell, if you
can figure
out a way so this code will work with a table larger
than the 256 bytes,....... I'll send them either a tube of 10 new
PIC16F877-20/P's or
a brand new AND1391 ("128x128") graphic LCD (I have a few on-hand!). This
code will
NOT be used commercially, only private use (no I'm not trying to get you to
do my work for me!!).
I will eventually post it on my website once it gets completed.



;** // Data to be displayed on G.LCD!! // **
send_data:
       movf    prog_counter,W          ;Load "W" with "prog_counter"s
value!
       addwf   PCL,F
       goto    led_on
       dt      0xff, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
       dt      0x07, 0xf8, 0x1f, 0xf8, 0xff, 0xaa, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
       dt      0x07, 0xfc, 0xff, 0xff, 0x00, 0xaa, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00
       dt      0x07, 0xbe, 0xff, 0xff, 0x00, 0xaa, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00
       dt      0x07, 0x9e, 0xff, 0xff, 0x00, 0xaa, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00
       dt      0x07, 0x1e, 0xff, 0xff, 0x00, 0xaa, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00
       dt      0x07, 0xdc, 0xff, 0xff, 0x00, 0xaa, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00
       dt      0x07, 0xf8, 0xff, 0xff, 0x00, 0xaa, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00
       goto    led_on
;---------------------------------------------------------------------------
---------------------
; // Displays data on G.LCDs screen!!! //
;

display_data:
       incf    prog_counter,F
       movlw   0x80                            ;   0x80 (d'128')
       movwf   count_reg                       ;x  0x10 (d'16')
;
go      movlw   0x10                            ;-----------------
       movwf   data_count1                     ;   2048 times!! (amount of
bytes to send!!)
;
cals1   movlw   b'00001010'                     ;Set-up G.LCD for data.
       movwf   porta                           ;
       nop
       bcf     porta,3                 ;/CE to be 0.
;
       call    send_data
       movwf   portb                           ;Send it to "PORTB"
(OUTPUT)!
       incf    prog_counter,F          ;Increment "prog_counter" (deals
with data table "dt" !!).
       call    auto_write_status               ;Test "STATUS" of G.LCD.
       decfsz  data_count1,F   ;Decrement "data_count".
       goto    cals1
;
       decfsz  count_reg,F             ;"count_reg"=1?
       goto    go                              ;No,... keep going!!
       goto    cals1
       nop                                     ;YES!!! Finished, continue
on in program!!
;
; // Never used at this time!! //
over:
       movlw   0xb2                            ;Set-up G.LCD for "Data Auto
Write Set".
       movwf   shadow_reg                      ;Load contents of "W" into
"shadow_reg".
       call    write_command           ;Set-up G.LCD to write a command.
       return
;
;
;

Best regards,
Steve



Steven Kosmerchock
Phoenix  Arizona  USA
www.geocities.com/researchtriangle/lab/6584

2000\06\28@190555 by Tony Nixon

flavicon
picon face
Some things to check.

Is the PCLATH set correctly when the send_data subroutine is called.
Easy to verify with the simulator.

Is the prog_counter value = 0 or 129 when the subroutine is called. If
not, goto led_on will not execute.

If the value of prog_counter is > 129 then the program will not work as
intended.


256 byte table

       movlw High(TStart)
       movwf PCLATH

       movf Offset,W
       call DoTable

       ; restore PCLATH if need be and continue


       org 0x??FF ; 1 location before any boundary

DoTable addwf PCL
TStart  retlw 0x00
       ...
       retlw 0xFF


> 256 byte table or any size table that crosses a boundary

       movlw High(TableStart)
       movwf PCLATH
       addwf Offset,W
       btfsc STATUS,C
       incf PCLATH

       movf Offset,W
       call DoTable

       ; restore PCLATH if need be and continue

       org 0x????

DoTable addwf PCL
       retlw 0x??
       ...
       retlw 0x??
       etc




--
Best regards

Tony

http://www.picnpoke.com
spam_OUTsalesTakeThisOuTspampicnpoke.com

2000\06\29@032234 by Peter Betts

picon face
Just to say I'm also using Steve Lawthers code. I haven't got my additional
code on me but if you would like to exchange ideas then let me know.

I intend to do some graphics routines like circles, squares, dials and
buttons, I just haven't had the time to do it all yet. I use a 240*64
Varitronix graphics screen with a T6963C controller.

I have boundary checking written into my code which throws up an error if
the table goes over a page boundary, but I don't have tables bigger than
256. I remember searching the archives and found something about handling
crossing page boundaries.

Pete

If you wish to Email me at home (Fri->Sun) then do so at
.....peterKILLspamspam@spam@trlperformance.com

> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...