External oscillator in START not selected?

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

NOTE: I am intentionally mis-posting this!  It belongs in the AVRFREAKS forum, not in ARM, but I can't log into the avrfreaks forum.  So hopefully an admin will move it to the correct place.  Thank you...

 

I have created an Atmel START project for the XMEGA16D4.  In the Clocks page, I specified the external oscillator running at 12MHz.

(And I would post an image, except the forum software is giving me "You are not authorized to access this page." when I add the screen shot...)

 

But the generated code in osc.c reads:

	OSC.CTRL = 0 << OSC_PLLEN_bp     /* PLL Enable: disabled */
	           | 0 << OSC_XOSCEN_bp  /* External Oscillator Enable: disabled */
	           | 0 << OSC_RC32KEN_bp /* Internal 32kHz RC Oscillator Enable: disabled */
	           | 1 << OSC_RC32MEN_bp /* Internal 32MHz RC Oscillator Enable: enabled */
	           | 0 << OSC_RC2MEN_bp; /* Internal 2MHz RC Oscillator Enable: disabled */

... which, unless I'm mis-reading this, uses the internal oscillator, not the external.  But in clock_config.h, it knows that I've set the oscillator to 12MHz:

#ifndef F_CPU
#define F_CPU 12000000
#endif

Is this a known bug, or is it a cockpit error?

This topic has a solution.
Last Edited: Wed. Jun 9, 2021 - 08:59 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

(Created a new account so I could at least log in!)

 

Dear moderator: I still can't add media -- is there a known workaround to "You are not authorized to access this page" when trying to add media?  Instead, I've added the two images as attachments.

 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

rdpoor wrote:
I still can't add media ("You are not authorized to access this page.")

Don't worry; it's not you - See: https://www.avrfreaks.net/forum/media-browser-you-are-not-authorized-access-page

 

As noted in that thread, attaching & pasting images should still work ...


EDIT - your attachments, copied & pasted:

 

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Jun 9, 2021 - 06:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Copy/Paste works for me! ^C/^V

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Solved, after a fashion.  I noticed that on START's Dashboard panel, there were additional OSC settings (see attached).  Why the setting for OSC_XOSCEN_bp isn't on the clock page, I can't say.  But checking the check box to enable it on the Dashboard panel solved the issue.

Attachment(s): 

Last Edited: Wed. Jun 9, 2021 - 06:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

(and yes, ^C/^V works to paste images.  thanks for the tip!)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rdpoor wrote:
Why the setting for OSC_XOSCEN_bp isn't on the clock page, I can't say.

 

I can.  It's because OSC_XOSCEN_bp is for the OSCILLATOR, not the clock the CPU or peripherals use.

 

Therefore it is in the right place.

 

JIm

 

Please mark what you consider the solution so as to  close out the thread.

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Jim:

 

OSC_XOSCEN_bp is for the OSCILLATOR, not the clock the CPU or peripherals use.

That's solid reasoning, but -- to indulge in a bit of pedantry -- START certainly blurs your OSC/CLOCK distinction in the "EXTERNAL CRYSTAL OSCILLATOR CONFIGURATION" dialog.  There, you can enable "External crystal oscillator drive" (which neither the CPU nor any of the peripherals care about) and other attributes specific to the xtal.  I think you'd agree that enabling the xtal itself COULD be on that dialog.

 

Anyway, I've figured it out and I'll know better next time!  Thanks for your help!

Please mark what you consider the solution so as to  close out the thread.

About that.  I looked the page over multiple times for a "mark this as solution" button, but can't find it.  Is it inhibited for new users (or old users with brand new accounts)?  Equally likely: I'm just unobservant.

 

To wit:

Last Edited: Wed. Jun 9, 2021 - 08:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rdpoor wrote:

START certainly blurs your OSC/CLOCK distinction in the "EXTERNAL CRYSTAL OSCILLATOR CONFIGURATION" dialog.  There, you can enable "External crystal oscillator drive" (which neither the CPU nor any of the peripherals care about) and other attributes specific to the xtal.  I think you'd agree that enabling the xtal itself COULD be on that dialog.

 

 

No, I don't agree.  your question was about OSCILLATOR, not Clock.  Yes, teh Clocks page does allow you to select the external OSCILLATOR, but you still need to enable teh oscillator that is in teh OSCILLATORS menu system..

To each his own.  I dont use Start much, if t all.

 

I'll mark the solution for you, teh reason you do not see it is because you opened another account and used that to post your solution.

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As you are having problems accessing the fearless_fool account what I will do (as both your accounts appear to be in exactly the same place using IP lookup) is reset the password on that then send the new password by direct message to rdpoor. It's then your choice as to which account to continue with.

 

Actually I seem to remember the system has the ability to "merge accounts" but probably best if we don't attempt that as the system also has a history of crashing and losing stuff when anything "exciting" is attempted.

 

Moderator.