Changing Audio out pins

656 views
Skip to first unread message

Scott Althoff

unread,
Jun 21, 2013, 8:01:53 PM6/21/13
to mozzi...@googlegroups.com
If I change the TIMER1_A_PIN in known_16bit_timers.h will this allow me to change the pin that audio is output on?  Is there anything else I need to do?

Scott

Tim Barrass

unread,
Jun 22, 2013, 12:59:35 AM6/22/13
to mozzi...@googlegroups.com
Hi Scott,

if you're using Mozzi's STANDARD audio mode where the output is on pin 9 or whatever it is for various processors (see Mozzi docs http://sensorium.github.io/Mozzi/doc/html/group__core.html#ga0b8ca8ad62b88c01b639bad62eafcbf1), the only option you could use other than TIMER1_A_PIN is TIMER1_B_PIN as defined for your processor in known_16bit_timers.h, which would be pin 10 on an Arduino Uno, Nano, or other atmega328 based boards (check the file for others). 

Then the quickest thing to do would be to edit AudioConfigStandard9bitPwm.h and change

#define AUDIO_CHANNEL_1_OUTPUT_REGISTER OCR1A
to
#define AUDIO_CHANNEL_1_OUTPUT_REGISTER OCR1B

and
#define AUDIO_CHANNEL_1_PIN TIMER1_A_PIN
to
#define AUDIO_CHANNEL_1_PIN TIMER1_B_PIN

In HIFI mode, both pins are used so there's no alternative.

Tim


On 22 June 2013 10:01, Scott Althoff <scott....@gmail.com> wrote:
If I change the TIMER1_A_PIN in known_16bit_timers.h will this allow me to change the pin that audio is output on?  Is there anything else I need to do?

Scott

--
You received this message because you are subscribed to the Google Groups "Mozzi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozzi-users...@googlegroups.com.
To post to this group, send an email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/f7d64062-bd0c-40e2-a365-5d1718e4962e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages