Author Topic: RTC  (Read 8523 times)

0 Members and 1 Guest are viewing this topic.

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
RTC
« on: June 28, 2016, 06:20:16 pm »
Hello, I would implement the RTC modules within a program would you code examples that do not use ASF ?
« Last Edit: July 01, 2016, 06:43:47 am by CLARAAA »
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #1 on: June 28, 2016, 06:26:26 pm »
RTC, I have a function of initialization  I would like code samples where the RTC module is used.
« Last Edit: July 01, 2016, 06:44:38 am by CLARAAA »
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #2 on: June 28, 2016, 06:38:57 pm »
Examples of programming without using ASF me would be helpful
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #3 on: June 28, 2016, 11:52:19 pm »
To watch dog , I have no idea how I can implement in my program
I know I have to initialize it , then when there is a beugue I reset the RTC and System . But after how it was that an error occurred ? Maybe to a function that calculates the number of seconds elapsed from the last ADC conversion and if the elapsed time exceeds a cetain limit, we realized both reset
  You may want to rephrase this. I don't understand what you want.

You are showing us good pieces of code. Presumably if you wrote them, then you would know how to do the rest. If you did not write them, then where they are from?

You may also want to separate tasks and solve them one by one. And WDT would be the last thing to implement.
Alex
 

Online Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1672
  • Country: us
Re: RTC and WATCHDOG SAM
« Reply #4 on: June 29, 2016, 12:37:04 am »
Complexity is the number-one enemy of high-quality code.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2549
  • Country: us
Re: RTC and WATCHDOG SAM
« Reply #5 on: June 29, 2016, 01:02:31 am »
To implement a Watch Dog timer, I can think of two possibilities:

  1) Setup an interrupt (via an interrupt) with an integer variable that counts down to zero.  When the variable reaches zero, reset the processor.  Your main routine will need to periodically reset the variable to a value representing the Watch Dog delay before reset.  The interrupt could also do your Real Time Clock.

  2) Setup up a timer to generate the delay before reset.  When the timer rolls over, reset the processor.  Again, your main routine would periodically reset the timer prevent the reset.

I leave the details of implementing either option to you.   :)
« Last Edit: June 29, 2016, 01:04:30 am by MarkF »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #6 on: June 29, 2016, 01:04:15 am »
There is a dedicated WD timer in Atmel SAM MCUs.

OP needs to be clear what is needed exactly, I'm pretty sure there is no need for WDT, especially considering how basic other questions are.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #7 on: June 29, 2016, 06:42:05 am »
But for this, I have to properly configure the RTC
Why? There is a dedicated watchdog timer that has nothing to do with RTC.

You did not specify your device, but assuming you are using SAM D21, then WDT operation is described in chapter "17. WDT - Watchdog Timer"

Its configuration is extremely simple, so it hard to screw up. Once you configure the timer, you just need to periodically write a proper value into CLEAR register, so WDT does not reset your MCU.

EDIT: Actually your code with Config_WDT() and others already shows how to use WDT.
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
RTC
« Reply #8 on: June 29, 2016, 06:44:57 am »
Did I think to something like this that my main :
Code: [Select]

Init_WDT ();
( Config_WDT period= 1000 );
uint32_t tp = time_RTC ;
if ( tp > periode)
{
reset_WDT ();

RESET_SYSTEM ( ) ;
}
// Disable WDT
WDT- > CTRL.reg = 0;
// Wait synchronization

But for my limited time I have to run my module RTC
« Last Edit: July 01, 2016, 06:46:50 am by CLARAAA »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #9 on: June 29, 2016, 06:51:14 am »
Did I think to something like this that my main :
This code makes no sense and won't even compile.

You need to call Config_WDT(1024) in the beginning of the program. This will configure WDT to reset the micro in 1024 ms (~1 second).

Then you need to call Reset_WDT() at least once a second. Not calling this function will indicate that there is a bug and WDT will reset the micro.

But for my limited time I have to run my module RTC
I don't understand what you mean here.

