VirtualWire without PTT ?

I have had a look at the VirtualWire pdf sheet, and it tells me that ptt is default to pin 10, and you can change it to what you want. But I have a project that I need all the pins to avoid changing harware, so can I just not set ptt in setup, and use pin 10 for something else?

Or must I try looking in the library and see if I can see whats happening, perhaps just delete this from the library ?

// Set the digital IO pin to enable the transmitter (press to talk) // Defaults to 10 extern void vw_set_ptt_pin(uint8_t pin);

// By default the PTT pin goes high when the transmitter is enabled. // This flag forces it low when the transmitter is enabled. extern void vw_set_ptt_inverted(uint8_t inverted);

I can generate ptt from one of the other signals to switch on the Tx module.

The VirtualWire seems OK with my using pin 10 for one of my switch scanning outputs, but meanwhile pin 10 seems to have a high impedance output ..

I have four 22k pulldown resistors on pins 10, 11 , 12 and 13.

Three of them give 4v output ( on 4v5 batteries ) but pin 11 only gives 1v ! If I switch the switch off ( no load ) it goes to 4v.

Its wasnt the chip socket, or the chip, or the wiring.

If I ran Blink with pin 11 as output it goes to 4v regardless of the 22k being switched to ground or not !

If I took out the VirtualWire from the ketch, the voltage came right.

I then realised that VW setup resets pin 10 to an input, ( I had previously set it as output ) so I declared it an output again after the VW setup and all is well.

Th 22 k pull down resistors were dropping the voltage across the internal pull-ups.

There are 2 other ways I found to get round it, one is swapping pin 11 with one of my input pins, and the other that I took a gamble on was setting the ( unused) Rx pin as pin 00 ( the rxd pin used in programming it ) but it still works OK with the serial link. I think setting it as an output will stop you getting back into the chip ?

Yourtransmitter need PTT? If not don't add the PTT lines in your code.

"I think setting it as an output will stop you getting back into the chip ?" That seems to be a problem if you are blasting out a lot of data while (before?) starting the download, and jamming up the receive buffer on the PC. Possible solution - press & hold reset, start the IDE, keep reset held down until IDE says "downloading xxxx bytes of 32K"...

I usually use the ptt output to power the Tx, it comes up in plenty of time not to miss any data, and the TX only draws about 10mA. This way there is no quiescent current drawn by the Tx, even the cheapy ones, between transmissions.

In my current project, I needed 18 pins as input/outputs, so I generated my own ptt from one of my scanning line outputs charging a cap via a diode to keep the TX on, which works fine. ( the ptt of the Tx is 1Mohm impedance )

Even if you dont use the PTT, it seems the VirtualWire setup sets it as an output, ( and the Rx pin 11 as an input,) but I have found you can simply change them back after the VWsetup instruction.

re the serial pins DIO0 and DIO1, I have always been wary of touching them, in case I couldn't reprogram the chip later, but it seems it is OK to use the DIO0 RXD pin as an input for something else, but I have gone back to using pin 11 again,just in case, after resetting it to an output.

Meanwhile I wasted half the weekend again due to my confusion with where to use INT, BIN, HEX ,CHAR,BYTE , :-)

I got it right in the end, but when I get some spare time I will study it properly again..