|
|
View previous topic :: View next topic |
Author |
Message |
nszmnsky Guest
|
16F628 hangs on consecutive write_eeprom |
Posted: Tue Aug 05, 2003 8:09 pm |
|
|
Using CCS write_eeprom, consecutive writes
write_eeprom(2,T2cal); //write upper byte
write_eeprom(3,T2cal); //then lower
apparently cause PIC to hang.
LST seems to make sense
.................... write_eeprom(2,T2cal); //write upper byte
0A37: MOVLW 02
0A38: BSF 03.5
0A39: MOVWF 1B
0A3A: BCF 03.5
0A3B: MOVF 3C,W
0A3C: BSF 03.5
0A3D: MOVWF 1A
0A3E: BSF 1C.2
0A3F: BCF 03.5
0A40: MOVF 0B,W
0A41: MOVWF 20
0A42: BCF 0B.7
0A43: BSF 03.5
0A44: MOVLW 55
0A45: MOVWF 1D
0A46: MOVLW AA
0A47: MOVWF 1D
0A48: BSF 1C.1
0A49: BTFSC 1C.1
0A4A: GOTO 249
0A4B: BCF 1C.2
0A4C: BCF 03.5
0A4D: MOVF 20,W
0A4E: IORWF 0B,F
but honestly haven't invested much time on review.
Should I abandon CCS func and roll my own?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516697 |
|
|
R.J.Hamlett Guest
|
Re: 16F628 hangs on consecutive write_eeprom |
Posted: Wed Aug 06, 2003 1:57 am |
|
|
:=Using CCS write_eeprom, consecutive writes
:= write_eeprom(2,T2cal); //write upper byte
:= write_eeprom(3,T2cal); //then lower
:=apparently cause PIC to hang.
:=
:=LST seems to make sense
:=.................... write_eeprom(2,T2cal); //write upper byte
:=0A37: MOVLW 02
:=0A38: BSF 03.5
:=0A39: MOVWF 1B
:=0A3A: BCF 03.5
:=0A3B: MOVF 3C,W
:=0A3C: BSF 03.5
:=0A3D: MOVWF 1A
:=0A3E: BSF 1C.2
:=0A3F: BCF 03.5
:=0A40: MOVF 0B,W
:=0A41: MOVWF 20
:=0A42: BCF 0B.7
:=0A43: BSF 03.5
:=0A44: MOVLW 55
:=0A45: MOVWF 1D
:=0A46: MOVLW AA
:=0A47: MOVWF 1D
:=0A48: BSF 1C.1
:=0A49: BTFSC 1C.1
:=0A4A: GOTO 249
:=0A4B: BCF 1C.2
:=0A4C: BCF 03.5
:=0A4D: MOVF 20,W
:=0A4E: IORWF 0B,F
:=but honestly haven't invested much time on review.
:=
:=Should I abandon CCS func and roll my own?
I use multiple writes, with no problems. One obvious 'thought', what else is you chip doing?. What are you doing about the watchdog?. For instance, if you have serial interrupts, and the interrupts are disabled during the write, then you may get a situation that an overflow has taken place on the UART, and if your code does not handle this/have recovery for this, the effect could be to create an apparent 'hang'.
Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516701 |
|
|
nszmnsky Guest
|
MY MISTAKE! Re: 16F628 hangs on consecutive write_eeprom |
Posted: Wed Aug 06, 2003 8:46 pm |
|
|
Inadavertantly left include as '648.h while "debuggin" out of rom msg. Funny how things don't work if not set up right!
:=Using CCS write_eeprom, consecutive writes
:= write_eeprom(2,T2cal); //write upper byte
:= write_eeprom(3,T2cal); //then lower
:=apparently cause PIC to hang.
:=
:=LST seems to make sense
:=.................... write_eeprom(2,T2cal); //write upper byte
:=0A37: MOVLW 02
:=0A38: BSF 03.5
:=0A39: MOVWF 1B
:=0A3A: BCF 03.5
:=0A3B: MOVF 3C,W
:=0A3C: BSF 03.5
:=0A3D: MOVWF 1A
:=0A3E: BSF 1C.2
:=0A3F: BCF 03.5
:=0A40: MOVF 0B,W
:=0A41: MOVWF 20
:=0A42: BCF 0B.7
:=0A43: BSF 03.5
:=0A44: MOVLW 55
:=0A45: MOVWF 1D
:=0A46: MOVLW AA
:=0A47: MOVWF 1D
:=0A48: BSF 1C.1
:=0A49: BTFSC 1C.1
:=0A4A: GOTO 249
:=0A4B: BCF 1C.2
:=0A4C: BCF 03.5
:=0A4D: MOVF 20,W
:=0A4E: IORWF 0B,F
:=but honestly haven't invested much time on review.
:=
:=Should I abandon CCS func and roll my own?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516744 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|