Hi Richard,
Thanks for the fix on the single char problem, it works well but I've found another problem...
When I add DT Ints the big characters don't work, I tried with and without using mssp but same result.
Also there's something strange taking place with the led backlight insomuch as I need to sprinkle port pin enable code immediately following any lcd write (with or without DT Ints). I tried changing LCD_LIGHT from A.0 to A.1 (while leaving it connected to A.0) with no difference - does the Inc file employ any commands for the light?
Here's the edited code:
Code:
#CONFIG ; 16F1847.
__config _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _BOREN_OFF
__config _CONFIG2, _PLLEN_OFF & _LVP_OFF
#ENDCONFIG
@ ERRORLEVEL -306 ; turn off crossing page boundary message
; --- *** Oscillator *** ---------------------------------------------------
define OSC 32
OSCCON = %11110000 ; 32 MHz,
ANSELA = 0 ; all digital
ANSELB = 0 ; all digital
TRISA=%00000000
'TRISB=%00000000
TRISB=%11101011 ; Encoder inputs on B5-7
ch var byte
BUFF VAR BYTE [10]
;DEFINES FOR DISPLAY use font7x5_16.bas or font7x5_18.bas for pic18
#DEFINE PIC16 1
#define use_mssp 1 ; much faster and less words (1027 vs 1106).
lcdheight con 5 ; 6 PAGES
lcdwidth con 83 ; 84 PIXELS WIDE
LCD_RST var LATA.4
LCD_DC var LATA.3
LCD_CE var LATA.6
LCD_LIGHT var LATA.0
LCD_CLK var LATB.4 ' SCK1 pin needs to be set as dig o/p
LCD_DIN var LATB.2 ' SDO1 pin needs to be set as dig o/p
;--------------ONLY IF MSSP NOT USED---------------
' LCD_CLK var Portb.4 ' Clock
' LCD_DIN var Portb.2 ' Data
Include "Modedefs.bas"
INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP.bas" ' Include if using PBP type interrupts
Include "nokia_ds.INC" ' bring it in
include "font7x5_16.bas"
'include "font7x5_16 edit degC.BAS" ; use @ to access degC symbol.
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler IOC_INT, _Rot_Encoder, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE IOC_INT ; Port Change Interrupt
'========================== MAIN Routine ==============================
gosub lcd_init
LCDCLR
ARRAYWRITE BUFF,["READY",0]
LCDSTR 5,0,BUFF
PortA.0 = 0 ' turn on backlight.
PAUSE 1000
LCDCLR
PAUSE 1000
looper:
LCDCLR
PortA.0 = 0 ' turn on backlight.
bigtxt = 1 ; double size chrs
LCDSTR 0,0,"Noki+12"
LCDSTR 0,2,"345678@"
bigtxt = 0 ; normal size chrs
' LCDSTR 52,3,"Demo"
' LCDSTR 0,4,"With@MSSP xfer"
LCDSTR 0,4,"Hi"
PortA.0 = 0 ' turn on backlight.
' LCDSTR 0,5,"Dble Size Chrs"
' LCDSTR 0,5," " ; this doesn't compile - causes errors and warnings wherever used.
LCDC 0,5,"a" ; use LCDC for single chars.
PortA.0 = 0 ' turn on backlight.
PAUSE 1000
GOTO looper
Rot_Encoder:
' if PortB.7 = 0 then ' Check if Encoder pushbutton was pushed.
' ButtPush = 1 ' Set the flag for a quick exit.
' Old_Bits = New_Bits ' Equalize the disturbance the pushbutton caused.
@ INT_RETURN ; Exit accordingly.
' endif
END
Is the Inc file compatible with DT Ints?
Regards,
Bill
Bookmarks