Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:17 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Help with MPLAB X please

Author Message
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 02:28am 29 Nov 2017
Copy link to clipboard 
Print this post

I recently downloaded MPLAB X since the PIC I'm currently using (16F1708) cannot be fully tested in MPLAB 8.92 since that PIC is not fully supported in 8.92.

I have been able to import the programme into MPLAB x, but I can't see how to test it. There is a daunting array of info available but I can't find anything to help.

In MPLAB 8.92, I used the function keys F7 & F9 to step through the programme so I could test it.

But with MPLAB X, I cannot find the equivalent facilities.

So how do I test my programme in MPLAB X?

Any assistance will be appreciated.

Len



 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 02:31am 29 Nov 2017
Copy link to clipboard 
Print this post

What OS are you using and what are you connecting to the target with?
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 06:32am 29 Nov 2017
Copy link to clipboard 
Print this post

Thanks for the response.
I have Windows 7.

I assume the second part of your question means that the PIC is the "target".

I have a Pickit3 on order. But I would prefer to do it as I do in MPLAB 8, ie. test it on the screen before programming the PIC.

Len
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 08:49am 29 Nov 2017
Copy link to clipboard 
Print this post

I never played with any simulation on earlier versions of MPLAB so I'm can't really help with that.

Previously did target testing and programming using picKit3 in MPLAB earlier versions and X under OSX.

Have moved to windows 10 notebook and new unit has 4K screen. MPLAB IDE and IPE cannot handle it and are unusable. Have had to switch back to my old machines when I need to use MPLAB until they fix it.

Hopefully you will enjoy reasonable debugging with the PicKit3.
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 09:17am 29 Nov 2017
Copy link to clipboard 
Print this post

Thanks,
What I have gathered from your comments is that I need Pickit3 to run the programme on a PIC so I can test it.

Is that true?

Len
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 10:06am 29 Nov 2017
Copy link to clipboard 
Print this post

Yes that is what I have done in the past when working on C/Assembler code with PIC.

I say limited because the PicKit3/MAPLAB is not a full debugger like I used to use when working on Server Hardware and OS development. I do not have the Microchip ICD or ICE as the projects I have been doing with the PIC do not justify the cost of either of these units.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 10:50pm 30 Nov 2017
Copy link to clipboard 
Print this post

Open the dialog "File:Project Properties(project name)"

In the "Hardware" section, select "Simulator" and click "OK"

Select "Debug:Debug Main Project"

If your project assembles/compiles without error, you should be able to perform all the usual actions - run, step, step over, examine memory and variables, etc. A new section of tool bar will appear with the required buttons.
Visit Vegipete's *Mite Library for cool programs.
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 01:48am 01 Dec 2017
Copy link to clipboard 
Print this post

Thanks vegipete,
I did all of that, but I still can't see the run, step over, etc icons.

The project complied successively. See the attachment.
I've tried everything I can think of to no avail. The Help did not help me.
I must be missing something, but don't know what.


 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 11:03am 01 Dec 2017
Copy link to clipboard 
Print this post

Go into project properties
In the hardware tools list select simulator (no hardware I guess is the only explanation I can come up with)

That should get you going hopefully
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 08:50pm 01 Dec 2017
Copy link to clipboard 
Print this post

Strange. When I select "Debug:Debug Main Project", I get the run/pause/step etc buttons. You can force them to appear by right clicking on a blank section of tool bar and checking them on.

(I'm using X IDE v3.61, for what that's worth.)
Visit Vegipete's *Mite Library for cool programs.
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 12:16am 02 Dec 2017
Copy link to clipboard 
Print this post

Thanks Azure & vegipete,
This morning I managed to get it into the Simulator mode by pressing Simulator. Whereas that did not work yesterday. ???
When I tried "Debug:Debug Main Project" no buttons appeared. However, I'm happy to use the keys - F7, Ctrl+F7, etc. similar to V8. I prefer keys to mouse work as I have RSI from too much computer work.
I have V 4.01.
Someone on another forum said that when you open a Project, it should open in the same state as it was in when you closed it. The attachment shows the state when I opened it this morning.
I noticed the the File>Save is grey. I had assumed that it would save automatically when I closed it. In V8, it asks if I want to save if I attempt to close without saving.
I'm finding it extremely frustrating. Normally I can latch on to new software without too much trouble. Not so with this one.
So I'm wondering whether I should un-install & then install either V 3.61 or the latest.
What you both think?
Thanks for the comments, Len

