View previous topic :: View next topic |
Author |
Message |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Wed Mar 27, 2013 12:11 pm |
|
|
What do I have to load to MPLab, source or hex?In other words, how to tell MPlab SIM which code to handle? I know how to activate MPLAB SIM, but it will simulate nothing, unless I load the program somehow.
Thank you about answering me! _________________ A person who never made a mistake never tried anything new. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Mar 27, 2013 2:35 pm |
|
|
Read this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=40045
Also read the link that I posted in that thread.
It shows how to select MPLAB SIM as the debugger and how to
setup the Output Window to show printf messages from your program. |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Fri Mar 29, 2013 2:15 pm |
|
|
So If I have understood correctly, I have to compile the source in MPLAB without using CCS at all. Have I understood correct? _________________ A person who never made a mistake never tried anything new. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19496
|
|
Posted: Fri Mar 29, 2013 3:43 pm |
|
|
You have two options.
1) Link CCS to MPLAB. You add it as a tool to MPLAB, and MPLAB can then call CCS to do the compilation, so you can use MPLAB as the working environment, compile using CCS in this, and debug inside this.
2) Tell MPLAB what processor you are using, select MPLAB SIM as the debugger, and then just import the .COF file. When you compile this is automatically generated, and contains the debugging information.
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Mar 29, 2013 3:44 pm |
|
|
rikotech8 wrote: | So If I have understood correctly, I have to compile the source in MPLAB without using CCS at all. Have I understood correct? |
It's just not that hard. Create an MPLAB project using the MPLAB
project wizard. Use the CCS compiler. Compile it. Then follow the
instructions in the link I gave you. We all do this maybe dozens of
times a day.
I have a question. Have you ever used MPLAB with CCS before ?
I'm starting to think that you have not, and that using MPLAB SIM
is the least issue before you. You have to learn MPLAB first.
CCS with MPLAB tutorial:
http://www.ccsinfo.com/faq.php?page=ccs_mplab |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Sat Mar 30, 2013 4:55 am |
|
|
Quote: | I have a question. Have you ever used MPLAB with CCS before? |
No I haven't.
I have tried to add CCS as a toolsuite to MPLAB , but I don't know which file to use. So I did not succeed to compile the code I have written in MPLAB.
First I need to learn how to use CCS in MPLAB as a toolsuite. Then the other things would come along. _________________ A person who never made a mistake never tried anything new. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sat Mar 30, 2013 6:46 am |
|
|
Second and third last options options in the pull down menu under projects are set language tool locations... and select language toolsuite...
You may have to play with both of them.
OR you may find by installing / re-installing the latest MPLAB version it does what you need automatically.
Mike |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1345
|
|
Posted: Sat Mar 30, 2013 4:53 pm |
|
|
Don't forget if using regular mplab that you have to install the mplab plugin that you download from the CCS website. |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Sun Mar 31, 2013 2:09 am |
|
|
I downloaded mplab ide plug-in from this site http://www.ccsinfo.com/downloads.php
but when installed it, none of exe file appears in its folder. Mplab is searching for an executable file as toolsuite. So I didn't manage to fit the
CCS IDE plug-in to a Mplab. So why this mplab ide plug-in doesn't contain .exe file? May be I should install it in a certain directory, I don't know...? _________________ A person who never made a mistake never tried anything new. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19496
|
|
Posted: Sun Mar 31, 2013 3:44 am |
|
|
The plug in is not the program.
CCSC.EXE is the compiler. You already have this. The plug-in is just some stuff to make it work right.
This tells you what to do:
<http://www.ccsinfo.com/faq.php?page=ccs_mplab>
Fifth screen down, shows how you tell it to use CCSC.
Best Wishes |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Sun Mar 31, 2013 6:25 am |
|
|
I still can't understand one thing. They haven't pointed out at which directory I must install the plug-in. If I install it anywhere, MPLAB will not see it. They just saying Quote: | download and install the CCS MPLAB plugin |
Where? _________________ A person who never made a mistake never tried anything new. |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Sun Mar 31, 2013 7:37 am |
|
|
Ok I succeed to install MPLAB plug-in correctly but compiling the project I get 7 errors:
Quote: |
*** Error 18 "s.c" Line 1(9,19): File can not be opened
Not in project "D:\XP\XP\12F683.h"
Not in local "C:\Users\Riko\Desktop\XP\fff\12F683.h"
*** Error 128 "s.c" Line 2(7,29): A #DEVICE required before this line
*** Error 99 "s.c" Line 3(5,24): Option invalid No Internal Osc
*** Error 100 "s.c" Line 4(5,46): USE parameter value is out of range Not a number: PIN_A0
*** Error 128 "s.c" Line 5(2,5): A #DEVICE required before this line
*** Error 28 "s.c" Line 5(25,26): Expecting an identifier Bad SFR name
*** Error 110 "s.c" Line 9(6,10): Expecting a .
7 Errors, 0 Warnings.
|
on this code:
Code: |
#include <12F683.h>
#fuses NOWDT,NOMCLR,INTRC_IO
#use delay(internal=4M)
#use rs232(baud=9600, xmit=PIN_a0,rcv=PIN_a2)
#bit a1=getenv("BIT:GP1")
void main()
{
#define alarm a1
set_tris_a(0x00);
while(true)
{
alarm=1;
delay_ms(1000);
alarm=0;
delay_ms(1000);
}
}
|
This code works perfectly well on CCS Compiler. _________________ A person who never made a mistake never tried anything new. |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1345
|
|
Posted: Sun Mar 31, 2013 7:42 am |
|
|
If you look at he first 3 lines of what you posted, the issue is there. It cannot find the 12F683.h
You will need to go into the settings (most likely the mplab project settings) and tell it where the devices folder is in the CCS folder. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sun Mar 31, 2013 8:01 am |
|
|
There's a box near the bottom left hand corner of the MPLAB screen which shows the device MPLAB thinks it using.
That device should match the one in your code.
You can change the device from the 'Configure' pull down menu.
Mike
EDIT Have you got "set language tool locations... and select language toolsuite... " correct? |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Sun Mar 31, 2013 9:38 am |
|
|
Jeremiah Quote: | You will need to go into the settings (most likely the mplab project settings) | There is no such thing as project settings into Mplab.
Mike walne The device in the bottom left corner match to a device from the code, so this is not the issue also.
The Mplab obvious doesn't know where to looking for the devices. _________________ A person who never made a mistake never tried anything new. |
|
|
|