UC3C AST - Deepsleep works while debugging but not if the debugger is disconnected!?

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi there.

 

I'm setting up a wake up timer using the AST driver and the SLEEPMGR service. 
Following my setup (more or less copy paste from the SLEEPMGR_EXAMPLE1):

	enum sleepmgr_mode      current_sleep_mode = SLEEPMGR_STOP;
	uint32_t                ast_counter = 0;

	ast_init_counter(&AVR32_AST, AST_OSC_RC, AST_PSEL_RC_1_76HZ, ast_counter);
	AVR32_AST.WER.alarm0 = 1;
	ast_enable(&AVR32_AST);

	sleepmgr_init();
	sleepmgr_lock_mode(current_sleep_mode);

	while (1)
	{
		ast_counter = ast_get_counter_value(&AVR32_AST);
		ast_disable_alarm0(&AVR32_AST);
		ast_counter += 10;
		ast_set_alarm0_value(&AVR32_AST, ast_counter);
		ast_enable_alarm0(&AVR32_AST);

		// ... do something before sleep

		sleepmgr_enter_sleep();

		AVR32_AST.SCR.alarm0 = 1;
		sleepmgr_unlock_mode(current_sleep_mode);

		// ... do something after sleep

		cpu_delay_ms(3000, FCPU_HZ);

		sleepmgr_lock_mode(current_sleep_mode);
	}

 

While using the RC as the clock source and according to the "Sleep Modes" described in its data sheet in table 7-2, page 54 I assume that this application should run in all available sleep modes but the last one ("static").
Now, what I experiencing is, that
  1. (while having the debugger connected) it generally works, and it works even in the sleep mode "static" which it shouldn't.

  2. when removing the debugger it only works in the sleep modes "Idle", "Frozen" and "Standby". But still it should work in "Stop" and "DeepStop" as well which it doesn't.

...??!??!!
Any idea what I am dealing with?
Thanks for any input.
 

Cheers

 

Last Edited: Wed. Jun 24, 2020 - 10:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please use your other thread https://www.avrfreaks.net/forum/...

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Topic locked