Go Down

Topic: attiny 85, any pointers?/ (Read 22616 times) previous topic - next topic

fungus


Join the club. I agree with everything you have said - it is extreemly difficult to debug these things.


This is why I develop my Tiny85 code on a Tiny84.


But you can get creative.


Creativity is the key. Usually there's a LED or something that you can flash codes on. Or pulses on an oscilloscope. Or clicks on a speaker. Or...anything a human can see/hear.

I like little OLED screens - you can connect some of them to Arduinos with just one or two wires, eg. http://cgi.ebay.com/itm/370779189389

I2C can share pins with SPI if you're careful, ie. never change the data line when the clock line is high (that's an I2C 'start' signal). That screen can connect to a Tiny's USI pins in parallel with an nRF24L01+ module, no extra I/O pins needed (I've done it)

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fgasparri

#76
Apr 03, 2013, 01:07 pm Last Edit: Apr 03, 2013, 01:36 pm by fgasparri Reason: 1
Thanks guys, I'll try with the led debugging stuff you suggested and let you know!
Quick question, do I need to have the receiver portion working to test the transmitter (i.e. is there any acknowledge that the tx is expecting from the rx) ? Or I can just setup the attiny with the "debugger" code you posted and start transmitting without any receiver device? 

Thanks so much,
Fabio

Davste


Thanks guys, I'll try with the led debugging stuff you suggested and let you know!
Quick question, do I need to have the receiver portion working to test the transmitter (i.e. is there any acknowledge that the tx is expecting from the rx) ? Or I can just setup the attiny with the "debugger" code you posted and start transmitting without any receiver device? 

Thanks so much,
Fabio



Nope. That's the best thing about it, it's just there to test the wiring on the attiny.

raedon

someone could run the library with ATTINY44?

Davste


someone could run the library with ATTINY44?


Ship me an ATTINY44 and I'll do it for you :)
Otherwise, just take a look at the SPI85 class and change the pins. You'll need to find which are the correct pins for MOSI, MISO, SCK, etc.. for the ATTINY44 and put them there. Good luck!

skootles



someone could run the library with ATTINY44?


Ship me an ATTINY44 and I'll do it for you :)
Otherwise, just take a look at the SPI85 class and change the pins. You'll need to find which are the correct pins for MOSI, MISO, SCK, etc.. for the ATTINY44 and put them there. Good luck!


Funny enough I've done this with an 84 and for some reason, haven't had any luck.

Davste

I have a couple of 84s on the way. I have had some very thourough experience with the 85s, and have routines ready that can check if all the wiring, etc.. is OK. I think, if there's a way, I'll probably manage, the only problem is if I have time to do it. I will share the wiring and code if I manage.

raedon

Take a look at this example, use the same ATTINY85 and within comments puts another example using a ATTINY44.

http://www.insidegadgets.com/2012/08/22/using-the-nrf24l01-wireless-module/

Davste


Take a look at this example, use the same ATTINY85 and within comments puts another example using a ATTINY44.

http://www.insidegadgets.com/2012/08/22/using-the-nrf24l01-wireless-module/


Really, do take a look at the SPI85 class man. One of the files is literally something like
mosi = PA5;
miso = PA6;
etc.. Where PA5 and PA6 are pin names.
Then, find the datasheet for the ATTINY44:
PA5 (ADC5/DO/MISO/OC1B/PCINT5)
PA6 (PCINT6/OC1A/SDA/MOSI/DI/ADC6)
PA4 (ADC4/USCK/SCL/T1/PCINT4)
Those are the important ones. CE and CSN are probably variable.
Finally, make sure everything is wired correctly. Then use the code I've posted previously to check the wiring. Sorry I can't help any more, really busy.

raedon

sorry if bother you was not my intention, my question was just to ask if it was possible to make it work, do not spend more time on this library because I had found the one I posted recently, now I have at least two options to try.

Davste


sorry if bother you was not my intention, my question was just to ask if it was possible to make it work, do not spend more time on this library because I had found the one I posted recently, now I have at least two options to try.


I actually had used that out of desperation in those four days I spent debugging. You'll find my name on that page as "David" :)

You may find it is not easy to get it up and running. You will need to install WinAVR, programmer's notepad and set up the makefile to get it to compile and send it to the ATTiny44. Fortunately I have the Makefile already set up, it's in one of the dropbox links in one of my questions on that page.
You can try but I don't recommend it. You will waste lots of time setting it up, and even if you manage to get it to work, the arduino libraries are missing in AVR, and it's a whole different level of coding. Don't know what's your experience in that area. If you have time, go ahead, nothing to lose but try! :)

raedon

I already make the changes to the file to make it work with the ATTINY44, also change files mirf.cy mirf.h setup.c fail me burn only the ATtiny, I'll do that tomorrow also see what I can do I'll take a look at your code because I have only one module NRF24L01 free to use

Davste

Watch out, by the way. I've managed to burn 3 nRF modules by swapping around the ground and VCC at 3 AM. Happened  for a second or two and from then on it just wouldn't receive anything. It would return 0 or 255 randomly as status instead of working. I can confirm this as when I replaced it with a different card, it worked.

Stanley


I've managed after five days of mucking around with it :)
Remember to try different channels. That may have been one of the problems for me.
Here's the code I'm using right now (that works):

ATTiny85:
Code: [Select]
#include <avr/io.h>
#include <inttypes.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <SPI85.h>
#include <Mirf85.h>
#include <nRF24L0185.h>
#include <MirfHardwareSpiDriver85.h>


const int bufferSize = 2;
byte buffer[] = {
  'D','S'
};

#define CE  PB3 //ATTiny
#define CSN PB4 //ATTiny

void setup(){
  Mirf.cePin = CE;
  Mirf.csnPin = CSN;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();


  Mirf.setRADDR((byte *)"clnt2");
  Mirf.payload = 2;
  Mirf.channel = 80;
  Mirf.setTADDR((byte *)"clnt1");
  Mirf.config();
}

void loop(){
  Mirf.send(buffer);
  while( Mirf.isSending() )
  {
    delay(1);
  }
  delay(1000);
}




I can't seem to find the below *85 header files, which libs are they from ??
#include <SPI85.h>
#include <Mirf85.h>
#include <nRF24L0185.h>
#include <MirfHardwareSpiDriver85.h>

Or could you just zip up all the attiny & headers and shared it as a dropbox links ?

Thanks


nRF24L01+ UNO Adapter for Sale :-
http://arduino-for-beginners.blogspot.com/p/nrf-adapter-for-sale.html

Davste

#89
Apr 08, 2013, 08:14 pm Last Edit: Apr 08, 2013, 08:15 pm by Davste Reason: 1


Or could you just zip up all the attiny & headers and shared it as a dropbox links ?

Thanks


They are on this thread, look at this post:

Guess my phone didn't upload it right, ill try again
i may have to get a different browser on my phone


make sure you are logged in or you won't see the file.

Go Up