Page 1 of 1

ASF ADC Getting started example does not work

Posted: Thu Nov 20, 2014 6:04 pm
by Bugs_Bunny
The getting started guide is located here: http://asf.atmel.com/docs/3.20.1/sam3s/ ... start.html
1st, in the prerequisites is says System Clock Management (Sysclock) & Power Management Controller (PMC). I understand I need to enable the ADC clock somehow.

Inside Sysclock I've found:

Code: Select all

	sysclk_enable_peripheral_clock(sysc);
but could not find the list of suitable parameters - where is it?
In the PMC I have no idea what is needed to be done.

As for the ADC code itself:

Code: Select all

adc_init(ADC, sysclk_get_main_hz(), ADC_CLOCK, 8);
this line throws an error because the ADC_CLOCK macro in not defined. Where should it be defined? What values can it get?

Re: ASF ADC Getting started example does not work

Posted: Fri Nov 21, 2014 1:11 am
by Bugs_Bunny
OK, now I see all the extra code required... so the learning process here is to view the examples and use them as templates for my future REAL projects?

Re: ASF ADC Getting started example does not work

Posted: Fri Nov 21, 2014 5:59 am
by Bugs_Bunny
awneil wrote:That works.
What is the additional option?

Re: ASF ADC Getting started example does not work

Posted: Fri Nov 21, 2014 3:48 pm
by Bugs_Bunny
I think I was misunderstood... I'll try to rephrase: What I meant is that I can't spot an additional source for "complete code implementation" other than the example projects in Studio. So if this not the only way to fully understand the flow chart for setting up + using a peripheral, what are the rest?