{
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 2/4/2014 *
* Version : 1.0 *
* Notes : *
* : *
*****************************************************************************
}
{
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 2/4/2014 *
* Version : 1.0 *
* Notes : *
* : *
*****************************************************************************
}
DEVICE = 18F2420
CLOCK = 8
// import LCD library...
INCLUDE "convert.bas"
INCLUDE "InternalOscillator.bas"
INCLUDE "Utils.bas" // Include this file when we compile so that we can use keywords like 'setalldigital'
INCLUDE "shift.bas"
// Arrays
CONST K_Data(8)AS BYTE = (%10001000,
%10010000,
%10100000,
%11000000,
%11000000,
%10100000,
%10010000,
%10001000)
CONST O_Data(8) AS BYTE =(%00011000, %00100100, %00100100, %00100100,
%00100100, %00011000, %00000000, %00000000)
CONST C_Data (8) AS BYTE =(%00111100,
%01000000,
%10000000,
%10000000,
%10000000,
%10000000,
%01000010,
%00111100)
CONST E_Data(8) AS BYTE = (%00111100,
%11000011,
%11000011,
%00111100,
%11000111,
%11000011,
%11000011,
%00111100)
CONST TWO_Data(8) AS BYTE = (%00111110,
%0100001,
%00000001,
%00011110,
%01100000,
%11000000,
%11000000,
%00111110)
CONST THREE_Data(8) AS BYTE = (%01111110,
%00000001,
%00000001,
%00011110,
%00000001,
%00000001,
%00000010,
%00111100)
CONST S_Data(8) AS BYTE = (%00111100,
%11000010,
%11000000,
%01111100,
%00000011,
%00000011,
%01000111,
%00111100)
CONST A_Data(8) AS BYTE = (%00010000,
%00101000,
%01000100,
%10000010,
%11111111,
%10000001,
%10000001,
%10000001)
CONST L_Data(8) AS BYTE = (%10000000,
%10000000,
%10000000,
%10000000,
%10000000,
%10000000,
%10000010,
%11111100)
CONST M_Data(8) AS BYTE = (%00000000,
%00000000,
%01101100,
%10010010,
%10000001,
%10000001,
%10000001,
%10000001)
CONST OO_Data(8) AS BYTE = (%00111100,
%01000010,
%10000001,
%10000001,
%10000001,
%10000001,
%01000010,
%00111100)
CONST N_Data(8) AS BYTE = (%00000000,
%11000001,
%10100001,
%10010001,
%10001001,
%10000101,
%10000011,
%10000011)
CONST cathodes(8) AS BYTE = (%11111110, 'top
%11111101,
%11111011,
%11110111, ' cathodes colums
%11101111, ' top to bottom
%11011111,
%10111111,
%01111111) 'bottom
DIM x AS BYTE
DIM index AS BYTE
// Sub Routines
SUB draw_K()
REPEAT
FOR x = 0 TO 7
PORTC =K_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
//PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
NEXT
INC(index)
UNTIL (index) = 70
//delayms(100)
index = 0
// draw_O()
REPEAT
FOR x = 0 TO 7
PORTC =O_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
REPEAT
//DRAW C
FOR x = 0 TO 7
PORTC =C_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
REPEAT
//DRAW 8
FOR x = 0 TO 7
PORTC =E_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
REPEAT
//DRAW 2
FOR x = 0 TO 7
PORTC =TWO_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
//DRAW 8
REPEAT
FOR x = 0 TO 7
PORTC =E_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
//DRAW 3
REPEAT
FOR x = 0 TO 7
PORTC =THREE_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
//DRAW S
REPEAT
FOR x = 0 TO 7
PORTC =S_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
//PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
NEXT
INC(index)
UNTIL (index) = 70
//delayms(100)
index = 0
// draw A
REPEAT
FOR x = 0 TO 7
PORTC =A_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
//DRAW L
REPEAT
FOR x = 0 TO 7
PORTC =L_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
//PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
NEXT
INC(index)
UNTIL (index) = 70
//delayms(100)
index = 0
// draw M
REPEAT
FOR x = 0 TO 7
PORTC =M_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
// draw_OO()
REPEAT
FOR x = 0 TO 7
PORTC =OO_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
REPEAT
//DRAW N
FOR x = 0 TO 7
PORTC =N_Data(x)
PORTB = cathodes(x)
DELAYMS(1)
NEXT
// PORTB = %00000000 // I put this here to make sure that we don't get ghosting when moving to the next column
INC(index)
UNTIL (index) = 70
index = 0
END SUB
// variable declaration
// Start Of Program
//OSCCON = %01111111 // Sets the internal oscillator for 8Mhz
SetAllDigital // Make all Pins digital I/O's
TRISC = %00000000 // Make PORTD all outputs
TRISB = %00000000 // Make PORTB all outputs
index = 0
// Main Loop
WHILE True() // This creates an infinite loop
draw_K
WEND
{
(%00000000,
%00000000,
%00000000,
%00000000,
%00000000,
%00000000,
%00000000,
%00000000) // Loop back to the while loop as long as we havent finished.
.... and figure out why Jon has bytes missing in post #18...
{
*****************************************************************************
* Name : testing routine.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 2/4/2014 *
* Version : 1.0 *
* Notes : letter testing routine *
* : *
*****************************************************************************
}
DEVICE = 18F2420
CLOCK = 8
// import LCD library...
INCLUDE "convert.bas"
INCLUDE "InternalOscillator.bas"
INCLUDE "Utils.bas" // Include this file when we compile so that we can use keywords like 'setalldigital'
INCLUDE "shift.bas"
// Arrays
// Arrays
const test(44)as byte = (%11111111, %10000000, %01000000, %00100000, %01000000, %10000000, %11111111, %00000000,
%11111111, %10001001, %10001001, %10000001, %00000000,
%00100010, %01010001, %10001001, %10001010 ,%01000100, %00000000,
%00100010, %01010001 ,%10001001, %10001010, %01000100, %00000000,
%00011111, %00101000, %11001000 ,%01001000, %00101000, %00011111, %00000000,
%00000000 ,
%00111100, %01000010, %10000001, %10000101, %01000110, %00000000 ,
%11111111 ,%10001001, %10001001, %10000001, %00000000)
CONST Anodes_Data(8)AS BYTE =(%11111111,
%00011000,
%00100100,
%01000010,
%10000000,
%00000000,
%00000000,
%00000000)
CONST Cathodes_Data(8)AS BYTE =(%11111110,
%11111101,
%11111011,
%11110111,
%11101111,
%11011111,
%10111111,
%01111111)
// variable declaration
'DIM x AS BYTE
DIM x AS WORD
'DIM indexc AS portc
'dim indexb as byte
'DIM bits AS BYTE
DIM y AS BYTE
DIM b(8) AS BYTE
// Sub Routines
// Start Of Program
'portc = 0
'portb = 1
SetAllDigital // Make all Pins digital I/O's
TRISC = %00000000 // Make PORTD all outputs
TRISB = %00000000 // Make PORTB all outputs
y = 0
// Main Loop
WHILE True()
portc = Anodes_Data(0) '0
portb = Cathodes_Data(0)
delayms(1)
portc = Anodes_Data(1) '0
portb = Cathodes_Data(1)
delayms(1)
portc = Anodes_Data(2) '0
portb = Cathodes_Data(2)
delayms(1)
portc = Anodes_Data(3) '0
portb = Cathodes_Data(3)
delayms(1)
portc = Anodes_Data(4) '0
portb = Cathodes_Data(4)
delayms(300)
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
portc = %00000000
portc = Anodes_Data(0) '0
portb = Cathodes_Data(1)
delayms(1)
portc = Anodes_Data(1) '0
portb = Cathodes_Data(2)
delayms(1)
portc = Anodes_Data(2) '0
portb = Cathodes_Data(3)
delayms(1)
portc = Anodes_Data(3) '0
portb = Cathodes_Data(4)
delayms(1)
portc = Anodes_Data(4) '0
portb = Cathodes_Data(5)
delayms(300)
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
portc = %00000000
portc = Anodes_Data(0) '0
portb = Cathodes_Data(2)
delayms(1)
portc = Anodes_Data(1) '0
portb = Cathodes_Data(3)
delayms(1)
portc = Anodes_Data(2) '0
portb = Cathodes_Data(4)
delayms(1)
portc = Anodes_Data(3) '0
portb = Cathodes_Data(5)
delayms(1)
portc = Anodes_Data(4) '0
portb = Cathodes_Data(6)
delayms(300)
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
portc = %00000000
portc = Anodes_Data(0) '0
portb = Cathodes_Data(3)
delayms(1)
portc = Anodes_Data(1) '0
portb = Cathodes_Data(4)
delayms(1)
portc = Anodes_Data(2) '0
portb = Cathodes_Data(5)
delayms(1)
portc = Anodes_Data(3) '0
portb = Cathodes_Data(6)
delayms(1)
portc = Anodes_Data(4) '0
portb = Cathodes_Data(7)
delayms(300)
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
portc = %00000000
portc = Anodes_Data(0) '0
portb = Cathodes_Data(4)
delayms(1)
portc = Anodes_Data(1) '0
portb = Cathodes_Data(5)
delayms(1)
portc = Anodes_Data(2) '0
portb = Cathodes_Data(6)
delayms(1)
portc = Anodes_Data(3) '0
portb = Cathodes_Data(7)
delayms(300)
portc = %00000000
WEND // Loop back to the while loop as long as we havent finished.
Yes, and the "missing bytes" as you say are "missing" why?
For the sake of my sanity, it's time to take leave of this topic. I'm happy if I've helped in some way, but nothing you're doing has any relationship to anything I've suggested, so my work here is over.
Fear not avid readers, he shall return! PM me if you want me to give odds and take bets
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?