PDA

View Full Version : 18f4320



Peter1960
- 3rd December 2007, 12:20
Brand New Proccesor Attempt !

I am using microcode studio Pic Basic Pro.

Initial Test

@ INCLUDE 18F4320.INC
__CONFIG_CONFIG1H,_XT_OSC_1H ' This is line 21

Hit F9 (Compile)

ERROR Line 21: Syntax Error

I looked and looked and tried, but waht is the syntax error !!!

Help, please

kind regards

Peter

mister_e
- 3rd December 2007, 15:27
No Need for any include...

and yup, the config statement is wrong...

Presetting Configuration Fuses (PIC Defines) into your Program
http://www.picbasic.co.uk/forum/showthread.php?t=543


@ __CONFIG _CONFIG1H, _XT_OSC_1H

mackrackit
- 3rd December 2007, 15:47
Make sure you are using MPASM.

And I still follow the instructions here. http://www.picbasic.co.uk/forum/showpost.php?p=13087&postcount=6

Maybe this has been fixed or changed , but still works for me.

mister_e
- 3rd December 2007, 16:13
this have been fix in 2.47 If you want to use the new syntax, maybe you need to do it in the INC file... i never tried. I still use the old syntax.

mackrackit
- 3rd December 2007, 16:28
Thanks for the update.
I set the fuses in the *.inc file. I should try it in the program some day.
One of the first things I did when I up graded to 2.47 was changed the *.inc, never noticed the fix :o

This is part of my *.inc .


CONFIG OSC = INTIO2
CONFIG LVP = OFF
CONFIG BOR = OFF
CONFIG MCLRE = OFF

; __CONFIG _CONFIG1H, _XT_OSC_1H
; __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
; __CONFIG _CONFIG4L, _LVP_OFF_4L

Peter1960
- 3rd December 2007, 21:03
Looks like I need to upgrade PBP as I have only version 2.44

MPASM or MPASMWIN ?

Suggestions on which Microcode version to use or

A windows version of PBP ? (Is Microcode the windows version?

kind regards for all of the answers.

Peter

jblackann
- 3rd December 2007, 21:32
I am looking to possibly migrate from a 16F690 to the PIC18F2520 and am having problems when compiling it with Microcode studio. I am using PIC BASIC PRO 2.46. Not sure what version of MPASMWIN I have running. If I try compile this in Microcode studio, the Microchip MPASM v5.13 is invoked and I get the following:

Error[122] c:\projects\1631\progr2.asm 353:Illegal opcode(pic18F2520)
Warning[207] c:\projects\1631\progr2.asm 353 : Found label after column 1 (DEVICE)
There are a bunch of these and I am sure they are for the configuration files.

My configuration code is this:
@ DEVICE pic18F2520, XT_OSC
' System Clock Options
@ DEVICE pic18F2520, WDT_ON
' Watchdog Timer
@ DEVICE pic18F2520, PWRT_ON
' Power-On Timer
@ DEVICE pic18F2520, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic18F2520, BOD_ON
' Brown-Out Detect
@ DEVICE pic18F2520, CPD_OFF
' Data Memory Code Protect
' Set to CPD_OFF for Development Copy
' Set to CPD_ON for Release Copy
@ DEVICE pic18F2520, PROTECT_ON
' Program Code Protection
' Set to PROTECT_OFF for Development Copy
' Set to PROTECT_ON for Release Copy

======================

When I opened the file in MPLAB and compile it I receive the following:
Executing: "C:\pbp\PBPW.EXE" -ampasmwin -oq -z -p18F2520 " 18F2520 prog w LCD v00.pbp"
PicBasic Pro Compiler 2.46, (c) 1998, 2005 microEngineering Labs, Inc.
All Rights Reserved.
Warning[230] C:\PBP\18F2520.INC 20 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Warning[230] C:\PBP\18F2520.INC 21 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Warning[230] C:\PBP\18F2520.INC 22 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Warning[230] C:\PBP\18F2520.INC 23 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Warning[207] C:\PROJECTS\1631\PROG\18F2520 PROG W LCD V00.ASM 321 : Found label after column 1. (DEVICE)
Error[122] C:\PROJECTS\1631\PROG\18F2520 PROG W LCD V00.ASM 321 : Illegal opcode (pic18F2520)
Warning[207] C:\PROJECTS\1631\PROG\18F2520 PROG W LCD V00.ASM 329 : Found label after column 1. (DEVICE)
Error[122] C:\PROJECTS\1631\PROG\18F2520 PROG W LCD V00.ASM 329 : Illegal opcode (pic18F2520)
Loaded C:\Projects\1631\Prog\18F2520 prog w LCD v00.COD.
BUILD SUCCEEDED: Mon Dec 03 16:26:14 2007

==================================
I have not tried to bread board the micro yet to see if it works.

Is there something or some way that I can compile the code to keep from getting errors? Any thoughts? Thanks for all the help.

mister_e
- 3rd December 2007, 23:39
MPASM don't work with DEVICE, you MUST use __CONFIG and it's related syntax.

Have a look at the faq, always the same link
http://www.picbasic.co.uk/forum/showthread.php?t=543

For the config deprecated stuff, you may edit your INC file OR just insert the following line..
@ ERRORLEVEL -230
at the top of your code.

As soon as possible, i'll suggest you to update your PBP to 2.50

mackrackit
- 4th December 2007, 05:55
Looks like I need to upgrade PBP as I have only version 2.44
You should upgrade but 2.44 supports this chip.


MPASM or MPASMWIN ?
I use MPLAB and It does use MPASMWIN, never told it to, built in I guess. Why the PBP *.inc file says to use MPASM? Must be for command line work?


Suggestions on which Microcode version to use or
Use MPLAB.


A windows version of PBP ? (Is Microcode the windows version?
PBP is a windows program. I run MPLAB with PBP as the language tool suite. I am a LINUX user so I also have to use WINE for the windows part.