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.

Reset problem with 18f4520

Status
Not open for further replies.

jrz126

Active Member
Hi All,

We're using a custom PCB (made by the prof) for my embedded systems class. Its a pretty neat PCB, unfortunitly it requires a power cycle to reset properly. Bringing the MCLR low just causes the microcontroller to hang.

There is a 10K pullup on the line and the signal is nice and clean, so I think it might be software related. The MCLR config bit is set so that MCLR is being used. I've been looking through the datasheet and havent been able to come up with anything.

Anyone have some suggestions?

Here's the datasheet https://www.electro-tech-online.com/custompdfs/2007/02/39631B.pdf
 
If it had something like a LCD display on the board then you will have problems as they do not get reset and running the initialisation code twice causes a hang. I'm sure that a work around could be found once the cause of the hang is found.

Mike.
 
There is an LCD on the board. I dont quite understand why running the init twice would cause it to hang though. Only thing that kinda makes sense is if you are using the Busy flag in the init routine.
I'll have to try writing some code that doesnt use the LCD.
 
I found the problem...
The prof had LVP enabled and according to the datasheet, the PGM pin has to be pulled low all the time. its unused and floating on his circuit. I tested it with a pull down resistor and it worked.

I'm not sure why the LVP was used? It programs just fine without it.

Looks like I get the bonus points :) (The prof offered bonus points for whoever figured it out)
 
If it is LVP causing the problem, then I would have expected random crashes as the LVP pin floated high, not just at reset.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top