Besides just clearing the TFT screen with the 65Org16 Core successfully @40MHz(TFT&FPGA)!. I've previously mentioned I was only able to run @24MHz max also noticed 110mV noise on the RESET circuit. I've since added an external 1K pull-up resistor and this NHD640x480TFT is working at a more normal 40MHz max with the Spartan 6.
I've modified the 8bit PLTCHR routine I previously posted above to work with the 65Org16. This validates in my mind that this 16bit mod'd Core even works. I had some small doubts, very small, but all of the errors I've found so far have been my own programming errors. I am still modifying the ATTBUTE routine for some extra features of 16bits. But using the original ATTBUTE with the 16bit PLTCHR routine below, I have successfully used the 16bit CLRSCR and 16bit PLTCHR to plot different sizes of the 2 different character sets.
Sorry about the indentation discrepancy. I am a newbie to PSPAD text editor.
Code: Select all
PLTCHR PHA ;Plot Character Subroutine variable (1-7) H and V size
TYA ;save all reg's
PHA
TXA
PHA
LDA #$2C ;Prepare TFT to Plot
STA DCOM
CACALC SEC
LDA CHR
SBC #$20 ;first 32 ascii characters "undefined"
BCS nnull
LDA #$00 ;make undefined char's a defined zero
nnull ASL A
ASL A
ASL A ;multiply character by 8 to get char pointer
CLC
ADC CHRVECL ;add pointer to base either CA00 (C64) or CD00(3x5)
STA CHRVECL
ninc LDY #$00 ;vertical bit count
loop7 LDX YWIDTH
loop4 TXA
PHA
CLC
LDX #$00 ;horizontal bit count
LDA (CHRVECL),y ;character data addr, $FFFFCA00(c64) or $FFFFCD00(3x5)
ASL A ;
ASL A ;
ASL A ;
ASL A ;
ASL A ;
ASL A ;
ASL A ;
ASL A ;shift out upper 8 bits, don't care for 8-bit byte character font
loop5 ASL A ;Shift left
BCC nonpxl ;branch on 'blank' bit
pxl2 PHA ;save character data
TXA
PHA
LDX XWIDTH
xwp LDA TMPCOL1
STA DDAT ;plot RED pixel TFT data
LDA TMPCOL2
STA DDAT ;plot GREEN pixel TFT data
LDA TMPCOL3
STA DDAT ;plot BLUE pixel TFT data
DEX
BNE xwp
PLA
TAX
PLA
INX
CPX CHRXLEN
BNE loop5 ;test for horizontal max
JMP next
nonpxl PHA ;save character data
TXA
PHA
LDX XWIDTH
xwnp LDA SCRCOL1
STA DDAT ;plot RED "blank" pixel TFT data
LDA SCRCOL2
STA DDAT ;plot GREEN "blank" pixel TFT data
LDA SCRCOL3
STA DDAT ;plot BLUE "blank" pixel TFT data
DEX
BNE xwnp
PLA
TAX
PLA ;reload character data to accumulator
INX
CPX CHRXLEN
BNE loop5
next PLA
TAX
DEX
BNE loop4
INY
CPY CHRYLEN ;test for vertical max
BNE loop7
PLA
TAX
PLA
TAY
PLA ;reload all reg's
RTS