PROM Memory Issue ??

Hi All,

Working on a PIC16C54C connected to a LCD. Just a trival question to those experts out there. How come the program keeps resetting itself before it reaches the end of program? Is it due to the length of the code that used up all the memory space?

Example:

LCD displays : "Hello World" .... Blah blah ..... halfway through, it displays "Hello World" again and repeats.

End of program supposed to stop at display: "END"

I checked the memory usage in MPLAB, apparantly not all the 512 are used up.

Tks in advance ywz

Reply to
ydoubleuz
Loading thread data ...

Are you sure that its the code and not the hardware resetting?

You need to troubleshoot cause I doubt anyone is going to know the exact answer(unless there is a specific problem with those devices).

Try inserting delays between every output for a few seconds so you can approximately locate where the code that is causing the reset is at. Then check that code and see whats going on... maybe post that section of the code(if you post all if chances are no one will look at it). Need to figure out what is causing the reset and if its the software or hardware.

The program counter will roll over to 0 I believe once it reaches the end of code memory. What you can do, if you have the room is put a simple halt at the start of the program if its run more than once,

in c it might be something like

program_counter = 0; if (programm_counter != 0) { program_counter++; Halt(); }

That way it will only trigger once and it will always be in memory... so if the program counter is rolling over then you'll be able to catch it.

Jon

Reply to
Jon Slaughter

Hi,

WDT is disabled.

Regarding the halt and reset, I am not sure if it is due to hardware or software. I just single-stepped through the program with MPLAP and the reset it is exactly where the LCD displays. How do I catch the reset in assembly? any interrupts?

Reply to
ydoubleuz

Have you disabled the WDT?

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Check that your code isn't straddling a page boundary.

Reply to
a7yvm109gf5d1

This would be silly, but what do you have connected to your reset pin? It isn't tied to an LCD data line, is it? :)

Cheers, Nicholas Sherlock

Reply to
Nicholas Sherlock

Do you have a way to monitor the Program Counter? That will tell you what's going on.

At the "END" of your program, if the Program Counter is still incrementing, it will eventually rollover, and the code will appear to "restart". In reality, it never stopped. You just failed to give it anything to do (like an endless loop, sleep mode, power-down, etc..). END simply ends the compilation process. It does not magically stop the processor. It will continue to increment the program counter..., and thus, reproduce your symptoms.

I'm not familiar with this particular chip, but many processors work as described above. Look at your PRN file and see what the last instructions are doing. Good luck. -mpm

Reply to
mpm

Hi all, Pardon my answers.

"do you have connected to your reset pin?" >> PIC16C54C have reset pin??

"Check that your code isn't straddling a page boundary." >> How do I verify this? It seems to be a possible answer to what is happening.

"In reality, it never stopped. You just failed to give it anything to do " >> At end of program, it is looping infinitely.

Thanks

Reply to
ydoubleuz

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.