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.

PIC18LF4423 - Configuration Bits Set Appropriately?

Status
Not open for further replies.

Fred.Amoson

New Member
I'm working with a PIC18LF4423 and I am getting some really weird behavior.

I am writing all of the code in MPLAB with C18. I am programming with a PICKIT2. After I make a new build of my program I will program the PIC from MPLAB. When I do this the code starts executing about 1/2 the time. The other 1/2 of the time it does not. If I unplug the power and power it back up without programming the chip again (even if the code hasn't changed) the code _never_ runs. I always have to program before it executes. I've been finding that on the times I program it and it doesn't execute, it sometimes starts to execute the program if I start checking pin voltages.

This makes me think that maybe something is wrong with my config bits? It seems like it doesn't want to run unless it experiences some noise, but I am pretty sure the clock is set up correctly to be internal and 8 MHz.

I've attached a pic of my config bits, and the first line in my void main() is:

OSCCON = 0b01110000; //8MHz Clock

Any help would be greatly appreciated!
 

Attachments

  • ScreenShot004.jpg
    ScreenShot004.jpg
    87.1 KB · Views: 151
Have you tried changing the Build Option to Release instead of Debug and selecting the PK2 as programmer rather than debugger?

Mike.
 
Pommie - Thanks for the suggestions, I actually had my settings at that, unfortunately.

blueroom - Thanks for the suggestions, I changed, and still no luck.

Still working on it, will post when I figure it out.
 
blueroomelectronics said:
Try OSCCON = 0x72
Also it's an LF PIC, what voltage are you running it at?

Oh my gosh, I am such an idiot. I just assumed that the LF meant that it could run at a lower voltage than the normal PIC, not that it couldn't run at the typical 5V! The only other LF I used was the 16LF88, which could handle the high just as well as the 16F88, but could accept a lower voltage. I just looked through the datasheet and saw that the LF only goes from 2-3.6V. Don't I feel dumb...

Or atleast I hope that is what was causing the problem. I just tried the circuit again at 3V, and I am getting the same results. Hopefully I ruined the chips. Looking forward to getting in new ones to test!

Thanks!
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top