Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
MadRaven
PostPosted: Sep 21, 2011 - 06:32 PM
Newbie


Joined: Nov 13, 2004
Posts: 3


Hello,

does anybody have experience with the brandnew XMEGA-A3BU Xplained Evaluation kit?

I received that kit during an Atmel Hands-on Training tour in Germany. One day after that training I tried to restore the original demo software with AVR Studio 5. All looked fine except the NTC-temperature reading. After entering the NTC-menue the software hangs in a while loop waiting for conversion completion. The NTC-conversion seems similar to the light-sensor-conversion. I suppose that the at fabrication integrated demo was not derived from the demo project included in the Studio 5.

Has anybody found the same problem and solved it?

I am familiar with the atMega-family but not yet with the xMegas.

I hope for help.
 
 View user's profile Send private message  
Reply with quote Back to top
Simon Loell
PostPosted: Sep 22, 2011 - 07:47 AM
Hangaround


Joined: Jan 26, 2004
Posts: 119
Location: Hjallerup, Denmark

I too was at the Atmel seminar, but in Denmark.
We found some bugs in the example code, which was related to the ADC. I can't remember the details, but it was something with the cannel selection and ADCA or ADCB.

You might want to have a look in the solution source code, which you propably received during the hands-on.

If you haven't found the solution by tonight please post your main file, which initialises the ADCs.
I can see in my source code if there are any differences.

BR.
Simon Loell
www.nerdclub.dk
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
MadRaven
PostPosted: Sep 22, 2011 - 11:44 PM
Newbie


Joined: Nov 13, 2004
Posts: 3


Many thanks for your posting.

I found a solution and the demo program runs fine, but I suppose that I did only find a workaround and not encounter the problem.
What have I done?
I only modified the 'typedef struct ADC_CH_struct' in header file 'iox256a3bu.h' by adding one line:

/* ADC Channel */
typedef struct ADC_CH_struct
{
register8_t CTRL; /* Control Register */
register8_t MUXCTRL; /* MUX Control */
register8_t INTCTRL; /* Channel Interrupt Control Register */
register8_t INTFLAGS; /* Interrupt Flags */
_WORDREGISTER(RES); /* Channel Result */
register8_t SCAN; /* Input Channel Scan */
register8_t reserved; /* --> this line was added by me */
} ADC_CH_t;

...and now the demo shows the temperature.

But I also would be glad for another cool and more 'professional' result.
My solution seems to be too simple. Certainly there still exists another covered trap Wink in the software.

Please tell me your ideas.

many greetings,
MadRaven
 
 View user's profile Send private message  
Reply with quote Back to top
MadRaven
PostPosted: Sep 25, 2011 - 06:51 PM
Newbie


Joined: Nov 13, 2004
Posts: 3


Hello again,

no doubt, the ADC_CH_struct needs to have 8 Bytes.
Other xMega-Header files show the following:

/* ADC Channel */
typedef struct ADC_CH_struct
{
register8_t CTRL; /* Control Register */
register8_t MUXCTRL; /* MUX Control */
register8_t INTCTRL; /* Channel Interrupt Control */
register8_t INTFLAGS; /* Interrupt Flags */
_WORDREGISTER(RES); /* Channel Result */
register8_t reserved_0x6;
register8_t reserved_0x7;
} ADC_CH_t;

And therefore the posted solution is verified.
Change your 'iox256a3bu.h' plus 'iox256a3u.h' (plus all other iox..u.h files) and all runs fine Smile

So long,
MadRaven
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits