Advertisement  

Wednesday, 24 July 2019
     
 
Main Menu
Home Home
Shop Shop
News News
BASCOM-AVR BASCOM-AVR
BASCOM-8051 BASCOM-8051
Products Products
Application Notes Application Notes
Publications Publications
Links Links
Support Center Support Center
Downloads Downloads
Forum Forum
Resellers Resellers
Contact Us Contact Us
Updates Updates
MCS Wiki MCS Wiki
Online Help
BASCOM-AVR Help BASCOM-AVR Help
BASCOM-8051 Help BASCOM-8051 Help
Contents in Cart
Show Cart
Your Cart is currently empty.
Search the Shop

Products Search

User Login
Username

Password

If you have problem after log in with disappeared login data, please press F5 in your browser

RSS News
 
     
 

 
   
     
 
AN #25 - Using the T6963 based GRAPHIC DISPLAY Print
Using the T6963 based GRAPHIC DISPLAY


Peter Huijssen figured out how to use the graphical displays that are equipped with the T6963 chip.

The following document describes how you can create your own bitmaps

The document for writing software for T6963C based LCD

A part of the BASCOM-8051  sample is shown below. 

Since it is much work to include these DATA lines, I will create a special compiler directive so that TIF files can be included without modification!

 

'DEMO PROGRAM T6963 BASED GRAPHIC DISPLAYS USING BASCOM-8051

'Author : P. Huijssen
' The Netherlands

'This program shows a bitmap and some text on a graphic display type : TLX1741-C3M
'which uses the T6963 controller.
'The display has a screenresolution of 240x128 pixels

'The display uses a data/command line to determine of a databyte or command byte is sent.
'In this application it's connected to A14 which makes it easy te sent data or a command.
'Data is sent to &H8000 (C/D line low)
'Commands/statuscheck written/read at &HC000 (C/D line high)

'The software is really an experiment and may not match the 'rules' of proper programming

'All of the used settings regarding the display are very well described in the datasheet

'The displayscreen should show 'TOSHIBA' in large characters (bitmap) and two lines of text

'******************************************************************
'INIT
'******************************************************************

$regfile = "REG51.DAT" 'your uC
$crystal = 11059200 'your crystal. Not important to control the display
 
'as long if you don't exceed an instruction time of 200ns

'VARIABELS DISPLAY AND TO SHOW GRAPHICS
Dim Data_display As Byte
Dim Status As Byte
Dim Mask_status As Byte

Dim Dta_1 As Byte
Dim Dta_2 As Byte
Dim Cmdo_1 As Byte
Dim Adres_pointer As Integer
Dim Dummy_adres_pointer As Integer

Dim Dummy As Integer

'VARIABELS USED TO SHOW TEXT
Dim Text As String * 21
Dim String_length As Byte
Dim String_scanner As Byte
Dim Temp_string As String * 2

'*****************************************************************
'*****************************************************************
'START PROGRAMME
'*****************************************************************
'*****************************************************************

Gosub Set_display  'init display

Gosub Display_blank 'clear screen
Gosub Show_bitmap 'place bitmap

Text
= "T6963 DEMO SOFTWARE"
Adres_pointer
= &H1831  'set adres_pointer in text ram
Gosub Show_text 'calculate display data

Text
= "PH 2000"
Adres_pointer
= &H1891
Gosub Show_text

End

'**************************
'DISPLAY SETUP
'************************
Set_display
:

P1
.0 = 1 'Reset display. Active low
Nop : Nop 'I thought I might need it during
P1
.0 = 0  'the execution of the code so I didn't
Nop : Nop 'use a hardware reset from a watchdog for
P1
.0 = 1 'instance.

Restore Dta_init 'init display. see also datasheet

For dummy = 1 To 7

 
Read Dta_1
 Data_display
= Dta_1
 
Gosub Writed
 
Read Dta_2
 Data_display
= Dta_2
 
Gosub Writed
 
Read Cmdo_1
 Data_display
= Cmdo_1
 
Gosub Writec

Next Dummy

Return

