Code:
'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : KVLV *
'* Notice : Copyright (c) 2010 VANCOUVER *
'* : All Rights Reserved *
'* Date : 12/27/2010 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
'chip use 18F2620
'
DEFINE LOADER_USED 1 'for bootstrap loader
define OSC 20
'define HSER_BAUD 19200 ' on pc side set to 19200 8N1 (8 data bits, no parity bit, 1 stop bit)
define HSER_BAUD 19200
' Set receive register to receiver enabled
DEFINE HSER_RCSTA 90h
' Set transmit register to transmitter enabled
DEFINE HSER_TXSTA 20h
INCLUDE "Modedefs.bas"
L var word
B var word
M var word
temp var word
'Mask var byte
X var word '[5]
'Y VAR BIT[40]
C VAR word
S var byte[5]
data %00000000, %00000000, %00000000, %00000000, %00000000 'space
data %00000000, %00000000, %01111001, %00000000, %00000000 '!
data %00000000, %01110000, %00000000, %01110000, %00000000 'double_quotes
data %00010100, %01111111, %00010100, %01111111, %00010100 'hash
data %00010010, %00101010, %01111111, %00101010, %00100100 'dollar_sign
data %01100010, %01100100, %00001000, %00010011, %00100011 'percent
data %00110110, %01001001, %01010101, %00100010, %00000101 'ampersand
data %00000000, %01010000, %01100000, %00000000, %00000000 'apostrophe
data %00000000, %00011100, %00100010, %01000001, %00000000 'left_parenthesis
data %00000000, %01000001, %00100010, %00011100, %00000000 'right_parenthesis
data %00010100, %00001000, %00111110, %00001000, %00010100 'asterisk
data %00001000, %00001000, %00111110, %00001000, %00001000 'plus
data %00000000, %00000101, %00000110, %00000000, %00000000 'comma
data %00001000, %00001000, %00001000, %00001000, %00001000 'minus
data %00000000, %00000011, %00000011, %00000000, %00000000 'full_stop
data %00000010, %00000100, %00001000, %00010000, %00100000 'forward_slash
data %00111110, %01000101, %01001001, %01010001, %00111110 'zero
data %00000000, %00100001, %01111111, %00000001, %00000000 'one
data %00100001, %01000011, %01000101, %01001001, %00110001 'two
data %01000010, %01000001, %01010001, %01101001, %01000110 'three
data %00001100, %00010100, %00100100, %01111111, %00000100 'four
data %01110010, %01010001, %01010001, %01010001, %01001110 'five
data %00011110, %00101001, %01001001, %01001001, %00000110 'six
data %01000000, %01000111, %01001000, %01010000, %01100000 'seven
data %00110110, %01001001, %01001001, %01001001, %00110110 'eight
data %00110000, %01001001, %01001001, %01001010, %00111100 'nine
data %00000000, %00110110, %00110110, %00000000, %00000000 'colon
data %00000000, %00110101, %00110110, %00000000, %00000000 'semicolon
data %00001000, %00010100, %00100010, %01000001, %00000000 'less_than
data %00010100, %00010100, %00010100, %00010100, %00010100 'equals
data %00000000, %01000001, %00100010, %00010100, %00001000 'greater_than
data %00100000, %01000000, %01000101, %01001000, %00110000 'question_mark
data %00100110, %01001001, %01001111, %01000001, %00111110 'at
data %00111111, %01000100, %01000100, %01000100, %00111111 'A
data %01111111, %01001001, %01001001, %01001001, %00110110 'B
data %00111110, %01000001, %01000001, %01000001, %00100010 'C
data %01111111, %01000001, %01000001, %00100010, %00011100 'D
data %01111111, %01001001, %01001001, %01001001, %01000001 'E
data %01111111, %01001000, %01001000, %01001000, %01000000 'F
data %00111110, %01000001, %01001001, %01001001, %00101111 'G
data %01111111, %00001000, %00001000, %00001000, %01111111 'H
data %00000000, %01000001, %01111111, %01000001, %00000000 'I
data %00000010, %00000001, %01000001, %01111110, %01000000 'J
data %01111111, %00001000, %00010100, %00100010, %01000001 'K
data %01111111, %00000001, %00000001, %00000001, %00000001 'L
data %01111111, %00100000, %00011000, %00100000, %01111111 'M
data %01111111, %00010000, %00001000, %00000100, %01111111 'N
data %00111110, %01000001, %01000001, %01000001, %00111110 'O
data %01111111, %01001000, %01001000, %01001000, %00110000 'P
data %00111110, %01000001, %01000101, %01000010, %00111101 'Q
data %01111111, %01001000, %01001100, %01001010, %00110001 'R
data %00110001, %01001001, %01001001, %01001001, %01000110 'S
data %01000000, %01000000, %01111111, %01000000, %01000000 'T
data %01111110, %00000001, %00000001, %00000001, %01111110 'U
data %01111100, %00000010, %00000001, %00000010, %01111100 'V
data %01111110, %00000001, %00001110, %00000001, %01111110 'W
data %01100011, %00010100, %00001000, %00010100, %01100011 'X
data %01110000, %00001000, %00000111, %00001000, %01110000 'Y
data %01000011, %01000101, %01001001, %01010001, %01100001 'Z
data %00000000, %01111111, %01000001, %01000001, %00000000 'left_square
data %00100000, %00010000, %00001000, %00000100, %00000010 'back_slash
data %00000000, %01000001, %01000001, %01111111, %00000000 'right_square
data %00010000, %00100000, %01000000, %00100000, %00010000 'circumflex
data %00000001, %00000001, %00000001, %00000001, %00000001 'underscore
data %00000000, %01000000, %00100000, %00010000, %00000000 'grave_accent
data %00000010, %00010101, %00010101, %00010101, %00001111 'a
data %01111111, %00001001, %00001001, %00001001, %00000110 'b
data %00001110, %00010001, %00010001, %00010001, %00010001 'c
data %00000110, %00001001, %00001001, %00001001, %01111111 'd
data %00001110, %00010101, %00010101, %00010101, %00001101 'e
data %00000000, %00001000, %00111111, %01001000, %00100000 'f
data %00001001, %00010101, %00010101, %00010101, %00011110 'g
data %01111111, %00001000, %00001000, %00001000, %00000111 'h
data %00000000, %00000000, %00101111, %00000000, %00000000 'i
data %00000010, %00000001, %00000001, %01011110, %00000000 'j
data %00000000, %01111111, %00000100, %00001010, %00010001 'k
data %00000000, %01000001, %01111111, %00000001, %00000000 'l
data %00011111, %00010000, %00001110, %00010000, %00011111 'm
data %00011111, %00001000, %00010000, %00010000, %00001111 'n
data %00001110, %00010001, %00010001, %00010001, %00001110 'o
data %00011111, %00010100, %00010100, %00010100, %00001000 'p
data %00001000, %00010100, %00010100, %00010100, %00011111 'q
data %00011111, %00001000, %00010000, %00010000, %00001000 'r
data %00001001, %00010101, %00010101, %00010101, %00010010 's
data %00010000, %00010000, %01111110, %00010001, %00010010 't
data %00011110, %00000001, %00000001, %00000001, %00011110 'u
data %00011100, %00000010, %00000001, %00000010, %00011100 'v
data %00011110, %00000001, %00000110, %00000001, %00011110 'w
data %00010001, %00001010, %00000100, %00001010, %00010001 'x
data %00010000, %00001001, %00000110, %00001000, %00010000 'y
data %00010001, %00010011, %00010101, %00011001, %00010001 'z
data %00001000, %00110110, %01000001, %01000001, %00000000 'leftcurly
data %00000000, %00000000, %01111111, %00000000, %00000000 'vertline
data %00000000, %01000001, %01000001, %00110110, %00001000 'rightcurly
data %00000100, %00001000, %00001000, %00001000, %00010000 'tilde
data %01111111, %01000001, %01000001, %01000001, %01111111 'del
TRISA=%00000000 '0=output
TRISB=%00000000 '1 = input
TRISC=%00000000
ADCON0=%11000000
ADCON1=%00000111
CMCON =%00000111 ' Comparators = off
INTCON2.7=0 ' Enable Pull-Up's PIC18F2620 'VERIFIED
Main:
' temp=l
' 'display data sideway
' for M=0 to 4
' read l,x
' hserout ["L:",dec3 l, " X:",bin8 x,13,10]
' l=l+1
' if l>175 then
' l=170
' endif
' next m
' s[0]= %01111111 'these lines work
' s[1]= %01000001
' s[2]= %01000001
' s[3]= %01000001
' s[4]= %01111111
' for c=470 to 474
' write c,s[c-470]
' pause 1
' next c
for c=0 to 475 step 5
hserout ["C:", dec c,13,10]
gosub rotate
next c
hserout ["That's all folk!",13,10]
END
goto main
'-----------------
'setup variable
'set c as location of
'call this
'ex:
' c=0
' gosub rotate
'
Rotate: 'rotate 90 counterclockwise
l=c
temp=l
for m=0 to 4
read l, x
hserout [bin x.7]
l=l+1
next m
hserout [13,10]
l=temp
for m=0 to 4
read l, x
hserout [bin x.6]
l=l+1
next m
hserout [13,10]
l=temp
for m=0 to 4
read l, x
hserout [bin x.5]
l=l+1
next m
hserout [13,10]
l=temp
for m=0 to 4
read l, x
hserout [bin x.4]
l=l+1
next m
hserout [13,10]
l=temp
for m=0 to 4
read l, x
hserout [bin x.3]
l=l+1
next m
hserout [13,10]
l=temp
for m=0 to 4
read l, x
hserout [bin x.2]
l=l+1
next m
hserout [13,10]
l=temp
for m=0 to 4
read l, x
hserout [bin x.1]
l=l+1
next m
hserout [13,10]
l=temp
for m=0 to 4
read l, x
hserout [bin x.0]
l=l+1
next m
hserout [13,10,13,10]
return
Bookmarks