2003-11-17 11:18 PM
2003-11-17 07:07 PM
Hello ST7 users.
I am sure someone will be able to help me. Last time Katrin was very helpful. I have debugged an ST7LITE1 with INdart emulator and I have successfuly written some data into x flash memory to be stored. I have programmed an mcu to make it run alone in my target borad and (surprise) it doesn't write the flash anymore. I have checked many things (option bytes, clock, ecc.) everything seems ok. Anyone ?2003-11-17 07:45 PM
Please check if the clock source selected in the option bytes is same as in the target board?
2003-11-17 11:18 PM
Hi Jatin, thanks for you interest.
The inDART uses a clock on PB4. When the application runs alone, I have set the RC OSCILLATOR I copy here the part of the program which writes the flash. Greetings from Italy. XF_PROG MACRO ADDR,DATA LOCAL Copy_01 LOCAL Copy_ex sim clr X Copy_01: ld A,(X_code,X) ld (XProg,X),A cp X,#$10 jreq Copy_ex inc X jp Copy_01 Copy_ex: ; ld A,#ADDR.h ld CURRENTH,A ld A,#ADDR.l ld CURRENTL,A ld A,DATA ld XDATA,A call XProg rim MEND ;******************************************************************************* ; Program entry ;******************************************************************************* WORDS segment 'X_rom' ; I valori sono inizializzati a #$ff ; Tempi di attesa .X_WAITVEL1 DC.B $ff .X_WAITVEL2 DC.B $ff .X_WAITVEL3 DC.B $ff ; Periodo odometro .X_VELTH3H DC.B $ff .X_VELTH3L DC.B $ff .X_VELTH2H DC.B $ff .X_VELTH2L DC.B $ff .X_VELTH1H DC.B $ff .X_VELTH1L DC.B $ff ; Soglie abilitate disabilitate .X_ENABLETH DC.B $ff ;$00 ; Flag velocita' .X_SFVEL DC.B $ff WORDS segment 'rom' X_code: bset FCSR,#1 ld A,XDATA ld [CURRENTH.w],A bset FCSR,#0 xLoop: btjt FCSR,#0,xLoop ret