been hacking and still can't get any displan much less a code without errors. In the section Draw Data I get errors Data_Bus = Sentence_Data XOR %11111111 ' reverse the data bits
I need to get this working as I received my boards etc.
Code: Select all
{
}
{
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2016 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 11/29/2016 *
* Version : 1.0 *
* Notes : *
* : *
*****************************************************************************
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [SELECT VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2014 [SELECT VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 3/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 "SUART.bas"
// Arrays
// Arrays
// Arrays
// Desired sentence (ANODES)
CONST Sentence_Data(96) AS BYTE = (%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111110,%01001010,%01001010,%01000010,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111110,%01000010,%01000010,%01000010,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00111100,%01000010,%01000010,%00111100,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111110,%01000010,%01000010,%01000010,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111110,%01000010,%01000010,%01000010,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000)
// CATHODES
CONST Row1Data(8) AS BYTE = (%11111110,%11111101,%11111011,%11110111,%11101111,%11011111,%10111111,%01111111)
DIM Display_Out AS BYTE ' CONST array data
DIM Display_Buffer(8) AS BYTE ' data to send to matrix
DIM Data_Bus AS portb ' data that matrix displays
DIM Colum_start AS WORD ' cathodes
DIM Anode_Data AS PORTC ' Anodes
DIM x AS BYTE
DIM y AS BYTE
DIM Speed AS BYTE
//SUB ROUTINES
SUB Load_Buffer()
FOR x = 0 TO 15 ' 120 / 8 = 15
Display_Buffer(x) = Sentence_Data(x)
NEXT
END SUB
SUB Draw_Data()
FOR x = Colum_start TO (Colum_start+7) ' COLUMS ON PORT b counter
Display_Out = Display_Buffer(x) ' const data
Data_Bus = Display_Out XOR $11111111 ' inverts the CONST array data at the port
Display_Buffer(x) = Sentence_Data(x)
Data_Bus = Sentence_Data XOR %11111111 ' reverse the data bits
Data_Bus = 0 ' data bus
Data_Bus.bits(7 - (x- Colum_start)) = 1 ' cycle the anodes from 0 to 7
Data_Bus = 0
display_out = 1
DELAYMS(10)
display_out= 0
NEXT
END SUB
SUB Scroll_Text()
IF Speed <> 0 THEN
DEC(Speed)
ELSE
Speed = 6
Colum_start = Colum_start + 1
IF Colum_start + 8 = 96 THEN ' # of elements in CONST array Colum Start is Cathodes on portb
Colum_start = 0
END IF
END IF
END SUB
'END SUB
'SetTX(PORTC.6)
'SetRX(PORTC.7)
'SetBaudrate(sbr9600)
'SetMode(umTrue)
SetAllDigital // Make all Pins digital I/O's
TRISC = %00000000 // Make PORTD all outputs
TRISB = %00000000 // Make PORTB all outputs
y = 0
Speed = 50
Colum_start = 0
Load_Buffer()
WHILE true
Draw_Data()
FOR y = 0 TO 20
Draw_Data()
NEXT
Scroll_Text()
WEND