problem with FLASH_WriteDoubleWord

General discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
jalal_am
Posts: 57
Joined: 07 Jul 2012 16:17

problem with FLASH_WriteDoubleWord

#1 Post by jalal_am » 12 Jul 2017 00:56

Hi all,
I am using FLASH_WriteDoubleWord in my program, but I cannot get it working. I read the help file, but unfortunately still in trouble. I would be grateful if somebody provides me with a simple example.

thank you for your help.

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: problem with FLASH_WriteDoubleWord

#2 Post by lana.arsic » 12 Jul 2017 17:48

Hi,

Can you tell me which MCU are you using,
which address have you tried to use in FLASH_WriteDoubleWord?

Kind regards,
Lana

jalal_am
Posts: 57
Joined: 07 Jul 2012 16:17

Re: problem with FLASH_WriteDoubleWord

#3 Post by jalal_am » 12 Jul 2017 19:38

Thank you for your response.
I am using dsPIC33EP512MU810. I manage to use FLASH_Wrire, FLASH_Read, etc. but unfortunately I could not utilize FLASH_WriteDoubleWord and FLASH_ReadDoubleWord. I would be grateful if you send a simple example or give me a brief explanation.

Code: Select all

  FLASH_WriteDoubleword(0x055400, BUFF1A);

Thank you
Last edited by jalal_am on 12 Jul 2017 20:07, edited 1 time in total.

jalal_am
Posts: 57
Joined: 07 Jul 2012 16:17

Re: problem with FLASH_WriteDoubleWord

#4 Post by jalal_am » 12 Jul 2017 20:07

I also have a problem with Flash_Erase

Code: Select all

main{
....
   
       FLASH_Read(0x055400, ReadWordArr, 64);
      for (LOP=0; LOP<4; LOP++){
       LATD=ReadWordArr[LOP];
       delay_ms(10000);
    }

while (1){
.....
for (LOP=0; LOP<4; LOP++){
    // LATD=BUFF1A[LOP];
    WriteWordArr[LOP]= BUFF1A[LOP];
    // delay_ms(5000);
    }
 for (LOP=4; LOP<64; LOP++){
    WriteWordArr[LOP]= 0;
    }
    FLASH_Erase(0x055400);   
    FLASH_Write(0x055400, WriteWordArr);
    FLASH_Read(0x055400, ReadWordArr, 64);
    for (LOP=0; LOP<4; LOP++){
    LATD=ReadWordArr[LOP];
    delay_ms(5000);
    }
....}}
    
as you see the FLASH_Erase in an infinite while loop. a funny thing happens, and it is that the FLASH_Erase reset the MCU second time it is executed, and never again happens! I mean that First I see all output erased ( output before while loop); then I see the correct values on output ( it means that erase, write and read are executed perfectly). but on next recursion, MCU reset and I see cleared output (0xFFFF). after that never this error occurs and every thing is fine. could you please share your comment on this issue, also?

Thank you for your help

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: problem with FLASH_WriteDoubleWord

#5 Post by lana.arsic » 14 Jul 2017 17:48

Hi,

I have sent you response to your e-mail,
I suggest to continue our correspondence there.

Kind regards,
Lana

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 General”