Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Analog write to PWM pin 9 stops waveshield working
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Analog write to PWM pin 9 stops waveshield working

by rasterblaster on Wed Sep 10, 2008 4:29 am

I have a little program running on my waveshiled, that plays sound and also needs to move two analoge panel meters.

In testing it out, it works fine if I use PWM pin 6.
When I use PWM pin 9, the waveshiled stops working.
(all I have done is changed the code to say pin 9 instead of pin 6, not even trying to do them both at once at this stage)

At first I thought perhaps waveshield uses pin 9, but all the documentation says that it does not.

I then suspected that is my arduino board, so I put in a simple hello world program that only sends a value to PWM pin 9 (or pin 6) and that works.

I then suspected that perhaps there is a short on the waveshield board? so I ran my hello world program with the waveshield plugged on. hello world works on pin 9 and 6.

The only thing I can think of is that there is something in the librarys for the waveshield that use pin 9 (even though the documentation says that nothing does)

Help!

any ideas? :?
if you like science fiction art and sci-fi sculpture, have a look at my website www.marty.com.au
rasterblaster
 
Posts: 11
Joined: Wed Jul 02, 2008 5:51 am
Location: Melbourne, Australia

by adafruit on Wed Sep 10, 2008 10:32 am

it doesnt use pin 9 directly
but it does use the interrupt that would drive pin 9 PWM engine as part of the audio decoding stuff

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

by rasterblaster on Wed Sep 10, 2008 8:33 pm

ladyada wrote:it doesnt use pin 9 directly
but it does use the interrupt that would drive pin 9 PWM engine as part of the audio decoding stuff


Hmm.. so what does that exactly mean? I can use pin 9 for "on" "off" type stuff, but not PWM.

the pin 5 and 3 that the audio shield uses that are also PWM capable, do they have to be PWM pins, can I move one of them to another pin?

Is there any other way around this?
if you like science fiction art and sci-fi sculpture, have a look at my website www.marty.com.au
rasterblaster
 
Posts: 11
Joined: Wed Jul 02, 2008 5:51 am
Location: Melbourne, Australia

by adafruit on Wed Sep 10, 2008 10:08 pm

yup. just on/off
i dont think any other timers are used, so you can use a 'software' servo or a different PWM

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

by rasterblaster on Wed Sep 10, 2008 10:34 pm

ladyada wrote:yup. just on/off
i dont think any other timers are used, so you can use a 'software' servo or a different PWM


Ok, so if I was to chage the waveshield librarys from using say pin 3 to pin 9, to free up pin three PWM, what would I have to change in the library? (as well as obviously changing the physical wire jumper from pin 3 to 9 on the waveshiled board...


and what do you mean by a "software servo"

thanks for your help so far by the way.
if you like science fiction art and sci-fi sculpture, have a look at my website www.marty.com.au
rasterblaster
 
Posts: 11
Joined: Wed Jul 02, 2008 5:51 am
Location: Melbourne, Australia

by adafruit on Thu Sep 11, 2008 12:14 am

i dont have a tutorial for what to change in the library to free up the pins

http://www.google.com/search?q=arduino+software+servo

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Please be positive and constructive with your questions and comments.