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.

Problem with running PIC16F87x: PORTx is not in bank0 ?

Status
Not open for further replies.

Slayerza

Full Member level 5
Joined
Oct 22, 2005
Messages
295
Helped
27
Reputation
54
Reaction score
5
Trophy points
1,298
Location
South Africa
Activity points
3,462
help with PIC16F87x

Hi
I have a problem running a PIC16F87x. The code i wrote in MPLAB issues a warning that PORTx is not in bank0. although I use the banksel command.

I have a power-reset circuit and also connected the crystal and two caps to ground.Propper power is also being supplied. I can confirm that the device is programmed correctly, with two different programmers and software applications.

The problem however is that no matter what I try the PIC does not seem to be running?
If any one can help it would be greatly appreciated.

Thanks,
Slayer
 

help with PIC16F87x

power supply capacitors close to the chip?

Start with simple checks. Measure the voltage at the chip power supply pins. Measure the voltage between the reset pin and ground. Look at the oscillator out pin wiht an oscilloscope and see if the crystal is oscillating.
 

    Slayerza

    Points: 2
    Helpful Answer Positive Rating
Re: help with PIC16F87x

Hi,
1. Check generator, what is the value of the capacitors, and how you configurating the oscilator, in many case like your, the problem is wrong oscilator configuration or/and wrong value of the quartz capacitor.
2. Your reset must be in High level, if you use internal reset circuit, pull up reset pin with 2k2 rezistor
3. This message, that POR... not in Bank 0 is only warning, if you forgot this, and not switch the bank, you must make when write the port configuration byte in TRIS register.

If all above is correct, try with a simple program, flashing led or translating state from pin to pin :

btfsc 0x06,0
bcf 0x06,1
bsf 0x06,1
goto $-3

you have a button in port B.0 and led in port B.1, when change the state of the button LED must be change him state too.
 

Re: help with PIC16F87x

You get that warning all the time, even if you use the banksel. I think there is a way to turn it off, though. I just choose to ignore it.

Check the voltage, the level on the /MCLR pin, the oscillator. Did you program the oscillator for HS operation?

Also, make sure you do not select Low Voltage Programming. If you do, then RB3 becomes an input-only pin and if it's left open it can make your processor stop.

Write a short test program, that just turns on/ off some IO lines, maybe once a second. That way you can check if the PIC is not running or if it's your code, just by testing those lines.
 

Re: help with PIC16F87x

start by loading somebodys blink-a-led hex
does it work? are all the supply pins connected?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top