PDA

View Full Version : PIC18F452.INC not found



isaac
- 26th March 2008, 17:11
Hi All

I have been off programming for quite a while now and i am finding it really difficuit
to get my 18F452 to program.
i am using pbp 2.45 and Mplab V8.
Each time i try to complier gives the following errors which i have attached.
"Cannot open file (Include file "PIC18F452.INC" not found)
it complies ok on 16F series thought.
i know its something to do with the include file but i not sure

Please help

Isaac

isaac
- 26th March 2008, 17:16
I have also included the code i am running and the include file

@ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H

Define OSC 20
clear

DEFINE LCD_DREG PORTD ' Use Portd for LCD Data
DEFINE LCD_DBIT 4 ' Use Upper(4) 4 bits of Port
' PORTD-4 thru PORTD-7 connects to
' LCD DB4 thru LCD DB-7 respectively
DEFINE LCD_RSREG PORTE ' PORTE for RegisterSelect (RS) bit
DEFINE LCD_RSBIT 0 ' PORTE-0 pin for LCD's RS line
DEFINE LCD_EREG PORTE ' PORTE for Enable (E) bit
DEFINE LCD_EBIT 1 ' PORTE-1 pin for LCD's E line

DEFINE LCD_BITS 4 ' Using 4-bit bus
DEFINE LCD_LINES 2 ' Using 2 line Display
DEFINE LCD_COMMANDUS 2000 ' Command Delay (uS)
DEFINE LCD_DATAUS 50 ' Data Delay (uS)

' ** Define LCD Control Constants **

I CON 254 ' Control Byte
Clr CON 1 ' Clear the display
Line1 CON 128 ' Point to beginning of line 1
Line2 CON 192 ' Point to beginning of line 2


' Software Defines
' ----------------
' ** Declare the Variables **
Temp VAR word ' General Purpose
Data_Out VAR word ' Data read from the Eeprom
Data_In VAR word ' Data written to the Eeprom
address VAR word' Address

'
' Initialise Hardware
' -------------------
ADCON1=7
TRISA=%00000000
TRISB=%00000000
TRISC=%10000000
TRISD=%00000000


Pause 1000
lcdout I,Clr:Pause 30
lcdout I,Line1," 18F452 TEST "
lcdout I,Line2+2,"..Power On.. !!"
Pause 1000 '
Data_Out=0: Data_In =0: Temp =0

'WRITE SUB
'=======
For address = 0 TO 100 STEP 2 ' Loop 50 times
Data_In =Temp ' Data_In is data for EPPROM
WRITE address,Data_In.LowByte
WRITE (address+1),Data_In.HighByte
Pause 10 ' Delay 10ms after each write
Temp =Temp + 1000 ' Add 1000 to the previous value
Next address



loop:
'READ SUB
'=======
For address = 0 TO 100 STEP 2 ' Loop 50 times
lcdout I,Clr:Pause 30
READ address,Data_Out.LowByte
READ (address+1),Data_Out.HighByte
lcdout I,Line1+2," Eprom Values :"
lcdout I,Line2+2,#address,": ",#Data_Out ' Display Eprom Data

Pause 1000
Next address
GoTo loop

End

skimask
- 26th March 2008, 17:21
Have you tried a complete reinstall yet?

Ya know, the upgrade to PBP 2.50a is only $25...
Why waste the time with a reinstall when you can have the latest/greatest for a minimal cost?

Acetronics2
- 26th March 2008, 17:21
Hi, Zaac

do you Use MPASM as an assembler ??? the Error file shows some MCS ...

Alain

skimask
- 26th March 2008, 17:22
do you Use MPASM as an assembler ???
Doesn't that kick out a totally different error? Something like "18F not supported with PM" or something like that?

Acetronics2
- 26th March 2008, 18:13
Hi, Ski

You're right ... there's a window appearing in MCS if wrong assembler selected.

the worst is the program compiles and assembles fine here ...


Isaac,

check : VIEW\Compile and Program options\ assembler tab and verify if good locations given.

Alain

Darrel Taylor
- 26th March 2008, 21:35
Try this Isaac,

http://www.picbasic.co.uk/forum/showpost.php?p=52195&postcount=11
<br>

isaac
- 27th March 2008, 00:53
Thank All

i have got it to compile now.
Darrel Taylor hit the nail on the head .
I pointed to it as he describe below andit worked
================================================== ====
In MCS, go to the View | Compile and Program Options | Assembler Tab

Click the Find Manually ... button and point it to
C:\program files\microchip\mpasm suite
===========================================
i thinkit was trying to use the mpasm that came with Microcode studio

Thanks a million
Isaac