Here is a simple example of using RTC:
Code: [Select]
//-----------------------------------------------------------------------------
void rtc_init(void)
{
  GCLK->GENDIV.reg = GCLK_GENDIV_ID(2) | GCLK_GENDIV_DIV(8);

  GCLK->GENCTRL.reg = GCLK_GENCTRL_ID(2) | GCLK_GENCTRL_SRC(GCLK_SOURCE_OSC8M) |
      GCLK_GENCTRL_IDC | GCLK_GENCTRL_RUNSTDBY | GCLK_GENCTRL_GENEN;
  while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY);

  // Configure RTC
  GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID(RTC_GCLK_ID) |
    GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN(0/*2*/);

  RTC->MODE1.CTRL.reg = RTC_MODE1_CTRL_MODE_COUNT16;
  while (RTC->MODE1.STATUS.bit.SYNCBUSY);

  // Prescaler needs to be enabled separately from the mode for some reason
  RTC->MODE1.CTRL.reg |= RTC_MODE1_CTRL_PRESCALER_DIV8;
  while (RTC->MODE1.STATUS.bit.SYNCBUSY);

  RTC->MODE1.PER.reg = 999;
  while (RTC->MODE1.STATUS.bit.SYNCBUSY);

  RTC->MODE1.READREQ.reg |= RTC_READREQ_RCONT | RTC_READREQ_ADDR(0x10);

  RTC->MODE1.INTENSET.reg = RTC_MODE1_INTENSET_OVF;

  RTC->MODE1.CTRL.bit.ENABLE = 1;
  while (RTC->MODE1.STATUS.bit.SYNCBUSY);

  NVIC_EnableIRQ(RTC_IRQn);
}

//-----------------------------------------------------------------------------
void irq_handler_rtc(void)
{
  HAL_GPIO_LED_toggle();
  time_ms += 1000;
  RTC->MODE1.INTFLAG.bit.OVF = 1;
}
You will need to rename irq_handler_rtc() to whatever it is called in your startup file.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #10 on: June 29, 2016, 06:52:16 am »
But my problem is how to place it correctly in the main?
How does your main() looks right now?
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #11 on: June 29, 2016, 07:01:23 am »

If I call my Conf_WDT () function early in the program with my period the watchdog is not supposed compared to the period fixed and realize the reset_WDT and reset_System? Maybe I Have to call these focntions in Config_WDT ()?
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #12 on: June 29, 2016, 07:03:57 am »
Code: [Select]
       Config_WDT(2048); // initialize and activate WDT with maximum period

uint32_t tps_since_act_WDT;


if(tps_since_act_WDT <= 2048)
{

Reset_WDT();
                Reset_System();
}

WDT->CTRL.reg = 0; // disable watchdog
while (WDT->STATUS.bit.SYNCBUSY); //WAIT SYNCHRONIZATION


Here is my code in case of crash, but the problem is how to test it? This requires that I simulate a beugue
« Last Edit: June 29, 2016, 07:06:29 am by CLARAAA »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #13 on: June 29, 2016, 07:08:35 am »
You don't need to call Reset_System(). This is just a convenience function in case you actually want to force MCU reset.

WDT will reset MCU itself if you don't call Reset_WDT() often enough. That's how WDT works.
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #14 on: June 29, 2016, 07:12:33 am »
So, I have to do a loop that calls the reset_WDT in main?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #15 on: June 29, 2016, 07:14:19 am »
Presumably you already have some sort of a loop, otherwise what is your program doing? Just add Reset_WDT() there.
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #16 on: June 29, 2016, 07:17:13 am »
So, I just call my function in my hand while the Init_WDT and Config_WDT but outside this while loop
Code: [Select]
void main(void)
{
Init_WDT();
Config_WDT(4096); // initialize and activate WDT with maximum period
while()
{
//dans la boucle while du main
Reset_WDT(); //Reset WDT
WDT->CTRL.reg = 0; // disable watchdog
while (WDT->STATUS.bit.SYNCBUSY); //WAIT SYNCHRONIZATION

//Following programme

}
}


« Last Edit: June 29, 2016, 07:19:45 am by CLARAAA »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #17 on: June 29, 2016, 07:21:07 am »
So, I just call my function in my hand while the Init_WDT and Config_WDT but outside this while loop
You really need to put more effort into English.

But if I understand correctly, then yes Config_WDT() must be called once outside of that loop. And Init_WDT() is already called by the Config_WDT().

I don't get it, why do you bother with WDT. Is your main application logic already debugged and working?
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #18 on: June 29, 2016, 07:53:29 am »
Code: [Select]
void main(void)
{
Init_WDT();
Config_WDT(4096); // initialize and activate WDT with maximum period
while()
{
//dans la boucle while du main
Reset_WDT(); //Reset WDT
WDT->CTRL.reg = 0; // disable watchdog
while (WDT->STATUS.bit.SYNCBUSY); //WAIT SYNCHRONIZATION

//Following programme

}
}

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #19 on: June 29, 2016, 07:58:44 am »
Why do you disable WDT?

Also, this program will not compile. Please check that your code at least compiles before posting.

