Split from: Atmel Studio 7.0.1645

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

Mark A Carter

 

New avrfreaks user.

 

I have two Newbie questions, please.

 

I am using the lasted Ateml Studio 7.0.1645.

 

How do you specify the Atmega328P CPU device in Atmel Studio ASSEMBLER new project code section?

 

How do you specify the Atmega328P CPU  clock speed at 16MHz in Atmel Studio ASSEMBLER new project code section?

 

Thank you, Best regards, Mark A Carter.

 

My Emails are home is .... and my work email is ... * Mark, your emails have been removed for your own protection. Moderator. *

 

Avionics Technician at Honeywell.

 

MARK A CARTER

Last Edited: Tue. Nov 21, 2017 - 10:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Split from the Studio release thread. Please rename the thread title to something more descriptive.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

This is a fully public forum.  Probably a bad idea to advertise your email addresses here.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Re specifying device: Start creating a new project. In the first step you give the name of the project and its location in the file system. Click OK and the next step will be a dialogue where you select the device.

 

Re clock speed: Clock speed is not set in the firmware. Clock selection is governed by "fuse settings", a small separate memory read upon startup/reset to initialize things like the clokc system.

 

If your question is about the clock selection fuses:Go to the Tools menu, Device Programming item. In the dialogue that follows you specify the programming tool you use and the device model you are about to program. Then select the page for Fuses, select the fuse values you wish to set and Write them.

 

WARNING: Selecting fuse values might render your AVR in-programmable. E.g. selecting "External crystal" as clock source while you have no crystal properly attached will require more or less advanced measures, possibly including additional hardware, to revive the AVR. If you are the least bit insecure re the consequences of selecting bad fuse values I strongly advice you do not change them. Do you really need to run your AVR at 16 MHz when starting out?

 

Your question re selecting 16 MHz for an ATmega328 reveals a possible ignorance re these matters: Please understand that the ATmega328 has ni internal clock source capable of running the AVR at 16 MHz. The internal clock source is an RC oscillator that can run the AVR at 8 MHz maximum. To obtain 16 MHz an external clock source (a crystal (with load capacitors) or a square clock signal) is required.

 

By default the ATmega328 comes from factory with clock selection fuses set to use the internal 8 MHz RC oscillator, and with a clock divider /8 applied to it, so that the effective CPU clock frequency is 1 MHz. You can obtain 8 MHz clock frequency by un-programming the /8 clock divider. Again, if you slip or chose bad fuse values you might render your AVR quite stale.

 

If your ATmega328P sits on a board from a 3rd party manufacturer (e.g. an Arduino board) it is possible that the clock fuses are no longer the factory defaults. You can read the fuse values without any danger, using the same dialogue as mentioned above.

 

Repeat: If you are not sure about what you're doing, please refrain from meddling with the fuses. We have questions here ever so often from people who have meddled with the fuses on a whim, and come here to ask why they cant program the AVR anymore and what to do about it.

 

Your first stop is to read up in the data sheet on these matters. Chapter 9 System Clock and Clock Options and chapter 28 Memory programming (especially 28.2 Fuse Bits) is mandatory reading.

 

You have been warned. Please don't join the my-AVR-is-dead gang.

 

Let's finish off in a positive way: Welcome to AVRfreaks! (-:

Happy 75th anniversary to one of the best movies ever made! Rick Blane [Bogart]: "Of all the gin joints, in all the towns, in all the world, she walks into mine."

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

joeymorin wrote:
This is a fully public forum.  Probably a bad idea to advertise your email addresses here.

 

+1

 

Also understand that questions are answered openly and publicly here in the forums. We do not offer private 1-to-1 help in emails, so disclosing your email is pointless. (You will make the collectors of email addresses for spamming purposes happy though...)

 

For the occasions where you want to correspond privately there is a PM (Private Message) function available. But please do not use PMs for asking questions - the only thing you will obtain is bad karma. ;-)

 

 

Happy 75th anniversary to one of the best movies ever made! Rick Blane [Bogart]: "Of all the gin joints, in all the towns, in all the world, she walks into mine."

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Tue. Nov 21, 2017 - 10:45 PM