View previous topic :: View next topic |
Author |
Message |
KokkeKat
Joined: 08 May 2011 Posts: 59 Location: Stockholm
|
Posted: Wed Jul 18, 2012 9:17 pm Post subject: Questions about going over to XMega |
|
|
Hi,
I am considering going from "5V Mega with FT232 USB" to XMega128A1U and wonder if somebody could help me with some general advice. Is it a big thing to reuse/convert general BASCOM code from Mega in an XMega design?
Any particular pitfalls that I should avoid?
Is it possible to use the definition file for 128A1 and do the USB stuff yourself directly on the registers?
Do I get this right? To use full-speed USB, you must set the internal 32MHz clock to 48MHz using the factory calibration data plus do custom calibration using for example an external 32.768kHz RTC clock. At 48MHz, the actual system clock must be divided by 4 to 12MHz?
I am very grateful for your input. Thanks in advance.
Kind regards
Niclas |
|
Back to top |
|
|
JC
Joined: 15 Dec 2007 Posts: 585 Location: Cleveland, OH
|
Posted: Thu Jul 19, 2012 6:56 am Post subject: |
|
|
The Xmegas have many great new features, and it takes a long time to learn them.
The initial learning includes learning the new syntax for setting up I/O pins for input and output, and readng and writing to them.
Also, as the Xmegas all boot up at 2 MHz, one generally sets the clock to the desired source and speed as part of their chip initializations. The Xmegas have many clock sources available.
Note that you will need a PDI programmer. The STk500 and some of the other ISP programmers available won't work with an Xmega. There are many Threads on AVR Freaks about whether or not the Atmel Dragon can successfully program Xmegas or not. The Atmel AVR ISP mkII, at about $34 USD, is relatively inexpensive and works well for programming just about all of the AVR chips, including the Xmegas.
Note also that the Xmegas do not come in plastic dip packages. If you are use to bread boarding your designs then you need to learn a new approach. One can use an Xmega breakout board plugged into a bread board, or use an Xmega development board, (or make your own). This Thread, at AVR Freaks, has links to many Xmega development boards:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=119495&highlight=development
I can't comment on using the new USB module within the Xmega. I'm hoping that Bascom will provide a CDC (serial port), and HID USB set of instructions and an example soon!
JC |
|
Back to top |
|
|
KokkeKat
Joined: 08 May 2011 Posts: 59 Location: Stockholm
|
Posted: Thu Jul 19, 2012 10:44 am Post subject: |
|
|
Thanks JC!
Kind regards
Niclas |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Jul 19, 2012 12:24 pm Post subject: |
|
|
the setting up of ports is exact the same : config pin/port = input/output
you only have additional options with config xpin.
in the help you can read about the xmega.
i can recommend avrisp MKII too. _________________ Mark |
|
Back to top |
|
|
Kimmeridgien
Joined: 22 Feb 2007 Posts: 89 Location: Stockholm
|
Posted: Thu Jul 19, 2012 4:25 pm Post subject: |
|
|
Thanks Mark,
Just a quick question: The JTAGICE3 should also work with XMega? (I also have an AVRISP MkII, so no problem there.)
Kind regards
Niclas |
|
Back to top |
|
|
MAK3
Joined: 24 Sep 2010 Posts: 449 Location: Germany
|
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Fri Jul 20, 2012 4:32 am Post subject: |
|
|
Niclas,
your question about programming Xmega with JTAGICE3 - should work - because it includes PDI programming capability.
From Atmel
Quote: | JTAGICE3 Key Features
•Supports JTAG, aWire, SPI and PDI interfaces
•3 hardware program breakpoints and 1 maskable data breakpoint (depending on the OCD module on the AV
•Symbolic debug of complex data types including scope information
•Up to 128 software breakpoints
•1.8V to 5.5V target operation
•Uploads 256KB code in ~14 seconds (XMEGA using JTAG interface)
•USB powered |
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Jul 20, 2012 9:29 am Post subject: |
|
|
the new jtagice is not supported by bascom. i do not have one to test to see what the problem is about. but it is of course supported by studio. _________________ Mark |
|
Back to top |
|
|
Kimmeridgien
Joined: 22 Feb 2007 Posts: 89 Location: Stockholm
|
Posted: Fri Jul 20, 2012 11:08 am Post subject: |
|
|
Thanks! |
|
Back to top |
|
|
mlcarter
Joined: 12 May 2009 Posts: 11
|
Posted: Sun Aug 26, 2012 10:37 pm Post subject: dumby question |
|
|
I'm just looking at using an ATxmega for the faster 12 bit A-Ds. I see it has to be programmed using the PDI interface
The question I have Re programming with an AVRISP MKII.
Is this achieved by hooking it onto the PDI pins somehow.?
Is it then possible to set fuses etc from Bascom? |
|
Back to top |
|
|
JC
Joined: 15 Dec 2007 Posts: 585 Location: Cleveland, OH
|
Posted: Wed Aug 29, 2012 1:14 am Post subject: |
|
|
The "Standard" PDI Headr Pinout is shown in the Atmel Application Note AVR042: AVR Hardware Design Considerations .
Section 4.3 shows a top down view of the 6-Pin Header routinely used for the PDI interface.
I use the AVR ISPmkII through AVR Studio V4 or V6.
Perhaps others can comment on using it from within Bascom.
JC |
|
Back to top |
|
|
MAK3
Joined: 24 Sep 2010 Posts: 449 Location: Germany
|
Posted: Wed Aug 29, 2012 9:18 am Post subject: |
|
|
Hello,
Quote: | I'm just looking at using an ATxmega for the faster 12 bit A-Ds. |
This is not that complicated. See CONFIG ADCx
Quote: | Is this achieved by hooking it onto the PDI pins somehow.? |
Yes and JC posted the pin-out.
Quote: | Is it then possible to set fuses etc from Bascom? |
No. You can not set the fuses from Bascom but with an AVR ISP MKII or (similar device) over AVR Studio 4.
Usually you do not set fuse bits very often so I set it with AVR Studio and then I use the MCS-Bootloader to update the ATXMEGA Flash in a convenient way over USB.
With ATTINY and ATMEGA you need to set the clock fuse bits in order to work with your frequency of choice.
With an ATXMEGA you do not need to set the fuse bits for clock settings. You program the clock frequency you want to have.
For example using the internal 32MHz clock:
Code: | Config Osc = Disabled , 32mhzosc = Enabled , 32khzosc = Enabled '32MHz and 32KHz enabled
Config Sysclock = 32mhz |
MAK3 |
|
Back to top |
|
|
mlcarter
Joined: 12 May 2009 Posts: 11
|
Posted: Sun Sep 02, 2012 9:24 pm Post subject: |
|
|
Thanks very much Your help. I'll have a go.
Just didn't seem right to program a single input/output data line with an SPI programmer with separate input and output! |
|
Back to top |
|
|
|