And also, waiting on synchronization can take a long time if your clock source for the WDT peripheral is low (it is typical to run WDT from internal 32 kHz oscillator). I would not call Reset_WDT() on every iteration, it can significantly slow down your system.


Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #20 on: June 29, 2016, 08:09:28 am »
For setting up the RTC module such a way that every second a conversion on the ADC is done, I must Init_RTC () out of hand, but then how can I make him understand that ADC should take action every second
« Last Edit: June 29, 2016, 08:11:36 am by CLARAAA »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #21 on: June 29, 2016, 08:11:57 am »
I'm sorry, I can't teach you how to do basic embedded development.

I've already posted RTC example that will call periodic interrupt. It is actually set up to fire every second, just as you need. So start your ADC measurement in that interrupt handler.

But you may want to start with simpler programs - blink an LED, read the button, etc.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #22 on: June 29, 2016, 06:18:28 pm »
I don't understand why you reset RTC every single iteration of the cycle. How do you expect any of this to work?

Typically you set up  all the registers in the beginning and then look at flags in the loop.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #23 on: June 29, 2016, 06:30:58 pm »
You are clearly not understanding what I'm saying.

On each iteration of the while (1) loop you call Config_RTC(), which completely resets the state of the timer and then in the next statement you check if flag is set. It will never be set, since you just reset the peripheral.

This is very basic programming, it does not even have anything to do with particular MCU type.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #24 on: June 29, 2016, 06:43:00 pm »
I'm not going to proof-read your code.
Code: [Select]
RTC->MODE0.READREQ.reg |= RTC_READREQ_RCONT;    //Read continuously
RTC_READREQ_ADDR(0x10);
Here you need to replace first ';' with '|'. Not that this matters here. And I'm pretty sure compiler will issus a warning here. READ ALL COMPILER WARNINGS, especially when you don't know what you are doing.

Why are you reading RTC->MODE0.INTENSET.reg and comparing it to 1? This register will reflect your settings. You need to analyze INTFLAG register and check for actual flags.

Also, why do you set direction 10 times in a row?
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #25 on: June 29, 2016, 06:53:36 pm »
My COMPILER WARNINGS are only no previous prototype for my two functions
I modified by
Code: [Select]
 
 if(RTC->MODE0.INTFLAG.reg==0)

But I don't understand :
Quote
Also, why do you set direction 10 times in a row?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #26 on: June 29, 2016, 06:57:23 pm »
My COMPILER WARNINGS are only no previous prototype for my two functions
It should complain about statement with no effect on this line "RTC_READREQ_ADDR(0x10);". If it does not, then go into compiler setting and enable all the warnings you can.

I modified by
Ok, so why are you checking for 0?

But I don't understand :

What is this for?
Code: [Select]
   for(int i=0; i<10;i++)
PORT->Group[0].DIRSET.reg = PORT_PA09;
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #27 on: June 29, 2016, 07:08:07 pm »
The loop was kind of delay but I can take it off and put it this way
« Last Edit: July 01, 2016, 06:50:29 am by CLARAAA »
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #28 on: June 29, 2016, 07:10:26 pm »
But the major problem is in the COnfig_RTC () function when I would do:

Code: [Select]

RTC->MODE0.READREQ.reg |= RTC_READREQ_RCONT|    //Read continuously
  RTC_READREQ_ADDR(0x10);
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #29 on: June 29, 2016, 08:34:13 pm »
But the major problem is in the COnfig_RTC () function when I would do:
What's the problem?

Have you looked at my MCU starter projects - https://github.com/ataradov/mcu-starter-projects/tree/master/samd21 ? There is a working timer implementation. It is nt based on RTC, but I don't see why it would matter in this case.
Alex
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2549
  • Country: us
Re: RTC and WATCHDOG SAM
« Reply #30 on: June 29, 2016, 10:57:48 pm »
I can't figure out what the program suppose to do.
Maybe, the OP can describe what he's trying to do and the requirements for the program.  (With OUT talking about WDT and RTC).  A general description would really help.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #31 on: June 29, 2016, 11:00:03 pm »
He wants to read ADC sample every second based on a timer. At the moment he tries to make timer work. The next stage will be ADC.
Alex
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2549
  • Country: us
Re: RTC and WATCHDOG SAM
« Reply #32 on: June 29, 2016, 11:24:37 pm »
So, all he needs to do is setup a loop in the main routine where he reads the ADC and then has a 1 sec delay at the end. 

If he really needs it to sample at exactly 1Hz, then he could setup a 1Hz timer interrupt that would sample the ADC and set a flag for an infinite loop in the main function where he can check the flag and do whatever processing needs done.  He could read the ADC in the main function instead of the interrupt time in order to get into and out of the interrupt as fast as possible.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #33 on: June 29, 2016, 11:26:23 pm »
I agree, but it is hard when you have no [embedded] programming experience. And that's exactly what is going on in this thread.
Alex
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2549
  • Country: us
