I am trying to understand the library for the RFM01&02
I would like to understand this:
#define SDI 0 // SDI, -> RF02 Atmega PB0 Arduino 8
#define SCK 1 // SCK, -> RF02 Atmega PB1 Arduino 9
#define CS 2 // nSEL, -> RF02 Atmega PB2 Arduino 10
#define IRQ 4 // nIRQ, <- RF02 Atmega PB4 Arduino 12
//------------------// FSK: Pullupto VCC
Why these connections? I mean, for example, the SCK from RF02 is connected to Arduino (with Atmega168) pin 9. This pin is PB1(OC1A/PCINT1). The datasheet says this about this pin:
OC1A/PCINT1 – Port B, Bit 1
OC1A, Output Compare Match output: The PB1 pin can serve as an external output for the Timer/Counter1 Compare Match A. The PB1 pin has to be configured as an output (DDB1 set (one)) to serve this function. The OC1A
pin is also the output pin for the PWM mode timer function.
PCINT1: Pin Change Interrupt source 1. The PB1 pin can serve as an external interrupt source.
Acording to this image:
Where is the logic?
And in the datasheet of atmega you find this:http://s2.subirimagenes.com/otros/8169302spi-pin.jpg