Dta_init
:

Data &H00 , &H00 , &H42 'home adress graphical ram.upperleft corner
Data &H1E , &H00 , &H43 'linewidth graphics (bytes per line)
Data &H00 , &H17 , &H40 'home adres text ram.upperleft corner
Data &H1E , &H00 , &H41 'lijnbreedte grafisch (characters per line)
Data &H00 , &H00 , &H81 'modeset intern CharRom,XOR mode
Data &H00 , &H00 , &H9E 'displaymode mixed text and graphics
Data &H00 , &H00 , &H24

'**********************************************************
'CLEAR SCREEN (ERASE GRAPHIC+TEXT RAM)
'**********************************************************
Display_blank
:

Adres_pointer
= &H00 'upperleft corner graphic ram
Gosub Set_adres

For dummy = 1 To 3840  'clear graphic ram
 
'by writing '0'
 Data_display
= &H00
 
Gosub Writed
 Data_display
= &H00
 
Gosub Writed
 Data_display
= &HC0  'auto increment adres_pointer by 1
 
Gosub Writec

Next Dummy

Adres_pointer
= &H1700 'upperleft corner text ram
Gosub Set_adres

For dummy = 1 To 480 'clear text ram
 
'by writing '0'
 Data_display
= &H00
 
Gosub Writed
 Data_display
= &H00
 
Gosub Writed
 Data_display
= &HC0 'auto increment adres_pointer by 1
 
Gosub Writec

Next Dummy

Return

'*********************************************************
' PLACE ADRES POINTER DISPLAY
'*********************************************************
Set_adres
:  'set adres display

Dta_1
= Adres_pointer And &H00FF 'calculate msb/lsb
Dummy_adres_pointer
= Adres_pointer And &HFF00
Dummy_adres_pointer
= Dummy_adres_pointer / &HFF
Dta_2
= Dummy_adres_pointer

Data_display
= Dta_1 'send adres to display
Gosub Writed
Data_display
= Dta_2
Gosub Writed
Data_display
= &H24 'data sent is adres data
Gosub Writec

Return

'*********************************************************
'PLACE TEXT.
'*********************************************************
Show_text
:

Gosub Set_adres 'set adres pointer

String_length
= Len(text)  'calculate string length

For String_scanner = 1 To String_length 'send string to display one
 
'character at the time
 Temp_string
= Mid(text , String_scanner , 1)
 Dta_2
= Asc(temp_string)
 Dta_2
= Dta_2 - &H20 'ascii codes in the char rom
 
'have an offset of - &H20. see datasheet
 Data_display
= &H00
 
Gosub Writed
 Data_display
= Dta_2
 
Gosub Writed
 Data_display
= &HC0 'auto increment adres_pointer by 1
 
Gosub Writec

Next String_scanner 'loop until whole string is sent

Return

'*****************************************************
'WRITE COMMAND AND DATA NAAR DISPLAY + STATUSCHECK
'*****************************************************
Writec
: 'write display command

Gosub Status_check
Out &H3800 , Data_display
Return

'***********
Writed
: 'write display data

Gosub Status_check
Out &H3000 , Data_display
Return

'***********
Status_check
:  'check status controller

Status_1
:

Status
= Inp(&H3800)
Mask_status
= Status And 3
 
If Mask_status = 3 Then : Return
 
End If
Goto Status_1

'*****************************************************************
'SHOW BITMAP
'*****************************************************************
Show_bitmap
:

Gosub Display_blank

Adres_pointer
= 0
Gosub Set_adres

Restore Bitmap_data

For dummy = 1 To 3840

 
Read Dta_2 'read bitmap data and send to display
 Data_display
= 0
 
Gosub Writed
 Data_display
= Dta_2
 
Gosub Writed
 Data_display
= &HC0
 
Gosub Writec

Next Dummy

Return

Bitmap_data
: 'TOSHIBA in large characters

Data &H00 , &H00 , &H00 , &H00 , &H00 , &H00
Data &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00

THE REST
IS DELETED. So you need the SAMPLE!