This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I am trying to run the RTC Calendar(Link) in MSP430FR2433 MCU. I was wondering if I can declare assembly language variable as persistent so that the variable from RTC_Calendar.asm/.h can stay all the time in memory even after reset with last known state.
Variable I am trying to make persistent are:
;Variables
.def TI_day
.def TI_FebDays
.def TI_hour
.def TI_dayOfWeek
.def TI_PM
.def TI_second
.def TI_year
.def TI_minute
.def TI_month
.def TI_dayLightZone
.def TI_dayLightSavings
Thanks
Jeevant Sah
Hi Jeevant,
In the example you are referencing similar variables are already declared persistent in main.c. If you think you need to declare a variable persistent from a .asm file, you can look at ctpl_low_level.asm in the same project for reference (look for the .usect ".TI.persistent" directive). However, I would avoid writing assembly if you can help it. Declaring variables persistent from C is much easier.
Regards,
Evan
Hi Evan,
Thanks for the solution, I would like to ask one more things If I declare a variable persistent in assembly and use it in C using extern variable, will I be able to use that extern variable as a normal persistent variable in C and change its value using C?
**Attention** This is a public forum