EEPROM Write issue

Status
Not open for further replies.

ColinE

New Member
I have a very simple design using a 16F886 that multiplexes an LED array, having calculated a pattern that avoids current peaks.
It uses Timer0 as a timebase.

The problem is that I want to store a few settings in EEPROM and as soon as I put a 'Write' into the code it stops working, even if it's never executed.

I've used EEPROM in other projects without issue, but even looking at the assembler code I can't see what's happening.

Any suggestions as to what's happening? Please.
 
How big is the delay between writes.... 20mS is recommended....
 
Try removing the code and replacing it with a data table that will occupy a similar amount of ROM and see if it still crashes. If it does then it suggest some kind of banking error. Does oshonsoft have an equivalent to C pointers? Could a near address have been pushed into a far area?

Mike.
 
Post your code ( the one that has the issue) then we can see it it's on your machine!!
 
Thanks Mike, I think you're right.

I removed a couple of delays and ran a simulation, which looked fine. So I loaded it up on to the target and now it works.
Most likely it is an banking error in the compiler.

The code is a shambles, but works. I'll see what happens when I tidy it up, but right now it works well enough to be demonstrated.
 
OK!! Oshonsoft doesn't have any software stack's... The 16 level stack on the pic18's and 8 level on the pic16's still stands.

Just check your nested routines to see if you are having a stack overflow!!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…