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.

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.
 
Have you simulated that part to see where the PC actually goes to?
 
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.
 
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.
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top