KVLV
- 30th December 2010, 11:43
hi I bring this thread up because i have trouble compiling eeprom passed the 256 bytes
chip used 18f2620 it has 1024x8 byte of eeprom
pbp pro version 2.60a
mplab ide 8.63
mpasm v5.39
microcode studio 4.0.0.0
so please point out what i did wrong.
Please help and thank you.
I have tried both the DATA and EEPROM, both cannot compile more than 256 byte of eeprom
my code is enclosed.
'************************************************* ***************
'* 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
KVLV
- 30th December 2010, 19:11
Thanks scalerobotics.
I have a temp solution, workaround.
this program will write the needed data to the eeprom and use the one posted above to read.
'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : KVLV *
'* Notice : Copyright (c) 2010 VANCOUVER *
'* : All Rights Reserved *
'* Date : 12/30/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
B0 var word[1024]
C var word
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
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
b0[255]=%00110010:b0[256]=%01001001:b0[257]=%01001001:b0[258]=%01001001:b0[259]=%00100110 'S 'corrected dec 30.2010
b0[260]=%01000000:b0[261]=%01000000:b0[262]=%01111111:b0[263]=%01000000:b0[264]=%01000000 'T
b0[265]=%01111110:b0[266]=%00000001:b0[267]=%00000001:b0[268]=%00000001:b0[269]=%01111110 'U
b0[270]=%01111100:b0[271]=%00000010:b0[272]=%00000001:b0[273]=%00000010:b0[274]=%01111100 'V
b0[275]=%01111110:b0[276]=%00000001:b0[277]=%00001110:b0[278]=%00000001:b0[279]=%01111110 'W
b0[280]=%01100011:b0[281]=%00010100:b0[282]=%00001000:b0[283]=%00010100:b0[284]=%01100011 'X
b0[285]=%01110000:b0[286]=%00001000:b0[287]=%00000111:b0[288]=%00001000:b0[289]=%01110000 'Y
b0[290]=%01000011:b0[291]=%01000101:b0[292]=%01001001:b0[293]=%01010001:b0[294]=%01100001 'Z
b0[295]=%00000000:b0[296]=%01111111:b0[297]=%01000001:b0[298]=%01000001:b0[299]=%00000000 'left_square
b0[300]=%00100000:b0[301]=%00010000:b0[302]=%00001000:b0[303]=%00000100:b0[304]=%00000010 'back_slash
b0[305]=%00000000:b0[306]=%01000001:b0[307]=%01000001:b0[308]=%01111111:b0[309]=%00000000 'right_square
b0[310]=%00010000:b0[311]=%00100000:b0[312]=%01000000:b0[313]=%00100000:b0[314]=%00010000 'circumflex
b0[315]=%00000001:b0[316]=%00000001:b0[317]=%00000001:b0[318]=%00000001:b0[319]=%00000001 'underscore
b0[320]=%00000000:b0[321]=%01000000:b0[322]=%00100000:b0[323]=%00010000:b0[324]=%00000000 'grave_accent
b0[325]=%00000010:b0[326]=%00010101:b0[327]=%00010101:b0[328]=%00010101:b0[329]=%00001111 'a
b0[330]=%01111111:b0[331]=%00001001:b0[332]=%00001001:b0[333]=%00001001:b0[334]=%00000110 'b
b0[335]=%00001110:b0[336]=%00010001:b0[337]=%00010001:b0[338]=%00010001:b0[339]=%00010001 'c
b0[340]=%00000110:b0[341]=%00001001:b0[342]=%00001001:b0[343]=%00001001:b0[344]=%01111111 'd
b0[345]=%00001110:b0[346]=%00010101:b0[347]=%00010101:b0[348]=%00010101:b0[349]=%00001101 'e
b0[350]=%00000000:b0[351]=%00001000:b0[352]=%00111111:b0[353]=%01001000:b0[354]=%00100000 'f
b0[355]=%00001001:b0[356]=%00010101:b0[357]=%00010101:b0[358]=%00010101:b0[359]=%00011110 'g
b0[360]=%01111111:b0[361]=%00001000:b0[362]=%00001000:b0[363]=%00001000:b0[364]=%00000111 'h
b0[365]=%00000000:b0[366]=%00000000:b0[367]=%00101111:b0[368]=%00000000:b0[369]=%00000000 'i
b0[370]=%00000010:b0[371]=%00000001:b0[372]=%00000001:b0[373]=%01011110:b0[374]=%00000000 'j
b0[375]=%00000000:b0[376]=%01111111:b0[377]=%00000100:b0[378]=%00001010:b0[379]=%00010001 'k
b0[380]=%00000000:b0[381]=%01000001:b0[382]=%01111111:b0[383]=%00000001:b0[384]=%00000000 'l
b0[385]=%00011111:b0[386]=%00010000:b0[387]=%00001110:b0[388]=%00010000:b0[389]=%00011111 'm
b0[390]=%00011111:b0[391]=%00001000:b0[392]=%00010000:b0[393]=%00010000:b0[394]=%00001111 'n
b0[395]=%00001110:b0[396]=%00010001:b0[397]=%00010001:b0[398]=%00010001:b0[399]=%00001110 'o
b0[400]=%00011111:b0[401]=%00010100:b0[402]=%00010100:b0[403]=%00010100:b0[404]=%00001000 'p
b0[405]=%00001000:b0[406]=%00010100:b0[407]=%00010100:b0[408]=%00010100:b0[409]=%00011111 'q
b0[410]=%00011111:b0[411]=%00001000:b0[412]=%00010000:b0[413]=%00010000:b0[414]=%00001000 'r
b0[415]=%00001001:b0[416]=%00010101:b0[417]=%00010101:b0[418]=%00010101:b0[419]=%00010010 's
b0[420]=%00010000:b0[421]=%00010000:b0[422]=%01111110:b0[423]=%00010001:b0[424]=%00010010 't
b0[425]=%00011110:b0[426]=%00000001:b0[427]=%00000001:b0[428]=%00000001:b0[429]=%00011110 'u
b0[430]=%00011100:b0[431]=%00000010:b0[432]=%00000001:b0[433]=%00000010:b0[434]=%00011100 'v
b0[435]=%00011110:b0[436]=%00000001:b0[437]=%00000110:b0[438]=%00000001:b0[439]=%00011110 'w
b0[440]=%00010001:b0[441]=%00001010:b0[442]=%00000100:b0[443]=%00001010:b0[444]=%00010001 'x
b0[445]=%00010000:b0[446]=%00001001:b0[447]=%00000110:b0[448]=%00001000:b0[449]=%00010000 'y
b0[450]=%00010001:b0[451]=%00010011:b0[452]=%00010101:b0[453]=%00011001:b0[454]=%00010001 'z
b0[455]=%00001000:b0[456]=%00110110:b0[457]=%01000001:b0[458]=%01000001:b0[459]=%00000000 'leftcurly
b0[460]=%00000000:b0[461]=%00000000:b0[462]=%01111111:b0[463]=%00000000:b0[464]=%00000000 'vertline
b0[465]=%00000000:b0[466]=%01000001:b0[467]=%01000001:b0[468]=%00110110:b0[469]=%00001000 'rightcurly
b0[470]=%00000100:b0[471]=%00001000:b0[472]=%00001000:b0[473]=%00001000:b0[474]=%00010000 'tilde
b0[475]=%01111111:b0[476]=%01000001:b0[477]=%01000001:b0[478]=%01000001:b0[479]=%01111111 'del
b0[480]=$ef 'eof
for c=255 to 480
write c,b0[c]
pause 1
next c
end
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.