ASF ADC Getting started example does not work

Discussion around product based on ARM Cortex M3 core.

Moderators: nferre, ncollot

Bugs_Bunny
Posts: 8
Joined: Thu Sep 04, 2014 11:51 pm

ASF ADC Getting started example does not work

Thu Nov 20, 2014 6:04 pm

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?
Bugs_Bunny
Posts: 8
Joined: Thu Sep 04, 2014 11:51 pm

Re: ASF ADC Getting started example does not work

Fri Nov 21, 2014 1:11 am

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?
Bugs_Bunny
Posts: 8
Joined: Thu Sep 04, 2014 11:51 pm

Re: ASF ADC Getting started example does not work

Fri Nov 21, 2014 5:59 am

awneil wrote:That works.
What is the additional option?
Bugs_Bunny
Posts: 8
Joined: Thu Sep 04, 2014 11:51 pm

Re: ASF ADC Getting started example does not work

Fri Nov 21, 2014 3:48 pm

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?

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 4 guests