I have been trying to make an "INCLUDE" file containing all the various LCDDATA subroutines, but the compiler doesn't like it because LCDDATA is processor-specific, apparently. How is this done?
I have been trying to make an "INCLUDE" file containing all the various LCDDATA subroutines, but the compiler doesn't like it because LCDDATA is processor-specific, apparently. How is this done?
Not sure what you mean, but ...
The Main file that you are compiling determines the processor for all the include files too.
If you are trying to compile the include file by itself, you probably just need to change the chip in the drop-down box in MicroCode Studio.
<br>
DT
Right you are, Mr. Taylor! I had the dropdown wrong (it defaults to 16f628).
All is well once again, thank you! (I must be lacking film)
The INCLUDE file now compiles fine, but trying to compile the "Main" program causes the "Unable to open INCLUDE file NUM TEST.BAS" error. Both of the files shown below are located in c:\Program Files\Mecanique\MCS.
This is "936 include test2" file:
Pause 1000 ;for ICSP
@ __config _WDT_OFF & _CP_OFF & _PWRTE_ON & _MCLRE_ON & _INTRC_OSC_NOCLKOUT
OPTION_REG = %01000000 ;PORTB pullups enabled, no prescale
INCLUde "num test.bas"
ANSEL = 0 ;all pins digital
CMCON0 = 7 ;comparators off
ADCON0 = 0 ;ADC's off
WDTCON = 0 ;WDT off
TRISA = %00000000
TRISB = %11000001 ;switches on RB6,RB7, INT on RB0
TRISC = %00000000 ;LED on RC5, LCD bias on RC3
TRISD = %00000000
TRISE = %00001000 ;MCLR on RE3
TRISF = %00000000
TRISG = %000000
OSCCON = %01100001 ;4 mhz. internal
LCDPS = %00000000 ;Type-A,1/3 bias,no prescale
LCDCON = %01010011 ;disabled,sleep disabled,VLCD disabled,LFINTOSC,
;1/4 mux
;PIR2.4 = 0 ;clear LCD interrupt
low PORTC.5
high PORTC.3 ;apply power to LCD bias network
SwCount var byte
Main:
low PORTC.5
low PORTC.4
low PORTD.3
SwCount = 0
LCDPS = %00000000
LCDSE0 = %10110000 ;enable appropriate segment pins
LCDSE1 = %10010011
LCDSE2 = %11111110
LCDSE3 = %11111111
LCDSE4 = %11111111
LCDSE5 = %11
LCDCON = %11011111 ;enable LCD module
pause 10
gosub Dig1_1
goto Main
This is "num test" file:
Dig1_1: LCDDATA7.0 = 1
LCDDATA4.0 = 1
LCDDATA18.6 = 1
RETURN
Can someone please tell me what I'm doing wrong? Thank you.
Possibly another MCS default.
It saves new files as .PBP unless you specify .BAS
The include statements show .BAS
<br>
DT
Yes, thank you! Changing the name in the main program from .bas to .pbp fixed it.
Well, I am wrong, again! The INCLUDE file compiles, but the main program doesn't display the number "1" in the first position when i use the INCLUDE file. When I move the contents of the INCLUDE file to the main program, it works. I have tried this with other combinations of files and file names, but it just won't work! Any ideas?
Bookmarks