2017-12-02_101350_O_1.pdf
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 06:13pm 05 Dec 2017
Copy link to clipboard 
Print this post

You're not the first to have problems with MPLABX and alas you won't be the last. I guess I have been lucky so far. V 3.61 is what I happen to have installed on this computer and it happens to work 'fine' for what I need so I try not to muck with it. When it breaks tomorrow, I'll look at trying the latest version... ymmv.

But I use MPLAB 8.92 whenever possible instead.
Visit Vegipete's *Mite Library for cool programs.
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 10:04pm 05 Dec 2017
Copy link to clipboard 
Print this post

  larny said   Thanks Azure & vegipete,
... What you both think?


I honestly don't use MPLABX enough to give you a good recommendation. My default response would be go with the latest version if you are not locked into a particular version for a reason (known bugs that affect your environment, etc).

I am on MPLABX V4.05 and having problems with the IDE and IPE since I moved to my new PC Notebook. Issue lies with netbeans not handling screen resolution (4K). I was not having the problems I am now if I use my MacBook Pro (which has a normal res screen) with the same version.
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 04:29am 06 Dec 2017
Copy link to clipboard 
Print this post

Thanks vegipete & Azure,
I have 4.05 also. It does what I want, but I prefer 8.92 since it automatically opens all of the project files when I open the workspace file.

Whereas,with 4.05, I have to fool around each time I open the Project in order to get it back to where I want it.

Vegipete, is 3.61 the same or is it more like 8.92 in this respect?

Len
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 05:44am 06 Dec 2017
Copy link to clipboard 
Print this post

That's interesting.

I went through all the settings (I could see with the screen formatting problem I am having). Could not see anything that refers to restore previous projects/files.

When I exit and restart it opens all the projects I previously had open and all the files within those projects are opened in the edit window (with tabs) as well.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 09:32pm 06 Dec 2017
Copy link to clipboard 
Print this post

V3.61 is _nothing_ like the old MPLAB (up to v8.92.)
I expect it is indistinguishable from v4.xx except for whatever bugs are manifesting themselves.

For me, MPLABX restarts the same as when I last shut it down. I don't have to play around to get files back to how they were. Although for all I know, maybe I can't remember what I had last time so what I see is a good enough starting point.
Visit Vegipete's *Mite Library for cool programs.
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 01:10am 10 Dec 2017
Copy link to clipboard 
Print this post

I find I have to re-open the project & load the Stimulus file each time I start MPLAB X. But I can live with that.

I can now use MPLAB X (as much as I need for the current programme) but the IOC is not working as I would expect.

I'm using IOC to wake the PIC from sleep. (I'm not using an interrupt)
But it does not work properly & I don't know why.

The attachment Cases.pdf. shows the situation after it has (incorrectly) passed through sleep even though the change was processed before reaching sleep.

Note that IOCAF is still = 0x20 (it should be 0) & INTCON is still = 0x0D (it should be 0x0C).

Attachment also shows the situation after a negative edge. Again, it passed through sleep.

I don't think there is anything wrong with my programme, so I assume it is a bug in v4.05.

Any comments will be appreciated.
Len

2017-12-10_110914_Cases.pdf
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 01:50am 10 Dec 2017
Copy link to clipboard 
Print this post

I haven't played with SLEEP so I can't really help. The interrupt on change flag is usually cleared by reading the port register looking for the change. So read PORTA or PORTC just before SLEEP instead of "bcf INTCON,IOCIF"
Visit Vegipete's *Mite Library for cool programs.
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 10:46pm 10 Dec 2017
Copy link to clipboard 
Print this post

Thanks for that.
I knew that but had forgotten.
I had to use that technique in the past with other PICS.

So that solved my issue. Thanks again,
Len
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 10:56pm 10 Dec 2017
Copy link to clipboard 
Print this post

There is not enough code included to understand what you are actually doing with the associated registers. I assume it is the 16F1708 you are using as mentioned in your first post.

The problem you are describing is that it is being woken up immediately not that it is not functioning (stuck in sleep).

To test the IOC function is working or not, I would first eliminate it and do a debug session without it. If everything else is working as it should then it should be stuck in sleep, if not then something else is waking it up.

Also for IOC fuction to work Have you set the IOCAP and IOCAN registers for the pin(s) you are expecting to see the change(s) on.

 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025