Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help please with MPLAB X

Status
Not open for further replies.

ljcox

Well-Known Member
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 relevant to answer my question.

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.

Any assistance will be appreciated.
Len
 
MPLABX is slightly different... Everything is contained within the project..

Right click the project name in the projects window... Then select properties... It should open on the correct window.

Conf: (default)... In the hardware window, swap to simulator.. From there its the same..
 
Thanks Ian,
I did as you said, but I still can't simulate. I've tried everything I can think of to no avail. I must be missing something.
A copy of the window is attached.

When I click on the Debugger console button, the window is blank.
 

Attachments

  • Edit window.jpg
    Edit window.jpg
    239.8 KB · Views: 290
You need to press the debug button - the one with the green triangle. Your program will then be running, press the pause button to halt it and use F7 to single step. Or put a breakpoint on the first line.

Mike.
 
Simulation will only be available once you build the project successfully! I notice the "Run" button is greyed out!
BUT!! I cant see the build tool on the ribbon.... Is the assembler present on the machine?

EDIT!! Whoops I'm blind.... Click the hammer tool to build..
 
Thanks Ian & Mike,
I took your advice & I'm was able to simulate.
I had all of the buttons at the top of the Edit window.
But when I closed the software & later re-opened it, all I have is the .asm and I can't see the Watch & Pins buttons.
I have fooled around trying to find them without success.
Please advise.
 
When you open MPLAB X it should be in the same state as when you closed it. I.E. with the same projects and files open. Except, it adds a start screen which you just close.

Mike.
 
Ian,
I opened the project
Mike,
When I open it, it is essentially blank. See the attachment. I had to fool around to go back (approximately) to where I was yesterday. But I could not get back to exactly where I was.
I have V 4.01, what version do you both have? I noticed that there is a later version (V 4.01 was the latest when I downloaded) so I'm wondering if V 4.01 has some faults.
I find it extremely frustrating. So I'm considering going to the later or to the previous version.
Thanks for your help.
 

Attachments

  • O_1.jpg
    O_1.jpg
    140.4 KB · Views: 248
I'm using version 4.00 and have just closed and opened it and here is a screen shot.
screen.png

Note the open projects on the left and the open files at the top.

Mike.
 
Mike He got the same thing he had open LOL it's like you said when you reopen it's the same as you left it LOL
I do that all the time close it and not shut off the sim it comes back up just as it was

Normal window
Screenshot from 2017-12-01 22-39-52.png


When I close it after closing project
Screenshot from 2017-12-01 22-44-36.png


You get it where you left it. If I had sim it would of looked like his post
I like to never figured how to get a window back but now it's not bad I kind of like hiding them so I have a bigger editor
 
Last edited:
Just downloaded the latest version (4.05) and the actions are the same.

As a test I did the following,
Closed all projects
Selected menu file/new project
selected standalone project
selected PIC16F1708
Debug header: none
Selected simulator
Selected MPASM (5.76)
Entered filename test
Click finish

Then, in the projects pane, I right click the source file tab and select new>pic_8b_general.asm and enter test as filename.

Once this is done I use the config generator menu window>Pic Memory Views>Configuration bits to generate the beginning of the file.

Let me know if this works for you.

Mike.
 
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
 

Attachments

  • Cases.pdf
    442.9 KB · Views: 205
I notice you have
upload_2017-12-10_2-43-58.png


That flag bit is read only:
upload_2017-12-10_2-44-58.png

And you have to clear it in the appropriate register for which you set the IOC, e.g, IOCxF (probably Bank 7):

upload_2017-12-10_2-50-18.png


That probably explains why IOCAF remains set.

John
 
I disagree, at least with those chips. One must clear IOCxF. Reading the port is not necessary.

upload_2017-12-10_6-39-13.png


Using MCP logic, that makes sense. For example, If IOC is set only to a rising edge, it will not cause an event on the falling edge. Thus, there may be no detectable change in the port pin with a fast pulse. The flag, however, is a long-duration indicator of that change.
 
Thanks for the responses.
I have been using "Close Project" each time when closing.
So, inspired by one of the posts above, I tried going straight to exit.
When I re-opened MPLAB X, the window was identical to the one I had closed.
Thanks again,
Len
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top