PDA

View Full Version : PIC Configurator



Ioannis
- 23rd November 2013, 17:07
Microchip has a new tool, the MPLABŪ Code Configurator (MC2) here:

http://www.microchip.com/pagehandler/en_us/devtools/code_configurator/home.html

It was something that people in this forum were trying to accomplish a few years ago.

Now I have to tame that beast called MPLAB-X since the configurator is not stand alone but a plug-in.

Ioannis

HenrikOlsson
- 23rd November 2013, 19:13
If you succeed in doing that, please document it - I for one would appreciate that very much as I still haven't been able to get PBP working in that environment. (Been a while since I gave up though...)

/Henrik.

pedja089
- 23rd November 2013, 20:41
I just install plugin to MPLAB, and it have few PIC16F, and 16LF. No PIC18F supported jet...
7146

Ioannis
- 23rd November 2013, 20:51
Hi Henrik.

I am reluctant to install and use the MPLABX as I am not going to use it other than as editor. But this plug-in has drawn my attention.

As I see it, for the MPLABX to work with other environments, needs plug-ins. The only available plug-in related to PicBasic is one named PicBasic Lanquage Syntax. It is not very clear what this does or how can help us.

If anyone has more info, I'd appreciate it.

Ioannis

Ioannis
- 23rd November 2013, 20:56
Hi pedja089,

it took me some time to post my reply and you had already posted.

Are you coding and compiling PicBasic in MPLABX? Please give more details.

About configurator, can we see what code it produces regarding the peripherals or Configs?

Ioannis

pedja089
- 23rd November 2013, 21:14
Try to generate code for PIC16F1947, but no lack. Clik on generate code, but I can't find where is generated.
I'm using MPLAB X V1.7, maybe that is problem. But I don't want to push lack and to try to instal V1.90...
I'm using it with PICkit 3, as debugger and editor.
I found post on forum how to setup. After few attempt I succeeded.
But I had problem finding tool chain or plugin, can't remember...
Here is some links:
http://www.picbasic.co.uk/forum/showthread.php?t=15839
http://www.picbasic.co.uk/forum/showthread.php?t=16287

Ioannis
- 23rd November 2013, 21:35
From the tutorials it seems that the files are header types or kind of include files to compile with main.c

From the Project tree I suppose they should be accessible.

Ioannis

towlerg
- 24th November 2013, 01:59
It would appear to be part of MPLABX rather than a plug-in (and of course as Ioannis points out it's in C).

pedja089
- 24th November 2013, 22:42
Plugin installed in MPLAB X 1.70
I checked project tree, and I found saved configuration, but there is no generated files anywhere, with PBP compiler.
Tried with XC8 compiler, still no generated header files.
Installed 1.95 on old PC, and import old settings, with PBP3 compiler nothing generated...
So probably not compatible with PBP...
I don't have XC8 installed on that PC.

Demon
- 25th November 2013, 00:44
This is the kind of stuff I encountered when I tried way back when, and now I'm using good ol' Microcode Studio Plus.

Robert
:)

Ioannis
- 25th November 2013, 12:14
Of course it won't produce any PBP compatible code, nor I implied that either.

It does only C code and then one I guess has to copy-paste-modify a little the code from C to Basic.

But have not installed the MPLBX yet. The tutorials though show a great tool to setup any PIC in a seconds, or two.

Ioannis

Demon
- 25th November 2013, 15:32
Too bad it is for C only:


generates seamless, easy to understand C code that is inserted into your project.

I'm still on 2.6c so I don't think I could use MPLABX anyways.

Robert

mackrackit
- 25th November 2013, 16:19
I'm still on 2.6c so I don't think I could use MPLABX anyways.

Robert
MPLABX works fine with PBP 2.6x

This talks about setting it up. MPLABX did have some bugs at first but now it is good.
http://support.melabs.com/threads/91-Mplab-X?highlight=mplabx

Demon
- 25th November 2013, 23:50
Oh cool. I must have misread that X was for PBP 3.

So now we need that addon for pbp.

:)

pedja089
- 27th November 2013, 00:23
To install PBP in MPLAB X 1.95:
0) First download MPLAB X from http://www.microchip.com/pagehandler/en-us/family/mplabx/ and install it, then run.'<< Added later
1) Go to Tools>Plugins
2) Select tab Available Plugins
3) Mark PBP Tool Chain and PicBasic Language Syntax
4) Click "Install"(Require internet connection), after installation plugins should be visible in installed tab
5) Restart MPLAB X
6) Tools>Option
7) Select tab Embedded then click "Add...",
8) Browse to "C:\PBP3", do not open folder, just select.
9) And that's all, folks:)
To create new project:
1) File>New project>"Next"
2) chose PIC>"Next"
3) Select programmer/Debugger>"Next"
4) Select PICBasic pro>"Next"
5) Enter project name, Set as Main Project>"Finish"
Now add source file:
1) Right click on Source Files in project tree
2) New>Other> click Basic directory, select PICBASIC file>"Next"
3) Enter name(Must be without spaces)>Finish, Now file is visible in project tree.
Enable Long
4) File>Project Properties> PBPW> check PBPL Compilation.
Add few lines, try to debug... Right click on toolbar to customize, to add step, Add PIC memory view, configuration bits, etc...
7151
Now there is little problem with debugging WORD and LONG var's and bit's. Just with that:)
As you can see, only first byte is showing.
Add new watch, but this time by entering address of variable, not name.
Watch are case sensitive.
7152
And select size of var(WORD=16bit, Long=32 bits),
And now we can see actual value in variables.
Define byte container for bits, eg
BitCont var byte
LightOn var BitCont.0
And then add BitCont to watch... Another way is to find PBP's byte container in .mac file if I can remember correctly. Right click to customize layout...
7153
Note that address of Z isn't same. So watch out for that. Every time when variables is added/removed, check address...
Check out local history by right click on file name
7154
And save often, sometimes when I pres shift and "[" or "]" by mistakes, it should just add char "{" or "}" but 99,9 won't add char, it will freeze...
On 1.70 version after minute or so you can click save button if you have luck. On this version seems to stuck forever...
I hope this will be helpful...

Ioannis
- 27th November 2013, 07:44
Very good pedja089! You have triggerd me to install this beast and test it.

Thanks,
Ioannis

Demon
- 27th November 2013, 14:02
Excellent work, copied post to a new thread in Documentation.

Robert

pedja089
- 27th November 2013, 20:15
Thanks.
You made double thread.

Demon
- 28th November 2013, 02:29
Thanks.
You made double thread.

Ooops, corrected.

Robert