using studio 6 for a simple example

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

Hi,

I'm having trouble using Studio 6.1.244 -- I'm a newbie.

In trying to build a simple serial communications example, the make complains that "No ATMEL board defined." The board I have isn't an ATMEL board.

I have a xmega128a1 board from Futurlec. The only committed pins on it are for the JTAG, ISP and two serial ports and an led.

How do I tell the studio something to make it work? What's close? And how do I tell it?

Thanks,

madGambol

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

Are you trying to use the evil ASF?? :lol:

What language is your program in?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Go to the project menu item and select properties for your project (alt f7 might also work).
go to the device section and select the device.

Depending on what programmer and how you plan to program your board, you may have to do the same thing for the programmer.

ASF is not that evil. Once you get over the initial learning curve, has some nice feature.

I would have preferred an eclipse based project, but this one works.

Also - there are some videos on the atmel web site that might help you get started.

Best of luck - I and still rather new to micro controllers and electronics. I thought I was proficient in software (at least java), but sometimes struggle with this lowlevel stuff.

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

js wrote:
Are you trying to use the evil ASF?? :lol:

What language is your program in?

Yes -- I am trying to use ASF. C and C++.

The included serial example builds OK, but that assumes one of the existing boards, so its not useful to my fairly primitive board.

I'd like to capitalize on the available code rather than write every single line myself with the trial and error that will involve. I am under some time pressure. I would be OK with using netbeans and re-targeting the tools to the avr set, but then I'd lose the software base.

I'm looking to create a board definition that will satisfy the build system.

I had found the Alt-F7 project properties while poking around.

Under "Tool", the combo boxes show no programmer/debugger except the "Simulator". I had seen this before when I installed the WinAVR library after the studio when I did studio 4, so I guess this means I need to uninstall and re-install in the other order. I was expecting that the existing install of WinAVR would satisfy the studio 6.

This has the potential to consume a good part of my schedule.

Thanks for the help!

madGambol

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

Quote:
its not useful to my fairly primitive board.
There is provision for non Atmel boards (Dummy board??) but you will need to write the init yourself I think.

edit

#define USER_BOARD                 99  //!< User-reserved board (if any).
#define DUMMY_BOARD               100  //!< Dummy board to support board-independent applications (e.g. bootloader)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Sun. Apr 14, 2013 - 10:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the project properties has two items.

the device (where you tell it what type of chip)
the tool (where you specify the programmer that will be used)

The what you stated above (only has the simulator) indicates the avr studio did not find any programmers.

If you have a programmer (I use the JTAGICE III), programming the chip is quite easy.

I don't think you will need to un-install and reinstall. try unplugging your programmer from the usb. (of course you will need to replug it in)

If that does not work try starting the windows task manager and manually killing the avrdbg.exe, then restarting ASF 6

good luck

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

After re-reading your post, I'm not sure I fully understand the issue.

The atmel boards are only used when first creating a project. They bring in all of the definitions for the board. If you don't have an atmel xplain board, you specify a user board with the type of device you want and ASF will create a blank framework.

In the config directory, you will find a config board where you can specify all the pins/ports and other stuff.

Even if you built the initial project using the template from the xplain boards - you can modify all the #defines to make your board work.

That doesn't seem to be your issue? I'm thinking you issue is with the device programmer.

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

Quote:
I'm not sure I fully understand the issue.
I understood it as ASF complaining about not having had a board specified.
Quote:
the make complains that "No ATMEL board defined." The board I have isn't an ATMEL board.
So you other comments above should solve the problem.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Quote:

with the trial and error that will involve.

This suggests you may be approaching programming the wrong way. If you read the docs/datasheet and understand it then there should be very little "trial and error" involved. Just set the bits as advised in the data and the device should work as documented. Of course there will be bugs and you need to find/correct those but on the whole it shouldn't be endless "trial and error".

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

Hi,
Real progress: I'm debugging my simple serial example.
If you select USER_BOARD, the ASF gives you a user_board.h to edit. I put the correct values for my external crystal in there. Now I'm trying to figure out why is isn't using them.

BTW, nice signature clawson. I was wondering about volatile. I'm running into #3 now, trying to figure out what's missing in my init.

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

Real progress: characters are flowing. Now on to timers.

Thanks for the assist!

madGambol

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

Some details for my case Under Studio 6:

I believe I needed make these inputs to make this work:
1) in config_clock.h : select value for CONFIG_SYSCLK_SOURCE. For my board, it was SYSCLK_SRC_XOSC (external oscillator versus clock)

2) In project properties (Alt-F7): set XMEGA (if that's your processor type) and BOARD=USER_BOARD (if its custom and different than the standard board layouts).

3) In user_board.h: set
BOARD_XOSC_HZ to your clock speed. My case: 8000000.
BOARD_XOSC_TYPE to XOSC_TYPE_XTAL for a crystal
BOARD_XOSC_STARTUP_US to 1000; there is a check done against this value and the clock speed that you have to meet. This is a compile time check.

The best baud rate I could get to work was 9600. My PC didn't have the high speed values (115200, 57600) and 38400 didn't work.

FYI

madGambol