PDA

View Full Version : PBP is driving me crazy trying to make an 18F chip blink



George
- 20th June 2008, 01:44
I'm normally a calm collected person - but I'm about ready to throw my computer and all associated components out the window.

I've spent around 10 hours so far trying to make an LED on an 18F8722 blink

I was running PBP2.42 and just bought the upgrade to PBP2.50, I know I might be a little unrealistic in my expectations but I feel strongly that when you pay good money for software it should just work, you shouldn't have to mess around with the operating files - it should just work!

I whittled away at my old INC and BAS files till eventually I got no errors - you know doing the old subtitute __CONFIG for CONFIG, changing labels and so forth - I got it programmed but LED no flash.

At that point I bought the upgrade - but the new version came up with more problems and errors than the old one. Why won't it work?????

I get errors like : address exceeds max range for this processor
overwriting previous address contents
missing "=" in parameter

I'm genuinely about to start looking at other compilers if I can't get this problem nutted soon, It's just proving to be a total waste of my time and money. Common guys at MELabs - just make it work is all that I ask.

Here's my code that seems to be taxing it so much

@ CONFIG OSC=HS
' Use HS oscillator (10MHZ)

TRISB = 0
TRISH = 0
porth = 0

Start:
porth.0 = 1
pause 500
porth.0 = 0
pause 1000
goto start

mackrackit
- 20th June 2008, 02:14
First thought. Being that you want to set the fuses in the code, have you commented out the code in the *.inc file?

"overwriting previous address contents"

Indicates you have not.

And you have and use the latest MPASM?

Hang in there. It will work.

And you may want to look at this if you have not already.
http://www.picbasic.co.uk/forum/showthread.php?t=543

George
- 20th June 2008, 03:11
OK, yeah I've been reading that thread over and over, I got rid of the osc=hs define in the code and that got rid of most of my errors thanks, So if you want to define something that's listed in the INC you have to REM it out in the INC file?

My issue now is the errors listed are missing "=" in parameter...

the inc file is written like this: CONFIG _CONFIG1H, _OSC_HS_1H

do I change it to read? CONFIG OSC=HS

If so, why? Why hasn't this been done for me? This was brought up three years ago in the post that you mention, I've bought the latest version of PBP and downloaded the latest MPASM (v5.2) This is my first time using MPASM and the 18F chip, so may not really know wot I'm doing - but surely it shouldn't be this hard

Thanks for your input

Archangel
- 20th June 2008, 04:33
OK, yeah I've been reading that thread over and over, I got rid of the osc=hs define in the code and that got rid of most of my errors thanks, So if you want to define something that's listed in the INC you have to REM it out in the INC file?

My issue now is the errors listed are missing "=" in parameter...

the inc file is written like this: CONFIG _CONFIG1H, _OSC_HS_1H

do I change it to read? CONFIG OSC=HS

If so, why? Why hasn't this been done for me? This was brought up three years ago in the post that you mention, I've bought the latest version of PBP and downloaded the latest MPASM (v5.2) This is my first time using MPASM and the 18F chip, so may not really know wot I'm doing - but surely it shouldn't be this hard

Thanks for your input
Hi George,
My first try with an 18F actually 18F4550, I copied one of my other programs to try it out.
Configs are pretty much assembly, PBP whisks right past and MPASM chokes on them, EDIT: Mackrackit has the skinny on the settings below, Found in P18f8722.inc file in MPASM Suite directory.

mackrackit
- 20th June 2008, 04:48
I normally set the configs in the *.inc, just a personal pref I guess.

I do not have a 8722 so I can not test it, But this compiles.


DEFINE OSC 10

TRISB = 0
TRISH = 0
porth = 0

Start:
porth.0 = 1
pause 500
porth.0 = 0
pause 1000
goto start

And this is the *.inc


LIST p = 18F8722, r = dec, w = -311, w = -230, f = inhx32
INCLUDE "P18F8722.INC" ; MPASM Header
__CONFIG _CONFIG1H, _OSC_HS_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
NOLIST

And yes, if you set the fuses in code space, the *.inc needs to be REMed.

George
- 20th June 2008, 06:08
Hey guys, finally got it going thanks for your input - changed the INC files and it works well - interesting that MPASM gets choked on the configs here's wot I changed it to :) finally

NOLIST
ifdef PM_USED
LIST
"Error: PM does not support this device. Use MPASM."
NOLIST
else
LIST
LIST p = 18F8722, r = dec, w = -311, w = -230, f = inhx32
INCLUDE "P18F8722.INC" ; MPASM Header
CONFIG OSC=HS
CONFIG WDT=ON, WDTPS=512
CONFIG MCLRE=ON
CONFIG LVP=ON, XINST=OFF
NOLIST
endif
LIST
EEPROM_START EQU 0F00000h
BLOCK_SIZE EQU 64