Xplained C3 sample ADC code

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

Hi

 

I am trying to learn the Atmel Xmega C3 384 using the Xplained board. I am however finding Atmels documentation and especially their demo-code extremely messy and over-over-over-engineered, to a level where it appears really ridiculous, if I may say so. 

I am trying to get started with it to use it in an application were I use all 16 ADC channels. Is there some "simple" sample code around somewhere that I could use to get started?

 

Then, in the first step, I plan to use the data visualizer, to present the ADC-results on a PC. I have however not found any sample code at all, and very scarce info on using the data visualiser. So, once again, some good sample code around that I could use to get started?

Thanks,

 

    Thomas

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

Nothing good to help an Atmel-newbie getting started?

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

Welcome to the Forum.

 

I've not used the Xmega C series, and I doubt my E series code, in Basic, would be of any use to you.

 

As a general rule, the best way to start with the ADC is to feed a pot into a single channel.

The pot is tied to Vcc and Ground, the wiper goes to the ADC input.

Put a 0.1 uF cap from the wiper to Ground to help filter out some noise.

 

If your project has an LCD your all set, just display the raw ADC readings on the LCD while your vary the pot.

Put a DMM on the pot's wiper to read what the actual input voltage is.

 

In this way you can measure the ADC channel's DC offset, and check out any gain settings, as well as validate your code for reading the ADC input.

If you don't have an LCD on the PCB, then upload the data to a PC Terminal program.

 

I've not used the Data Visualizer, as the two above techniques have served me well.

 

I presume some of your above comments refer to ASF.

I don't use C, (or, therefore, ASF), but when I've looked at a demo program or two I tend to find them rather difficult to follow.

I generally just set up the Registers manually, stuffing them with the appropriate setup values.

This is much cleaner and easier in my mind.

 

Finally, I suspect the ADC on the "C" series is very similar to the ADC on the "A" series, and if you use Google to search you will find some Xmega A series sample code on the Forum.

The E series doesn't use the pipelined structure, and is a bit different.

You can try using the Forum's Search, but I think Google will actually work better.

 

Once one channel works, the rest should fall into place.

 

JC