Pages: [1]   Go Down
Author Topic: Virtual Wire and PWM  (Read 1844 times)
0 Members and 1 Guest are viewing this topic.
Sweden, Malmö
Offline Offline
Full Member
***
Karma: 2
Posts: 200
Rooky
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am running the Diecimila board with both TX and RX connected to it, all communication works fine both ways.
But when i try to run a PWM signal with the command analogWrite on pin 9 something in the virtualwire code is preventing me.
I have managed to find that when i un-comment vw_setup(2000) PWM signal works just fine.
Anybody had this issue or knows of a solution?

Default IO pins appointed for the Virtual Wire are 12, 11 and 10 so pin 9 should not be effected ?

« Last Edit: October 14, 2010, 09:35:12 am by HULK » Logged

Sweden, Malmö
Offline Offline
Full Member
***
Karma: 2
Posts: 200
Rooky
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After some searching outside the forum i found that some PWM pins need the TIMER1 function to run. And according to my understanding pin 9 and 10 are the ones on Arduino that are using the TIMER1, is that correct?


« Last Edit: October 15, 2010, 06:05:47 am by HULK » Logged

Sweden, Malmö
Offline Offline
Full Member
***
Karma: 2
Posts: 200
Rooky
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It seems as the virtual wire library in some way changes the TIMER1 settings and basically the PWM signal for pin 9 and 10 is effected. But i have not tested to change pins yet as my application is build in and i need to do some work to reach the pins. So if anyone can confirm my thought it would be great.
My only hope is that other PWM pins will not be effected.

Logged

Sweden, Malmö
Offline Offline
Full Member
***
Karma: 2
Posts: 200
Rooky
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, after testing my self i can now confirm that PWM on pin 5 and 6 works fine when running the virtual wire library.
But pin 9 and 10 will not do so at all.

Logged

Pages: [1]   Go Up
Jump to: