I'checked today and did a try vith an LCD 2 lines and same issue.
Then I suppose the problem doesnt come from the screen.
PIC : 16F685
PBP : 2.60C
Modded files : pbppic14.lib pbppi14e.lib pbppic18.lib pbppi18l.lib
Added files in PBP dir : LCD_AnyPin.pbp & VirtualPort.bas
Shematic is exactly identical in case one and 2.
Case one - The code below works with modded files but without use AnyPin function :
Code:
@ device PIC16F685, intrc_osc_NOCLKOUT, wdt_off, pwrt_on, mclr_off, protect_off, bod_on
ANSEL = %00000000 ' Set pin AN0 to AN7
ANSELH = %0000 ' Set pins AN8 to AN11
'===============================================================================
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 50 ' Data Delay (uS)
DEFINE LCD_DREG PORTB ' Set LCD Data on PORTB
DEFINE LCD_DBIT 4 ' Set starting Data bit on PORTB.4 (0 or 4) if 4-bit bus i.e, PortB.4-PORTB.7
DEFINE LCD_RSREG PORTC ' Set LCD Register Select on PORTA
DEFINE LCD_RSBIT 6 ' Set LCD Register Select bit on PORTA.4 (PORTA.3 is only in input mode)
DEFINE LCD_EREG PORTC ' Set LCD Enable on PORTC
DEFINE LCD_EBIT 7 ' Set LCD Enable bit on PORTC.7
DEFINE LCD_BITS 4 ' LCD in 4 bit mode
DEFINE LCD_LINES 2 ' 4 lines LCD display
'===============================================================================
;----[ Your Main program starts here ]----------------------------------------
LoopCount VAR WORD
PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD (You may not need this,
; but some displays are picky)
Main:
LCDOUT $FE,1 ; clear screen
PAUSE 1000
LCDOUT $FE,"Starting..."
PAUSE 1000
LCDOUT $FE,$87,"Hello,",$FE,$C8,"From DT!"
FOR LoopCount = 0 TO 65535
LCDOUT $FE,$80, IDEC LoopCount
LCDOUT $FE,$C0, IHEX4 LoopCount
NEXT LoopCount
GOTO Main
Case two - The code below doesnt work with modded files and using AnyPin function :
Code:
@ device PIC16F685, intrc_osc_NOCLKOUT, wdt_off, pwrt_on, mclr_off, protect_off, bod_on
ANSEL = %00000000 ' Set pin AN0 to AN7
ANSELH = %0000 ' Set pins AN8 to AN11
'===============================================================================
'Pins free assignment with Hijack by Darrel Taylor [http://www.picbasic.co.uk/forum/showthread.php?t=7038]
LCD_DB4 VAR PORTB.4
LCD_DB5 VAR PORTB.5
LCD_DB6 VAR PORTB.6
LCD_DB7 VAR PORTB.7
LCD_RS VAR PORTC.6
LCD_E VAR PORTC.7
LCD_Lines CON 2 ' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines)
LCD_DATAUS CON 50 ' Data delay time in us
LCD_COMMANDUS CON 2000 ' Command delay time in us
INCLUDE "LCD_AnyPin.pbp"
'===============================================================================
;----[ Your Main program starts here ]----------------------------------------
LoopCount VAR WORD
PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD (You may not need this,
; but some displays are picky)
Main:
LCDOUT $FE,1 ; clear screen
PAUSE 1000
LCDOUT $FE,"Starting..."
PAUSE 1000
LCDOUT $FE,$87,"Hello,",$FE,$C8,"From DT!"
FOR LoopCount = 0 TO 65535
LCDOUT $FE,$80, IDEC LoopCount
LCDOUT $FE,$C0, IHEX4 LoopCount
NEXT LoopCount
GOTO Main
In both cases, it compiles well without error but with AnyPin, the screen seems not initializing.
Cause AnyPin was realised before the 2.60C PBP ver., is there a compatibility issue ?
Thanx a lot for any help.
Bookmarks