Use of Analog to Digital with AT91SAM7S

Discussion about SAM7 Series and ARM7TDMI based products.

Moderator: nferre

User avatar
Location: Atmel Corp.
Posts: 163
Joined: Thu Feb 12, 2004 7:48 pm

Use of Analog to Digital with AT91SAM7S

Fri Oct 22, 2004 2:42 pm

Hi everybody,

It is the first Software Package Application for the AT91SAM7S Series on AT91 Forum.
This software project is broken into four parts and contains four sub-projects with only one variant: SRAM Debug. The four steps are increasing in complexity:
Setting and start the Analog to Digital Converter for only one conversion by using software triggering,
Setting and start Analog to Digital Converter, Timer/Counter to achieve a multiple-shot conversion with an accurate sampling period,
Setting and start Analog to Digital Converter, Timer/Counter to achieve a multiple-shot conversion from four enabled channels with an accurate sampling period,
Setting and starting Analog to Digital Converter, Peripheral Data Controller, Timer/Counter peripherals to achieve a multiple-shot conversion and automatic ADC value storage.

I called this zip file with "light" adjectival in the name because there is no html any documentation in order to have the smaller file size.
Last edited by stephan_cadene on Thu Mar 02, 2006 12:54 pm, edited 2 times in total.
Location: San Diego, California
Posts: 305
Joined: Wed Jan 05, 2005 11:38 pm

attached file

Thu Jun 23, 2005 2:44 am

Should there be an attached file? I am working on some AD stuff and would like to view the code!


Last edited by henkvisser on Mon Jun 27, 2005 8:26 pm, edited 1 time in total.
User avatar
Location: Atmel Corp.
Posts: 163
Joined: Thu Feb 12, 2004 7:48 pm

Fri Jun 24, 2005 10:33 am

Hi Henkvisser,

You're right, here are two files now: the software package and a ppt presentaion from our last training to help you.

Have a nice day
Location: Traverse City, Michigan USA
Posts: 11
Joined: Wed Mar 01, 2006 5:56 pm

Wed Mar 01, 2006 6:44 pm

[I tried to email this directly, but it bounced as 'mailbox unavailable.']

I’m both a new user of the AT91SAM7 processor, and a new member of the AT91 Forum.

I’m starting work with the ADCs, and would really like to see this sample code. I guess there should be an attachment to the post, but I can’t see any way to download it. I see nothing on the page indicating attachments.

Perhaps it’s just because I’m not familiar with the look and feel of the forum site, but if someone could point me in the right direction, it would be greatly appreciated! 8)

Thanks for your time.
<>< Bruce
User avatar
Location: Atmel Corp.
Posts: 163
Joined: Thu Feb 12, 2004 7:48 pm

Thu Mar 02, 2006 12:55 pm

Hi BruceWehr,

Here is now.
I have just posted the lost attachment :D

Have a nice day
Location: Raleigh, NC
Posts: 119
Joined: Mon Nov 08, 2004 4:39 pm

ADC Interrupt Based

Sun Mar 26, 2006 12:47 am

I am just adding a bit of code to the mix. I created a project to play with ADC functionality. This project implements software triggered ADCs OR TimerCounter triggered ADCs. Control is by #define TIMER in main.c.

Debug commands through Debug UART @ 115200 N81.

Note that you can crash it by continuously sending 'q', but this is left in more as a warning for using AT91F_ADC_GetLastConvertedData.

Interrupts are utilized in both situations above, which were not previously included in the projects from France.

Good luck, and remember to post updates - especially when you find mistakes. One other thing, do not be scared by the directory names. I reuse simple "vanilla" projects over and over.
Posts: 17
Joined: Thu Apr 27, 2006 5:48 pm

Fri Aug 04, 2006 6:07 pm

Hi guys!

I've been trying to incorporate parts of this code into a project of mine, but it doesn't really work out.

I have a interrupt from a normal timer, which is also the sampling frequency, do i need to modify that to accomodate interrupt sampling?

What happends is that if i use the "pull status bit" from the example it never clears and i hang in the interrupt, and without it i dont seem to get any sampled values.

I've been looking at the 1st example and the multi-channel one, which seems to use interrupt based sampling, but cant really figure it out.

Any ideas or suggestions?

Posts: 17
Joined: Thu Apr 27, 2006 5:48 pm

Tue Sep 12, 2006 3:52 pm

I've now used the PDC version which fits my project alot better, and as i understand it, it's pin 17 on the evaluation board that's AD0, right?

I've got a signal generated that i connect to the board (where should i connect the zero of the signal, gnd pin or ad1 (18)) and it's also connected to a Labview adc-box.

When i connect the signal to only the Labview box it looks fine, but if i connect it to the ev-board also, it gets noisy, but that's just the smaller problem. The big problem is that if i co connect the ev-board the signal is lost! It seems to ground the signal! Measuring pin 17 -> gnd there's approx 2,3V and no current. It measures something, since connectint pin 17 to gnd or Xvcc fills the buffer with 0 and 765 resp. What's wrong, what have i missed?

Posts: 17
Joined: Thu Apr 27, 2006 5:48 pm


Sat Sep 16, 2006 9:28 pm

Thanks to tomcroban for helping me. I found the solution earlier in the day, but hearing it from him also made all come together.

What happened is that the ADC uses some of the signals power to get a sample, and as my sensor had a rather high output resistance (30kOhm) it basically killed the signal.

Adding a 1:1 amplifier to the signal it got enough power to be sampled and the previous problems disappeared.

TIP: ADC uses power, see to that you have enough power on signal to be sampled.

Posts: 1
Joined: Mon Jun 11, 2007 4:19 am

Mon Jun 11, 2007 4:43 am

hello ppl, i am new here and want to join this usergroup but am unable to....can anyone help me pls.... :)
Location: CHN
Posts: 18
Joined: Mon Jul 02, 2007 8:23 am

Re: Use of Analog to Digital with AT91SAM7S

Mon Jul 02, 2007 8:30 am

yossef cohen
Posts: 2
Joined: Mon Jul 16, 2007 10:57 am


Wed Jan 30, 2008 3:30 pm

I don't see any button or something else to download.
Also, one project with ADC demo in this site is pwd protected. why? what is the pwd?

Posts: 1
Joined: Fri Feb 15, 2008 12:14 am

Fri Feb 15, 2008 8:45 am

I agree with "yossef"...

Why is the ZIP archive password protected ? If nobody knows the password, please delete the file from the board.
Location: Hamburg
Posts: 14
Joined: Tue Dec 18, 2007 2:57 pm

Fri Feb 15, 2008 10:40 am

where can I find the files? Do not see any link...
Posts: 2
Joined: Sun Feb 17, 2008 7:22 am

ADC Example Password

Mon Feb 18, 2008 10:23 pm

Does anyone know why the ADC example at Project/Controleurs/cVisualisation.php? ... sation=315 is password protected, or what the password is? It seems like a lot of people have this question, so it would be very helpful if someone could provide and answer in the forum so that everyone can read it.


Return to “SAM7 ARM7TDMI MCU”

Who is online

Users browsing this forum: No registered users and 2 guests