PDA

View Full Version : New PBP and MCS -- a few errors



Michael
- 20th February 2020, 15:52
I've mentioned before, I'm an occasional programmer so hard to commit things to memory -- hence the many questions.

Ok -- so I bought the latest PBP gold (3.1) and MCS+ (V5) yesterday.

I've been working on something with the 16F88 and all has been fine but needed more memory so going to the 16F1847 and updating all the software was needed for me to work with this chip.

(1) I just compiled in MCS and get an error "unable to execute MPASMWIN". ?
I do not have "use the mpasmx assembler" checked, as I never had that checked before in my old setup. Fact is, I'm confused about all of that anyway, when and why should I use the MPASM assembler? Or ever? (Never used it before).



(2) If anyone knows, in my code for the 16F88, I had ADCON = 0 and CMCON = 7 (porta all digital and comparators off?) -- anyway, worked fine but with 16F1847, I get errors on both of these statements. I know each chip has different configuration needs -- what would they be for the 16F1847?


THANKS. I'm sure I'll have more questions.

Michael
- 20th February 2020, 16:07
is it this for my 2nd question?

ANSELA = 0
ANSELB = 0

CM1CON0 = 0
CM1CON1 = 0
CM2CON0 = 0
CM2CON1 = 0

OSCCON = %01101000 same osccon (4mhz) I used for 16F88 ?

Michael
- 20th February 2020, 17:29
Also -- I do have PBP listed as the default compiler in MCS. It's pointing to the PBP_3 folder.

HenrikOlsson
- 20th February 2020, 17:32
MCS is what's called an IDE, an Integrated Development Environment or put another way, a glorified text editor. You don't have to use it, you can write your programs in any text editor. I do recommend using MCS, I just want make it clear that it's not NEEDED.

PBP is the compiler. The compiler converts your program into assembly language but that's not what the target device is using so in comes the last part, the assembler.

The assembler takes the assembly code and converts into a binary file ready to be loaded into the chip your targeting.

Previously, PBP used to ship with it own assembler, called PM, but it doesn't any more. In fact, the newer versions of PBP requires the use of MPASM or MPASMX. The checkbox in MCS is (or was) used to select if the compiler, when it's done spitting out assembly language, should invoke PM or MPASM. Since PM is no longer supported you should invoke MPASM(X) and for that to work you must have it installed - it comes with the MPLAB(X) IDE but I think we've covered that before.

I don't have time to look up the datasheet for your part right now but you are correct that you can not and should assume that just because you did it one way on one chip it's the same for the other chip.

/Henrik.

Michael
- 20th February 2020, 17:38
Ok -- tried both checked and unchecked. Using MPASM X as the assembler created MANY errors.
There was a file I downloaded that was the Picbasic plug in? Anyway --an nbm file and when I open it doesn't respond. Do I install this after opening MPLAB ? If so, how?

THANKS. so to be clear, you NEED to use MPLAB X in the updated PBP right?

HenrikOlsson
- 20th February 2020, 17:52
No, you don't have to USE MPLAB X but you need to have it INSTALLED so that you have access to the assembler that comes with it. And, it doesn't HAVE to be the assembler from MPLAB X, it can be an older version from MPLAB 8 but then it won't be able to assemble programs for newer part.

So, if you haven't installed MPLAB X then do so. I Believe the plugin you mention is when you want to so the reverse, ie use PBP as the compiler from within MPLAB X.

/Henrik.

Michael
- 20th February 2020, 18:06
Thanks Henrik.

Yes, I have had MPLAB X installed (latest) and was just playing around and got a successful assembly. Was getting some errors and maybe you can help me confirm what I was doing wrong (using 16F1847).

I had -- (with the 16F88)

@ DEVICE pic16F88, INTRC_OSC_NOCLKOUT
''' System Clock Options
@ DEVICE pic16F88, WDT_ON
''' Watchdog Timer
ETC

but apparently the 1847 needs a hashtag like -- ?
#CONFIG ; F1847.
__config _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _BOREN_OFF
__config _CONFIG2, _PLLEN_OFF & _LVP_OFF
#ENDCONFIG

also -- found this,

@ ERRORLEVEL -306 ; turn off crossing page boundary message

which got rid of my boundry error. ?

does it FIX the boundry problem or just get rid of the message ? THANKS MUCH FOR HELP.


Think I have it working right now.

HenrikOlsson
- 20th February 2020, 18:23
Great, you're making progress!

That #CONFIG / #ENDCONFIG is "new" in PBP3 and it is what you should use for ALL devices.

In your PBP3 installation folder there's a sub folder called DEVICES_REFERENCE. If you look inside of that you'll find a file for each device the compiler supports and inside the file(s) you'll find all the available CONFIG bit options and what defaults PBP is using in case you DON'T include a #CONFIG / #ENDCONFIG block in your code. Also, make sure to read the manual as it explains it better than I can.

The "boundry error" is not an error - it's a message ment to make you aware of the fact that the code is crossing a page boundry. If you're NOT using any embedded assembly code in your programs you don't have to worry about it and can safely have the message disabled.

/Henrik.

Michael
- 20th February 2020, 18:35
Good deal.

I'll have to make note I can have all the config info handy -- always a hassle. Although I generally stick to one chip for what I do.

Not as dumb as I sound, just impatient. Honestly, the documentation on both MCS and PBP could be much clearer especially for installing and possible mishaps. thanks.

Michael
- 20th February 2020, 18:38
do you know how to open the .INFO file in device references?

do you just rename it text or something?

HenrikOlsson
- 20th February 2020, 19:12
Just open them with your favourite text editor or in MCS.