Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Problem with MPLAB SIM

Status
Not open for further replies.

ljcox

Full Member level 5
Joined
Feb 1, 2006
Messages
252
Helped
25
Reputation
50
Reaction score
23
Trophy points
1,298
Location
Melbourne Australia
Activity points
3,110
I have a Desk Top computer that employs Windows 7.
I have MPLAB V8.92 and have an unusual problem with a programme I am currently writing.

Using MPLAB SIM, I cannot see any change to PORTA in the Watch Window when I attempt to simulate an output change.

Below is a sample of the code. After executing bsf rly, there is no change to PORTA.

I set TRISA to make RA4:0 outputs.

I had this problem several years ago with another programme I was attempting to stimulate, but unfortunately, I can't recall what I did to fix it.

I have explored the options in MPLAB but cannot find anything that will fix the problem.
I even used Control Panel to repair MPLAB but that didn't make any difference.

Any assistance will be appreciated.

#define chk_sw PORTA, 0 ;applies +5V to switches
#define rly PORTA, 2 ;relay
#define buzzer PORTA, 3

ORG 0x00 ; processor reset vector
call init ;Initiate parameters
bsf rly ;operate relay
 

You didn't mentioned which controller of microchip you are using.
And i think its not a MPLAB SIM problem, most of the pins of PORTA are configured as Analog to Digital Converter pins by default.
So you have to change there state to Digital Input Output pin and then only TRISA = 0x00 will work on it.
 
  • Like
Reactions: ljcox

    ljcox

    Points: 2
    Helpful Answer Positive Rating
Thanks for that suggestion, it fixed the issue.

I'm using a 16F628A. I had forgotten that it has analogue inputs as it is a long time since I last used one.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top