Hello,
I use a dsPIC33EP512MC806 with VTFT v461 and MikroC dsPIC 701.
I use internal Flash to store an array of 16 byte.
All is working great, I store values in array and after a reset, read and print values on TFT.
But If I add a Timer interrupt ( Timer 2 triggers every 25ms ), calling the function Flash_Erase reset my MCU and Timer 2 interrupt no longer works.
There is nothing in the interrupt function, just a flag incremented and then resetted in the main - while(1) function.
I can't publish my code right now, i'm sorry.
Do you have any idea ?
Thank you for your help
Flash_Erase with Timer Interrupt problem
-
- Posts: 231
- Joined: 25 Mar 2014 17:11
Re: Flash_Erase with Timer Interrupt problem
Hello again.
I managed to solve my problem.
Maybe it can be usefull.
Instead of
I used
0x4A000 was empty and far from the address Flash I use and far from the memory usage of my program.
Is it possible to have an explanation from a C master/guru why it was not working without the org directive ?
It will be nice if I could understand why
Thank you
I managed to solve my problem.
Maybe it can be usefull.
Instead of
Code: Select all
void Timer6Interrupt() iv IVT_ADDR_T6INTERRUPT ics ICS_AUTO
Code: Select all
void Timer6Interrupt() org 0x4A000 iv IVT_ADDR_T6INTERRUPT ics ICS_AUTO
Is it possible to have an explanation from a C master/guru why it was not working without the org directive ?
It will be nice if I could understand why
Thank you
-
- Posts: 231
- Joined: 25 Mar 2014 17:11
Re: Flash_Erase with Timer Interrupt problem
Hello,
I made again some change in VTFT and now, calling the function Flash_Erase reset my MCU....again.
If I delete the org directive in Time6Interrupt, it works !
I don't understand why. If I can have some info from MikroE team it will be great.
I don't understand the memory alignment, maybe it is a problem of the Address I choose to write on Flash.
I choose a multiple of 0x800 ( 0x51000 )
Thank you for your time.
I made again some change in VTFT and now, calling the function Flash_Erase reset my MCU....again.
If I delete the org directive in Time6Interrupt, it works !
I don't understand why. If I can have some info from MikroE team it will be great.
I don't understand the memory alignment, maybe it is a problem of the Address I choose to write on Flash.
I choose a multiple of 0x800 ( 0x51000 )
Thank you for your time.
- danilo.milovic
- mikroElektronika team
- Posts: 501
- Joined: 05 Dec 2016 14:59
Re: Flash_Erase with Timer Interrupt problem
Hi,
can you please send whole project file in .zip archive? So I can have clear picture what is going on in your code.
Regards,
Danilo
can you please send whole project file in .zip archive? So I can have clear picture what is going on in your code.
Regards,
Danilo
Re: Flash_Erase with Timer Interrupt problem
Hi,
have anyone found a solution fo this problem. I have same problem with dsPIC33ep512MU810.
I would be grateful if you share a solution.
Thank you
have anyone found a solution fo this problem. I have same problem with dsPIC33ep512MU810.
I would be grateful if you share a solution.
Thank you