Файл: Fast AVR. Basic compiller for AVR. User manual (2004).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 13.06.2025
Просмотров: 1438
Скачиваний: 1
FastAVR Basic compiler Manual
Text Page and Cursor must be turned ON and Cursor shape defined with GCommand!
Example:
GCursor 5, 2 ' Cursor is positioned
Related Topics:
GCommand
6.4.9.General
User can find a lot of LCD graphic modules based on Toshiba's T6963C graphic controler. Dimensions runs from 128x64 pix to 256x128 pix.
Generaly they has Text page and Graphic page, both organized in 6 or 8 pix wide columns, depends on pin FS (Font Select). This pin MUST be fixed in the project! User can use Graphic, Text or both together. Text screen coordinates are in characters, while Graphic page coordinates are in pixels, starting in upper left corner (0,0). Some graphics X coordinates are in Columns, while Y are in pixels.
User can select from 6x8 and 8x8 font driving pin FS (hard wired). Unfortunately they are the same font with large interspace in case of 8x8. Writing on Text page is as with any standard alphanumeric LCD using it's own built-in character generator.
Useful links:
http://doc.semicon.toshiba.co.jp/noseek/us/td/03frame.htm
http://ourworld.compuserve.com/homepages/steve_lawther/t6963c.pdf
http://202.76.113.1/varitronix/htm/product.htm
http://www.hantronix.com/index.html
6.4.10.GLcd
Description:
Writes text on graphic LCD's Graphic page. This mode uses soft characters generator in Flash table. User can edit Fonts using FastLCD.
FS pin setting MUST be on 1 for 6 pix Column wide or 0 for 8 pix column.
Syntax:
GLcd(varC, varL), var
Remarks:
varC Starting X coordinate in columns varL Pixel to write in
var num, string, string constant or hex to write
X coordinates are in Columns, Y in Pixels!
Font MUST be set (FontSet)prior to using Glcd!
If You wish to show just a few words, maybe ImgSet is better (shorter) solution (word is made as an Immage)!
If $LeadChar is defined then result will be right justified with Leading Chars as defined. Also, if Format() is defined then optional decimal point will be inserted!
76
FastAVR Basic compiler Manual
Example: |
|
GLcd(0, 0 ), n |
' Writes num variable |
GLcd(1, 10), s |
' Writes string var |
GLcd(2, 30), "This is T6963c" |
' Writes string |
GLcd(3, 60), Chr(61) |
' Writes letter A |
GLcd(4, 90), Hex(61) |
' Writes Hex string |
Related Topics: |
|
FS pin configuration |
|
FontSet |
|
TLcd |
6.4.11.GlcdInit
Description:
Initializes the Graphic LCD display
Syntax:
GLcdInit
Example:
GLcdInit
Remarks:
$GLCD and $GCtrl must be setup prior to using GLcdInit.
At initial power on or anytime the graphic LCD is powered down, GLcdInit should be called to initialize the LCD before using any graphic statements.
Some LCDs has theirs own internal RESET, for others user MUST generate RESET (active LOW) before Calling
GLcdInit!
6.4.12.GRead
Description:
Reads a byte from the graphic LCD at selected Column and Y on the Graphic page.
Syntax:
Var = GRead(varX, varL)
Remarks:
varC X coordinate in columns varY Y coordinate
var is assigned the value read
This is the graphic controllers native Read function.
X coordinates are in Columns, not in Pixels!
Example:
77
FastAVR Basic compiler Manual
n = GRead(17, 2) |
' Data from Column=17 on Y=2 will be Read into n. |
Related Topics:
GWrite
6.4.13.GrpAreaSet
Description:
Sets the Graphic Page width in Columns.
Syntax:
GrpAreaSet col
Remarks:
col width of Graphic page
Graphic page can be wider then LCD visible area!
Example:
GrpAreaSet 20 ' Graphic page is 20 colums wide
Related Topics:
TxtAreaSet
TxtHomeSet
GrpHomeSet
6.4.14.GrpHomeSet
Description:
Sets the Graphic Page origin.
Syntax:
GrpHomeSet adr
Remarks:
adr address of Graphic page
Example:
GrpHomeSet &h0200 ' Graphic page is at &h0200 of T6963C RAM
Related Topics:
TxtAreaSet
TxtHomeSet
GrpAreaSet
78
FastAVR Basic compiler Manual
6.4.15.GWrite
Description:
Writes a byte at selected Column and Y on the Graphic page.
Syntax:
GWrite(varX, varL), var
Remarks:
varX X coordinate, normally between 0 and 127 varL Line, between 0 and 7
var to be written to desired position.
This is the graphic controllers native Write function.
X coordinates are in Columns not in Pixels!
Example:
GWrite(17, 2), 15 ' Four pixels will be written to x=17 on the Line 2.
Related Topics:
GRead
6.4.16.ImgSet
Description:
Displays an Image or a part of ImageArray on the graphic LCD at selected Column and Y. FS pin setting MUST be on 1 for 6 pix Column wide or 0 for 8 pix column.
Syntax:
ImgSet(varC, varY), NameOfImgTable
Or, if You wat to display a element of an ImageArray:
(Image must be saved as ImageArray, when edited using FastLCD utility!)
ImgSet(varC, varY, var), NameOfImgTable
Remarks:
varC coordinate in Column varY Y coordinate (in Pix)
var which part of Image, (index in ImageArray) NameOfImgTable Table in Flash that contains the bit image.
X coordinates are in Columnc not in Pixels!
NameOfImgTable must be declared first and added into source ($Included)! Images can be edited with FastLCD image editor which can save Images in bas format. The saved image is then ready to be included in the source program!
Example:
Dim Img0 As Flash Byte
Dim Img1 As Flash Byte
79
FastAVR Basic compiler Manual
ImgSet(5, 12), Img1 |
' Image Img1 will be copied to location |
$Included "C:\FastAVR\Img0.bas" ' Img0 bit image definition $Included "C:\FastAVR\Img1.bas" ' Img1 bit image definition
Second syntax:
Using ImageArray, a large letters, Icons or Sprites can be displayed, all saved in a single Image! Any part of this Image is accessable by its index, yeaa - this means animations!
Example:
Dim Sclk1616HD As Flash Byte
ImgSet(15, 2, 1), Sclk1616HD ' SandClock with index 1, second sub-Image will be displayed
$Included "C:\FastAVR\Sclk1616HD.bas" ' SandClock definition
Related Topics:
GLcd
6.4.17.Inverse
Description:
Inverses specified area on the screen.
Syntax:
Inverse(varX, varY, varX1, varL1)
Remarks:
varX LeftMost X coordinate of area, between 0 and NofColumns varL TopMost coordinate, between 0 and Ymax
varX1 number of columns to Inverse varL1 number of lines (pixels) to Inverse
X coordinates are in Columns not in Pixels!
Example:
Inverse(15, 1, 6, 40) ' Specified area will be Inversed
Related Topics:
Fill
80
FastAVR Basic compiler Manual
6.4.18.Line
Description:
Draws or Clears a Line of any angle.
Syntax:
Line(varX, varY, varX1, varY1), 0|1
Remarks:
varX X coordinate of start pixel varY Y coordinate of start pixel varX1 X coordinate of end pixel varY1 Y coordinate of end pixel
0|1 0 will Clear Line, 1 will Draw Line
Example:
Line(0, 0, 239, 127), 1 ' Diagonal Line on 240x128 pix LCD
Related Topics:
LineH
LineV
Pset
Circle
Box
6.4.19.LineH
Description:
Draws or Clears a Horizontal Line.
FS pin setting MUST be on 1 for 6 pix Column wide or 0 for 8 pix column.
Syntax:
LineH(varX, varY, varX1), 0|1
Remarks:
varX X coordinate of LeftMost pixel in Line varY Y coordinate of Line
varX1 X coordinate of RightMost pixel in Line 0|1 0 will Clear Line, 1 will Draw Line
varX1 must be greater than varX.
Example:
LineH(15, 20, 120), 1 ' Line will be Drawn from X=15 to 120, at y=20
Related Topics:
LineV
81
FastAVR Basic compiler Manual
6.4.20.LineV
Description:
Draws or Clears a Vertical Line.
FS pin setting MUST be on 1 for 6 pix Column wide or 0 for 8 pix column.
Syntax:
LineV(varX, varY, varY1), 0|1
Remarks:
varX X coordinate of Line
varY Y coordinate of TopMost pixel in Line varY1 Y coordinate of BottomMost pixel in Line
0|1 0 will Clear Line, 1 will Draw Line
varY1 must be greater than varY.
Example:
LineV(15, 20, 60), 1 ' Vertical Line will be Drawn from y=20 to 60, at x=15
Related Topics:
LineH
6.4.21.Point
Description:
Tests if specified Pixel location is Set or Reset.
Syntax:
Var = Point(varX, varY)
Remarks:
varX X coordinate varY Y coordinate
var is assigned the result, 0 if pixel is Reset, 1 if Pixel is Set
Example: |
|
n = Point(15, 2) |
' If n>0 that Pixel is Set |
Related Topics: |
|
PSet |
82
FastAVR Basic compiler Manual
6.4.22.Pset
Description:
Sets or Resets an individual Pixel at the desired position.
FS pin setting MUST be on 1 for 6 pix Column wide or 0 for 8 pix column.
Syntax:
Pset(varX, varY), 0|1
Remarks:
varX X coordinate varY Y coordinate
0|1 0 will Reset pixel, 1 will Set pixel, (color)
Example:
Pset(15, 20), 1 ' Pixel at coordinates 15, 20 will be Set
Related Topics:
Point
LineH
LineV
6.4.23.Tcls
Description:
Clears the text area on Graphic LCD.
Syntax:
TCls
Example: |
|
TCls |
' Just text area is now cleared |
Related Topics:
Fill
6.4.24.TLcd
Description:
Writes text on graphic LCD's Text page defined on TxtHomeSet. This mode uses build-in characters generator. User can select beetween 6x8 font (FS=1) ans 8x8 font (FS=0).
Syntax:
TLcd(varC, varL), var
Remarks:
varC Starting X coordinate in columns varL Line to write in
var num, string, string constant or hex to write
83