Go Down

Topic: RF link display using the ATtiny85 (Read 17 times) previous topic - next topic

Coding Badly

Quote
When I used a ATtiny85 with an internal clock for RX I got a lot of dropouts.


Did you "tune" the internal clock?

carl47

Thanks for you reply.

Thats a reasonable response to a fixed frequency error. OSCCAL can be set to change the internal oscillator frequency.

VirtualWire works by setting a timer to give a fixed frequency interupt. 62.5 usec is the default.
Compare mode to OCRA is used to generate the interupt.
OCRR1A default set is 125. So we could tune the bit rate using a set of OCR1A or OSCCAL.

The problem was that it was not a fixed frequency error. The transmission would work fine for many hours
and then have dropouts for an hour. It seemed to be ambient temperature related.

The frequency is temperature related as per Figure 22-41 of the data sheet.

With my change of ambient we should only have a change from 7.93 to 7.95 Mhz.
This should not be enough to cause problems to VirtualWire unless the origional TX frequency is
on the edge of the default 62.5 usec value.

When I changed the transmitter to timer2 with 62.5 usec interupts the problem was solved.

Having solved my problem I did not chase down any further answers like provided in your reply.

Cheers.

mingd

Hi carl47, thanks for the very handy post. I'm trying to use your library but get a bunch of errors when I compile the transmitter example. The receiver example compiled fine. I tried replacing the entire VirtualWire library with your version and also tried replacing just the 2 .cpp and .h files and I'm not quite sure what else to do. Any advice would be greatly appreciated!

Error messages;
...VirtualWire.cpp: In function 'void vw_setup()':
...VirtualWire.cpp:257: error: 'TCCR2A' was not declared in this scope
...VirtualWire.cpp:258: error: 'TCCR2B' was not declared in this scope
...VirtualWire.cpp:259: error: 'OCR2A' was not declared in this scope
...VirtualWire/VirtualWire.cpp:262: error: 'TIMSK2' was not declared in this scope
...VirtualWire/VirtualWire.cpp:268: error: 'DDRD' was not declared in this scope
... VirtualWire/VirtualWire.cpp: In function 'void vw_tx_stop()':
... VirtualWire/VirtualWire.cpp:299: error: 'PORTD' was not declared in this scope
... VirtualWire/VirtualWire.cpp: In function 'void TIMER2_COMPA_vect()':
... VirtualWire/VirtualWire.cpp:409: error: 'PIND' was not declared in this scope
... VirtualWire/VirtualWire.cpp:426: error: 'PORTD' was not declared in this scope
...VirtualWire/VirtualWire.cpp:428: error: 'PORTD' was not declared in this scope

carl47

Sorry I took so long I have been on holidays.

I have the folders:

SEVENtiny

VirtualWire

VirtualWireTiny

In the arduino librarys folder:

C:\arduino-0021\arduino-0021\libraries

The transmitter compliles OK for me.

There is a big problem when we use modified librarys along with new functions.
Its hard to keep everything in order. Checkout microsofts .dll hell for example.

Sorry it does not work. I no longer use any version of virtual wire I wrote my own library.

http://arduino.cc/forum/index.php/topic,63755.0.html

This does not have problems with compilation.

mingd

Thanks for the reply carl47. It was actually my oversight because I didn't set the appropriate board before compiling. Your other library sounds good and am keen to have a play. Hope you had a good holiday :)

Go Up