Re: RTC and WATCHDOG SAM
« Reply #34 on: June 29, 2016, 11:29:05 pm »
Okay.  Plus the language barrier.  I have 35+ years of professional software development experience so this all seems trivial to me.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #35 on: June 30, 2016, 05:42:10 am »
You still have not fixed RTC_READREQ_ADDR(0x10); thing. I'm not going to help you if you are not going to listen.

I gave you a working code, use it.

Also, start giving more information. If you say "stuck", tell us exactly where it is stuck.
« Last Edit: June 30, 2016, 05:45:25 am by ataradov »
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #36 on: June 30, 2016, 05:47:05 am »
I don't understand because in the datasheet :ADDR is read-only constant of 0x10
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #37 on: June 30, 2016, 05:51:36 am »
In your link it is a function with TC , not a module RTC
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #38 on: June 30, 2016, 05:52:04 am »
So what? Your C is wrong.

You have two statements:
Code: [Select]
RTC->MODE0.READREQ.reg |= RTC_READREQ_RCONT;    //Read continuously
and
Code: [Select]
  RTC_READREQ_ADDR(0x10);

The first one is fine, the second one has no effect and compiler should complain about it. If it does not, you need to enable warnings. At this point compiler is smarter than you, so you should listen to it and fix any warnings it gives.

It is a valid point that this field is constant fore this specific peripheral, on other peripherals it is not constant. So author of the original code (which you copy-pasted with errors) had intention to indicate that this filed is set to 0x10. This is done for code readability and maintainability.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #39 on: June 30, 2016, 05:55:49 am »
In your link it is a function with TC , not a module RTC
I gave you code for RTC as well in this thread.

Why do you need RTC? Is there a real reason for this?
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #40 on: June 30, 2016, 06:00:29 am »
RTC->MODE0.READREQ.reg |= RTC_READREQ_RCONT;            //Read continuously

I tried to compile by removing this line of code, when I removed it remains blocked in the following line of code allows activate the RTC and if I let it rest stop on this line

Code: [Select]
RTC->MODE0.READREQ.reg |= RTC_READREQ_RCONT;    //Read continuously

Even when I delete the statement with ADDR. I find it very strange
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #41 on: June 30, 2016, 06:04:27 am »
I tried to compile by removing this line of code, when I removed it remains blocked in the following line of code allows activate the RTC and if I let it rest stop on this line
Again, you are not making any sense.

This entire read request thing is completely inconsequential to anything here. It is just a nice optimization.

Even when I delete the statement with ADDR. I find it very strange
The line with ADDR did absolutely nothing. Removing or adding it would not change anything.
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #42 on: June 30, 2016, 06:35:51 am »
so I do not see why it remains locked in this function
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #43 on: June 30, 2016, 06:37:28 am »
so I do not see why it remains locked in this function
Too bad you would not tell us where it is locked exactly.

And since you won't reply why you need RTC and regular timer will not work, I'll let you deal with this on your own.
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #44 on: June 30, 2016, 06:57:26 am »
it is locked exactly here:
Code: [Select]
RTC->MODE0.READREQ.reg |= RTC_READREQ_RCONT;    //Read continuously
I would like to use the RTC module to use another mode of this module. But first, I'd like to use the RTC in mode 0 .
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #45 on: June 30, 2016, 07:00:52 am »
There is nothing to lock in this instruction. Furthermore, you can completely remove it with no harm to actual operation of the module.

How do you check that it is locked?
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #46 on: June 30, 2016, 07:33:28 am »
At the launch of the step mode remains locked in this statement and if I delete it blocks the next line concerning the activation of the module RTC
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #47 on: June 30, 2016, 07:37:59 am »
Switch to disassembly view and step through individual instructions to find out what is happening exactly.
Alex
 

Offline CLARAAATopic starter

  • Contributor
  • Posts: 20
  • Country: dz
Re: RTC and WATCHDOG SAM
« Reply #48 on: June 30, 2016, 07:41:57 am »
Activation of the RTC module does not happen, but no indication is given me suddenly I do not know what to do
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #49 on: June 30, 2016, 07:48:18 am »
I told you exactly what to do - "Switch to disassembly view and step through individual instructions to find out what is happening exactly."

This is very basic stuff. If you can't get it to work, then start with known working projects and modify them. There are a lot of thins than can go wrong, and step by step modifications will make it much easier to debug.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: RTC and WATCHDOG SAM
« Reply #50 on: June 30, 2016, 03:40:29 pm »
No, I still can not solve the problem , I do not understand what's happening.
That's because you are not doing what I tell you to do. The only way for you to achieve anything is stat with guaranteed working project and modify it bit by bit, checking that it still works.

You are jumping right into an unfamiliar MCU and unfamiliar peripheral from scratch. Something, I personally won't do myself.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf