Hi!
I want use the library "jeelib.h" to control a RFM12B.
I'm using the pin 69 (A15) as SS and need change the library to set this pin.
I found that should be "K" instead "B" on this part but, I'm not sure.
#define rf12_rawlen rf12_len
// #define rf12_dest (rf12_hdr & RF12_HDR_DST ? rf12_hdr & RF12_HDR_MASK : 0)
// #define rf12_orig (rf12_hdr & RF12_HDR_DST ? 0 : rf12_hdr & RF12_HDR_MASK)
#define slack 5
#define crc_initVal ~0
#define crc_endVal 0
#define crc_update _crc16_update
#endif
// #define OPTIMIZE_SPI 1 // uncomment this to write to the RFM12B @ 8 Mhz
// pin change interrupts are currently only supported on ATmega328's
// #define PINCHG_IRQ 1 // uncomment this to use pin-change interrupts
// maximum transmit / receive buffer: 3 header + data + 2 crc bytes
#define RF_MAX (RF12_MAXDATA + 5)
// pins used for the RFM12B interface - yes, there *is* logic in this madness:
//
// - leave RFM_IRQ set to the pin which corresponds with INT0, because the
// current driver code will use attachInterrupt() to hook into that
#if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
#define SS_DDR DDRB
#define SS_PORT PORTB
#define SS_BIT 0
I don't know if "SS_BIT" should be zero.
Please someone can help me?
Thanks in advance.
Fernando Garcia
Actually, pin A15 on the MEGA 2560 is PORTK bit 7.
This may come in handy: https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0
However, I wouldn't necessarily define it this way. Perhaps B10000000, 0x80, or 128 might be preferred, because it's already in the same boolean form that PORTK will be in. In one case I used a bit shift operator 1 << BIT so that setting BIT to 7 would shift 1 over 7 places.