Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 8th May 2005, 04:03 PM   #1
Default simulate inputs

how do you simulate inputs in mplab?
gastonanthony is offline  
Old 8th May 2005, 08:11 PM   #2
Default

I'm using MBLab 7.01, so that's what these instructions are targeted for.

To bring up the simulator run controls, go to Debugger menu -> Select Tool -> MBLAB SIM.

To view specific aspects of the simulated PIC, go to the View menu, and from there you can select program memory, file registers, special function registers (which is where you would get your simulated output pins), and such.

For input, go to Debugger -> Stimulus Controller -> New Scenario. Click in the first column under the Pin heading. Select which pin you desire from the dropdown menu. For the Action column, there are a few options. Set High, Set Low, Toggle, Pulse High, Pulse Low. Toggle is probably what you want, so that you can use a single Fire button ' > ' there in the first column of the stim controller box to turn a pin on and off.
__________________
There\'s no graphic in my signature.
I don\'t know your IP, and I\'m not trying
to hax0r you. You\'re welcome.
bonxer is offline  
Old 9th May 2005, 03:52 PM   #3
Default

you mean mplab version 7.00 has no way of simulating inputs?and i must download 7.01 to be able to simulate inputs? :shock:
gastonanthony is offline  
Old 9th May 2005, 04:01 PM   #4
Default

oh, ok, i got it, i've been making many codes and programming it to the pic without testing the inputs in the simulator, i have been testing it on the real hardware how do you use the scenario thing, the attach and all?
gastonanthony is offline  
Old 9th May 2005, 05:15 PM   #5
Default

Previous versions had the simulator too. It's just that I don't have the previous versions anymore, so if a menu is different, or the simulator is accessed a different way in any of the older versions, my instructions may need to be altered, which was why I mentioned my version number, just so you would be aware in case you ran into a problem and wondered why you were not seeing what I am seeing.

As for using the scenario thing... Um... reread my original post? Go into the scenario editor and assign a toggle trigger to your various pins. Want to be able to turn on Port A pin 3? Make RA3 to be a toggle, then run the simulator with that box still visible. Be sure to have the file registers and special function registers on-screen also. Start the program simulation. After the initialization, whenver you want you can click on the fire button > and you will notice that A3 is now a 1 in the special function registers window, and your program will operate accordingly. Click the fire button again, and A3 becomes 0.
__________________
There\'s no graphic in my signature.
I don\'t know your IP, and I\'m not trying
to hax0r you. You\'re welcome.
bonxer is offline  
Old 9th May 2005, 09:47 PM   #6
Default

That pretty much cover's it bonxer even for old versions.

I use version 5.62 (It's old but it is all that I need) and the procedure is virtually the same as for version 7 described by bonxer.

Select:

Project->Edit Project->Development Mode->"Choose Simulator as opposed to Editor"

You may have to rebuild the project at this point, because the mode selection clears some project files.

Then:

Debug->Simulator Stimulus->Asynchronous Stimulus and assign pin and type of action (by right clicking Stim buttons).

Or if you make a stimulus file (*.sti on version 5.XX) then at specific clock cycles the file will automatically change inputs.

That's about it.
pop is offline  
Reply

Tags
inputs, simulate

Thread Tools
Display Modes




All times are GMT. The time now is 11:52 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker