Hi,
I’ve got a attitny2313V microcontroller that I plan to be using to control an RF transceiver. Both the MIRF and uMIRF provided by spark fun seem like they would be very ideal for what we need. Given that the MIRF is out of stock, the uMIRF will probably have to do.
Now my question is how to clock the two devices. It appears that there is a clock signal available on the uMIRF header. Can this then be used for clocking the microcontroller as well, or is this intended for an external clock that is used in the circuit?
CLK1 and CLK2 are for clocking data into the nRF2401A.
Leon
Could you elaborate your response a little more? So CLK1 & CLK2 will not provide a clock for the rest of the circuit, but require that an external crystal osc be used on them, correct?
This is interesting. I’ve always wondered if you could use a transceiver to clock a microcontroller. If anyone could please provide as much input as possible… this would be great.
What if the micrcontroller’s clock changed based upon the temperature setting? For instance, this microcontroller is outside. As the temperature changes… day and night… so does its timing. If you could use the transceiver as a clock… this would maintain a consistent timing, right?
PLZ HELP!
superm1:
Could you elaborate your response a little more? So CLK1 & CLK2 will not provide a clock for the rest of the circuit, but require that an external crystal osc be used on them, correct?
No, they are clock inputs for the data. The protocol is similar to SPI. Have a look at the nRF2401 data sheet.
Leon
Just my two cents, but the nRF24L01 chip (used in the MiRF-v2 module from SparkFun) is superior in just about every way to the nRF2401 chip that is in the MiRF and the uMiRF modules. For starters, the 24L01 has a true SPI interface and allows you to read registers instead of just writing them (which makes debugging a million times easier). It also has built-in functionality for acknowledgements and some other cool features.
Also, if you program in C, I have posted source code to this forum that allows you to setup and control pretty much all aspects of the 24L01 chip with only a few defines and function definitions.
So would you say its worth just picking up the nRF24L01 chip on its own, and using my own caps and clock rather than going with the MiRF-v2?
I emailed Nordic, and they were saying the same thing. The nRF24L01 is worth going for instead.
No, I’m saying go with the MiRF-v2 board. It is just a breakout of the pins on the 24L01 chip, with the supporting hardware onboard (clock, matching network, etc.). I personally own 3 of them and have used them in several projects.
As far as data clock, this is done through SPI, so you don’t really have to generate your own clock as long as you have a hardware SPI port on your micro (this is the SCK pin on the breakout module). The 24L01 does require its own chip clock, but SparkFun took care of this for you on the MiRF-v2 board.
Okay i’ll get an order out for two of these MIRF-v2’s then.
As for SPI on my microcontroller, it appears that there is SPI, but the data sheet appears to only mention SPI in a sense for programming the microcontroller.
Is there such a thing as SPI only being used for programming the microcontroller? I think I am just reading into it too much, and the SPI will be usable elsewise still.
This is the datasheet for the microcontroller we’re using:http://www.atmel.com/dyn/resources/prod … /2543S.pdf
The Tiny2313 has a proper SPI.
Leon
In addition to the three hardware SPI pins (MOSI, MISO, and SCK), you will need to connect a general-purpose IO pin on your AVR as an output to the CSN pin on the MiRF-v2 to complete the SPI interface. You will also need to connect another GPIO output pin to CE. The IRQ pin on the MiRF-v2 can be left floating or else you can connect it to an input GPIO pin on your micro that is set up for interrupt on change or some similar purpose. My software doesn’t require that the IRQ pin be connected unless you use the nrf24l01_irq_pin_active() function, and this function is not absolutely necessary for correct operation. It does allow you to process faster whether you use interrupts or not, however, as long as you have the extra pin.