Maker Pro
Maker Pro

Strange pic programming problem

S

Spehro Pefhany

Since the first load commands are right at the beginning of my program
and the write subroutiene is at the end could this cause any problem
with passing the accross to the other variables. My code is about 1800
lines, and this is all I can think of, however I dont know a solution -
I'm hoping somone here might and can help me here.

Thanks

Ed

It's really unlikely that anyone is going to take the time to debug
your program (and you have not really supplied much of it), but check
that your banks are set correctly, that you disable interrupts as
recommended, and that you wait for the write to finish before
attempting to read. I've had no trouble using the EEPROM just by
following the data sheet; I can't think of anything special..

Best regards,
Spehro Pefhany
 
E

Ed

Im back again with yet another question!! :)

I am programming a 16F877A and at the moment I am trying to read and
write to the EEPROM memory. This is bascially what I have done:

At the beginning of the program I have set this:

MOVLW 0x19 ;
MOVWF EEADRV ;
MOVLW 0x19 ;
MOVWF EEDATAV ;
CALL WRITE ;

WRITE (code has been omitted to save space here)

MOVF EEADRV,W ;Data Memory Value
MOVWF EEADR ;Address to write
MOVF EEDATAV,W ;Data Memory Value
MOVWF EEDATA ;to write

So very bascially all I am trying to do is load EEADRV and EEDATAV with
0x19, then in the write subroutiene, move EEADRV to EEADR and EEDATAV to
EEDATA, however for some reason this just wont work in my program,
however if I take this same code and create a new asm file, it works
fine and I can load EEADR and EEDATA with what ever I want without a
problem.
Since the first load commands are right at the beginning of my program
and the write subroutiene is at the end could this cause any problem
with passing the accross to the other variables. My code is about 1800
lines, and this is all I can think of, however I dont know a solution -
I'm hoping somone here might and can help me here.

Thanks

Ed
 
E

Ed

Ed said:
Im back again with yet another question!! :)

I am programming a 16F877A and at the moment I am trying to read and
write to the EEPROM memory. This is bascially what I have done:

At the beginning of the program I have set this:

MOVLW 0x19 ;
MOVWF EEADRV ;
MOVLW 0x19 ;
MOVWF EEDATAV ;
CALL WRITE ;

WRITE (code has been omitted to save space here)

MOVF EEADRV,W ;Data Memory Value
MOVWF EEADR ;Address to write
MOVF EEDATAV,W ;Data Memory Value
MOVWF EEDATA ;to write

So very bascially all I am trying to do is load EEADRV and EEDATAV with
0x19, then in the write subroutiene, move EEADRV to EEADR and EEDATAV to
EEDATA, however for some reason this just wont work in my program,
however if I take this same code and create a new asm file, it works
fine and I can load EEADR and EEDATA with what ever I want without a
problem.
Since the first load commands are right at the beginning of my program
and the write subroutiene is at the end could this cause any problem
with passing the accross to the other variables. My code is about 1800
lines, and this is all I can think of, however I dont know a solution -
I'm hoping somone here might and can help me here.

Thanks

Ed
Ed wrote:


--
* Micra Sports Club *
* Don't underestimate, what you will never understand *
* http://www.micra.org.uk http://www.micrasportsclub.co.uk *>
Im back again with yet another question!! :)
I am programming a 16F877A and at the moment I am trying to read and
write to the EEPROM memory. This is bascially what I have done:

At the beginning of the program I have set this:

MOVLW 0x19 ;
MOVWF EEADRV ;
MOVLW 0x19 ;
MOVWF EEDATAV ;
CALL WRITE ;

WRITE (code has been omitted to save space here)

MOVF EEADRV,W ;Data Memory Value
MOVWF EEADR ;Address to write
MOVF EEDATAV,W ;Data Memory Value
MOVWF EEDATA ;to write

So very bascially all I am trying to do is load EEADRV and EEDATAV with
0x19, then in the write subroutiene, move EEADRV to EEADR and EEDATAV to
EEDATA, however for some reason this just wont work in my program,
however if I take this same code and create a new asm file, it works
fine and I can load EEADR and EEDATA with what ever I want without a
problem.
Since the first load commands are right at the beginning of my program
and the write subroutiene is at the end could this cause any problem
with passing the accross to the other variables. My code is about 1800
lines, and this is all I can think of, however I dont know a solution -
I'm hoping somone here might and can help me here.

Thanks

Ed

Ok I just tried moving the EE routienes to the front of my program with
no sucess - now im totally stuck :( Any suggestions welcome.

Ed
 
E

Ed

Spehro said:
It's really unlikely that anyone is going to take the time to debug
your program (and you have not really supplied much of it), but check
that your banks are set correctly, that you disable interrupts as
recommended, and that you wait for the write to finish before
attempting to read. I've had no trouble using the EEPROM just by
following the data sheet; I can't think of anything special..

Best regards,
Spehro Pefhany

I dont expect anyone to debug my work, besides I would like to try and
do it my self, but as for the data sheet that is exactly what I have done.

I just cannot work out why when I create a new asm file, copy the header
over the EE read and write routines and call for them they work, where
as in my main program they dont. Hence this question to see if there is
anything I could have missed or something. I'm new to this and have had
no other programming background except basic on a C64 when I was a kid
and HTML! I have so far got keypad scanning LCD interface etc.. and had
no problems at all until it came to this random EEPROM thing.

Thanks,

Ed
 
S

Spehro Pefhany

I dont expect anyone to debug my work, besides I would like to try and
do it my self, but as for the data sheet that is exactly what I have done.

I just cannot work out why when I create a new asm file, copy the header
over the EE read and write routines and call for them they work, where
as in my main program they dont. Hence this question to see if there is
anything I could have missed or something.

Ed, Did you double-check the three specific things I mentioned?
I'm new to this and have had
no other programming background except basic on a C64 when I was a kid
and HTML! I have so far got keypad scanning LCD interface etc.. and had
no problems at all until it came to this random EEPROM thing.

Thanks,

Ed

Best regards,
Spehro Pefhany
 
E

Ed

Spehro said:
Ed, Did you double-check the three specific things I mentioned?

I shall go throught it this evening with a fine tooth combe. I was very
tired last night, and that probably didnt help.

If I find anything further that may help somone help me or something I
shall let you know.

Thanks,

Ed
 
Top