Society of Robots - Robot Forum

Software => Software => Topic started by: Its_Friday on February 08, 2009, 12:31:58 PM

Title: PWM axon source code
Post by: Its_Friday on February 08, 2009, 12:31:58 PM
I am trying to figure out PWM for servos but i haven't been able to find example code for the axon microcontroller. All i have found are .hex files for centering servos, and i can't read .hex xD
Title: Re: PWM axon source code
Post by: Webbot on February 08, 2009, 01:02:10 PM
http://www.societyofrobots.com/member_tutorials/node/228 (http://www.societyofrobots.com/member_tutorials/node/228)
Title: Re: PWM axon source code
Post by: Its_Friday on February 08, 2009, 01:06:41 PM
I have already read that and understand the under lying principles of PWM but i don't know how to code PWM for servos.
Title: Re: PWM axon source code
Post by: Webbot on February 08, 2009, 01:16:52 PM
This section talks specifically about servos and PWM http://www.societyofrobots.com/member_tutorials/node/231 (http://www.societyofrobots.com/member_tutorials/node/231)

It includes code for a 1MHz ATMega8

So if you are using a 16MHz Axon then follow the example as it explains what varies according to the CPU frequency.

The reference section shows tables for the ATMega8, 168, and Axon. So you can translate each of the register names from the example into the equivalent registers for the Axon.
Title: Re: PWM axon source code
Post by: Its_Friday on February 08, 2009, 01:29:05 PM
i'm interested in simple source code which uses the axon source code functions. I'm a novice at programming and am unfamiliar with registers. :-[
Title: Re: PWM axon source code
Post by: mbateman on February 08, 2009, 03:06:47 PM
Check out my PWM for Servos on the Axon...

http://www.societyofrobots.com/robotforum/index.php?topic=5590.0 (http://www.societyofrobots.com/robotforum/index.php?topic=5590.0)
Title: Re: PWM axon source code
Post by: Its_Friday on February 09, 2009, 04:07:39 PM
Check out my PWM for Servos on the Axon...

http://www.societyofrobots.com/robotforum/index.php?topic=5590.0 (http://www.societyofrobots.com/robotforum/index.php?topic=5590.0)

thank you. Worked like a charm.
Title: Re: PWM axon source code
Post by: Admin on February 09, 2009, 09:17:11 PM
If you run out of PWM ports, do this:
http://www.societyofrobots.com/axon/axon_function_list.shtml#hardware_defines