Go Down

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

carl47

#15
Oct 27, 2011, 05:42 am Last Edit: Oct 27, 2011, 06:20 am by carl47 Reason: 1
Thanks Coding Badly for your answer. You have helped me out on more than one occasion.

I can see the references you point out.

It would be nice if there were a complete history of the Arduino development - hardware and software.

I have looked at:

http://en.wikipedia.org/wiki/Arduino#History

Is there a more complete history of the software and hardware development anywhere?


Coding Badly


You are welcome!

I'm afraid I can't help with that question.

The library does not allow VirtualWireTiny.h ATTINY85 use as a transmitter (TX)

Errors when trying to:

attiny85_RF_transmiter.cpp: In function 'void setup ()':
attiny85_RF_transmiter: 11: error: 'vw_set_tx_pin' was not declared in this scope
E: \ arduino-0022 \ libraries \ VirtualWireTiny / VirtualWireTiny.h: 65: error: too many arguments to function 'void vw_setup ()'
attiny85_RF_transmiter: 12: error: at this point in file
attiny85_RF_transmiter.cpp: In function 'void loop ()':
attiny85_RF_transmiter: 21: error: 'vw_send' was not declared in this scope
attiny85_RF_transmiter: 22: error: 'vw_wait_tx' was not declared in this scope

carl47

You are right I did not modify virtual wire to use the 85 as the Tx.

I wrote another library to use the 85 as Tx or Rx.


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

#19
Feb 01, 2012, 01:02 am Last Edit: Feb 01, 2012, 11:41 am by mchr3k Reason: 1
I have been using your Manchester library for TX on an ATtiny85 and RX on an Arduino Uno. However, I am keen to get VirtualWire working as this uses an interrupt driven approach that avoids the sender/receiver having to block while sending/receiving.

I have made an attempt to get VirtualWire working for TX/RX on ATtiny85/Arduino Uno. The code is compiling and I am fairly sure I have used the correct timer settings but I don't seem to be receiving any valid messages on my Arduino.

I am programming my ATtiny85 using the instructions on this site (http://hlt.media.mit.edu/?p=1695) but with the ATtiny85 core from http://code.google.com/p/arduino-tiny/.

All of my code is up on github:

https://github.com/mchr3k/arduino/tree/master/libraries/VirtualWireNewTiny
https://github.com/mchr3k/arduino/blob/master/wsn_arduino_vw/wsn_arduino_vw.ino
https://github.com/mchr3k/arduino/blob/master/wsn_attiny_vw/wsn_attiny_vw.ino

As you can see, the TX is trying to send 10x"D" ("D" = 0x44). My receiver consistently receives strings like "0 10 0 C 1D C 1D A 28 0 C1 3 E 0 1 0 2 5D 0 C1 2 33 0 2 0 0 0 A 0". The first part of each received "message" is consistently "0 10 0 C 1D C 1D A 28 0 C1 3 E 0 1 0 2 5D 0 C1" for the first few minutes.

Can you suggest how I should debug this or what could be going wrong?

EDIT: A friend has pointed out that the ATtiny has 8 bit counters vs the ATmega 16 bit counters.

I'm trying to do 1000 bit/second which gives the following maths.

uint16_t ocr1a = (F_CPU / 8UL) / speed;
( 8000000 / 8 ) / 1000 = 1000

This value of 1000 won't fit in the ocr1a register so the timing will be totally wrong. I will need to adjust the clock frequency scaling to ensure the ocr1a value is lower on the ATtiny. I will hopefully try this out tonight.

carl47

#20
Feb 04, 2012, 11:37 pm Last Edit: Feb 04, 2012, 11:43 pm by carl47 Reason: 1
I think you are right it does look like a timing problem.

I,m sure you have the necessary skills to solve your problem.

Make sure you download the data sheet for the 85. It has all the information you will need
to setup the timers.

Cheers.

Coding Badly


By default, the Tiny Core uses timer 1 for millis on the ATtiny85 processor.  You will either need to use timer 0 (which is much more "Arduino friendly") or move millis to timer 0.  There is an option in core_build_options.h to easily switch millis to timer 0.



By default, the Tiny Core uses timer 1 for millis on the ATtiny85 processor.  You will either need to use timer 0 (which is much more "Arduino friendly") or move millis to timer 0.  There is an option in core_build_options.h to easily switch millis to timer 0.



Thanks for the tip! That could have caused some bizarre bugs if I tried to do some timing.

I have given up on using VirtualWire for now and have added interrupt driven message reception to the Manchester library which I am already using. Full details are available here: http://mchr3k-arduino.blogspot.com/2012/02/wireless-sensor-node-part-6.html

Go Up