Pages: [1]   Go Down
Author Topic: Help tweaking PCM audio example  (Read 211 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Soulsby Synthesizers is synthesizer manufacturing company run entirely by its founder Paul Soulsby. The company was setup in January 2013 and the first year has been spent developing the Atmegatron.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have successfully got the PCM audio example working:
http://playground.arduino.cc/Code/PCMAudio

However I want to use the SPI library to control a MCP23S17 (16bit I/O expander). 
http://arduino.cc/en/Reference/SPI

The SPI library has to use pins 10,11,12 & 13 to connect to the MCP23S17.  However, the PCM audio example also outputs on pin 11.  Does anyone have a link to a reference table for all the constants used in the PCM example to setup the registers (e.g. COM2A1, COM2A0 etc).

Am I correct in thinking that if I change these constants, I should be able to use one of the PCM pins lower down the board (pin 3,5 or 6) instead of 11?

thanks
Paul
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you configure it correctly you should be able to user Timer 2 "B" output (pin D3).

Some stuff about timers:

http://www.gammon.com.au/forum/?id=11504


Or you could use the USART in SPI mode to get the SPI going (if you don't mind not using the Serial output).

http://www.gammon.com.au/forum/?id=10892&reply=3#reply3

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
Soulsby Synthesizers is synthesizer manufacturing company run entirely by its founder Paul Soulsby. The company was setup in January 2013 and the first year has been spent developing the Atmegatron.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, your page on interrupts is amazing!  I can't use the serial, but I can use pin D3, so guess the quick fix is to swap the COM2As for COM2Bs and vice versa in the Timer 2 setup.  I'll try and use your helper library soon though.  Will make the whole thing a lot easier! smiley
Logged

Pages: [1]   Go Up
Jump to: