Go Down

Topic: Trying to crack the ASF nut... could use some help. (Read 1 time) previous topic - next topic

SwarfEye

So, I'm wanting to get a bunch of PWMs going on my Due and also sync my ADC with the PWM so that I can get samples at the same point in the PWM waveform every cycle.

This is something that I can totally do on the AVRs, but I've run up against the capabilities of the AVR and so I am trying to step up to ARM with the Due.  I understand from the SAM datasheet that it ought to be very possible to do with the SAM as well... so I'm digging into ASF to get this done.

I found this page which apparently references 2 examples of using PWM on Due, one of which is a SYNCed version!!!  Eureka!  This must be my solution!
http://asf.atmel.com/docs/latest/sam3x/html/group__auto__sam__drivers__pwm__group__related__projects.html

... But when I dig around for the source code that goes with these examples, I just can't find any!?

I have dug through the links on this page recursively (manually : ) looking for the source code.  Under the "files" heading I came across a link named "pwn_sync_example.c"...
http://asf.atmel.com/docs/latest/sam.drivers.pwm.pwm_sync_example.arduino_due_x/html/pwm__sync__example_8c.html
...and I thought that I had found my source code... but no?  It is just a webpage that lists all of the macros and functions that the example uses, but does not show me how to use said macros and functions?

I figure I must be missing something obvious here?  Does anyone know how I can find the source code for this supposedly published example?

Thanks,

Bill

Jack Christensen

Sounds like the same situation I ran into the other day, although I was looking at AVR examples. Thanks for confirming it wasn't just me :D

Do you have Atmel Studio installed? Try to find the example there, that may have the source code. Why it wouldn't be online as well is beyond me.

SwarfEye

Right on.  Thanks for confirming that I'm not crazy.  Seems so straight forward and obvious to post the source code?  I was sure that I must be missing something obvious, but maybe not.

I do have AVR Studio 6.2 installed.  I have successfully programmed the Due via bossac using some ASF code that I got out of a Quick Start Guide using AVR Studio.  The Quick Start Guides are cool, but I'm not able to figure out how things are really working from them... and sometimes they don't work "out of the box" it seems.

Anyway, I have searched my computer file system and I have not been able to turn up any of the example files that I have been looking for.  They are referred to online, so the must be someplace... right?

B

Jack Christensen


Anyway, I have searched my computer file system and I have not been able to turn up any of the example files that I have been looking for.  They are referred to online, so the must be someplace... right?


Hmmm, yes I see what you mean. What are we missing here? Seems like it should be straightforward.

SwarfEye

Alright!

I've found it!

The whole system seems like it is setup in the most obscure confusing manner possible.  I really don't know why they don't just post the source code online with a link?  It seems so straight forward and sensible?

Anyway, the answer is that you've got to go into AVR Studio and "File->New->Example Project" will popup an example project wizard which if you search for "sych" will turn up the example project.  When you select that example project the project files are automatically generated from some other file and will appear on your file system.  Searching your file system for the file does not work until AVR Studio has generated the file.  So bizarre!  So obscure!

I have to thank Awniel over at the AVR Freaks board for tipping me off to this wrinkle.  Thanks so much.

Bill

Jack Christensen

Bill, good work! I'll try it. They must have had too much time on their hands the day they built that!

jc

Go Up