Hello andras,I use ds20demo.pde as a sender
with this settings in RF12.cpp
rf12xfer(0x80C7 | (band << 4)); // EL,EF,12.0pF
rf12xfer(0x8209); // enable xtal, disable clk pin
rf12xfer(0xA68a); // (0xa68a FS20 868.250) 90khz )
rf12xfer(0xC606); // 57.6Kbps (38.4: 8, 19.2: 11, 9.6: 23, 4.8: 47)
rf12xfer(0x94A0); // VDI,FAST,134kHz,0dBm,-103dBm
rf12xfer(0xC2AC); // AL,!ml,DIG,DQD4
rf12xfer(0xCA83); // FIFO8,SYNC,!ff,DR
rf12xfer(0xCE00 | group); // SYNC=2DXX?
rf12xfer(0xC483); // @PWR,NO RSTRIC,!st,!fi,OE,EN
rf12xfer(0x9850); // !mp,90kHz Devation Frequenzabstand des High- und Low-Wertes bei der Ubertragung im FSK-Betrieb,MAX OUT
rf12xfer(0xCC77); // OB1?OB0, LPX,?ddy?DDIT?BW0
rf12xfer(0xE000); // NOT USE
rf12xfer(0xC800); // NOT USE
rf12xfer(0xC040); // 1.66MHz,2.2V
I use this file (http://jeefiles.equi4.com/recv868fs20.pde )as a receiver with
some software of the raw wiki Raw RF12 transmit demo, the RF12 init values are changed !!
// RFM 12B functies
static void rf12enable () {
PORTSPI &= ~ BV(DDSS);
}
static void rf12disable () {
PORTSPI |= BV(DDSS);
}
static void spiinit () {
rf12disable();
DDRSPI |= BV(DDMOSI) | BV(DDSCK) | BV(DDSS);
DDRSPI &= ~ BV(DDMISO);
SPCR = BV(SPE) | BV(MSTR) | BV(SPR0);
SPSR |= BV(SPI2X);
}
static uint8t rf12byte (uint8t out) {
SPDR = out;
loopuntilbitisset(SPSR, SPIF);
return SPDR;
}
static uint16t rf12xfer (uint16t cmd) {
rf12enable();
uint8t r1 = rf12byte(cmd >> 8);
uint8t r2 = rf12byte(cmd);
rf12disable();
return (r1 << 8) | r2;
}
static void rf12init () {
rf12xfer(0x8028); // EL,EF,12.0pF
rf12xfer(0x82c0); // enable xtal, disable clk pin
rf12xfer(0xa67e); // 868.2500 MHz 0xa688
rf12xfer(0xC606); // 57.6Kbps (38.4: 8, 19.2: 11, 9.6: 23, 4.8: 47)
rf12xfer(0x90d8); // VDI,FAST,134kHz,0dBm,-103dBm // 90d8 no noise
rf12xfer(0xC26C); // AL,!ml,DIG,DQD4
rf12xfer(0xCA80); // FIFO8,SYNC,!ff,DR
rf12xfer(0xCE00 | GROUP); // SYNC=2DXX?
rf12xfer(0xC4F6); // @PWR,NO RSTRIC,!st,!fi,OE,EN
rf12xfer(0x9850); // !mp,90kHz,MAX OUT
rf12xfer(0xCC77); // OB1?OB0, LPX,?ddy?DDIT?BW0
rf12xfer(0xB800); // NOT USE
rf12xfer(0xC800); // NOT USE
rf12xfer(0xC040); // 1.66MHz,2.2V
}
static void rf12send (uint8t out) {
while ((rf12xfer(RFSTATUS) & RFREADY) == 0)
;
rf12xfer(RFXMITREG | out);
rf12crc = crc16update(rf12crc, out);
}
This better circuit use an amplifier and a comparator , to make the interrupt signal
Netlist
Exported from OOKACcoupledinvertingamplifier.sch at 1/23/2010 5:34:53 PM
EAGLE Version 5.6.0 Copyright (c) 1988-2009 CadSoft
Net Part Pad Pin Sheet
N$1 C1 2 2 1
R1 1 1 1
N$2 C2 1 1 1
IC1 2 -IN 1
R1 2 2 1
R2 1 1 1
N$4 C2 2 2 1
IC1 1 OUT 1
IC1 5 +IN 1
R2 2 2 1
N$5 C3 1 1 1
IC1 3 +IN 1
IC1 6 -IN 1
R3 1 1 1
R4 2 2 1
N$6 IC1 7 OUT 1 // output SV1 AI0 Jeenode PORT1
SV1 2 2 1
N$8 C1 1 1 1
JP1 1 1 1 // input from RFM12B ARSSI
N$15 C3 2 2 1
C4 - - 1
C5 2 2 1
IC1 4 V- 1
R4 1 1 1
SV1 4 4 1 // SV1 GND Jeenode PORT1
N$16 C4 + + 1
C5 1 1 1
IC1 8 V+ 1
R3 2 2 1
SV1 3 3 1 // SV1 3.3V Jeenode PORT1
Part Value Device Package Library Sheet
C1 10nF C-EUC2012 C2012 rcl 1
C2 33p C-EUC2012 C2012 rcl 1
C3 100nf C-EUC2012 C2012 rcl 1
C4 10uF CPOL-EUE2,5-6E E2,5-6E resistor 1
C5 100n C-EU025-025X050 C025-025X050 resistor 1
IC1 LM358 LM358N DIL08 linear 1
or
IC1 TCL27M2 see notes
JP1 PINHD-1X1 1X01 pinhead 1
R1 22k R-EUM2012 M2012 resistor 1
R2 1M5 R-EUM2012 M2012 resistor 1
R3 56k R-EUM2012 M2012 resistor 1
R4 27k R-EUM2012 M2012 resistor 1
SV1 MA06-1 MA06-1 con-lstb 1
REMARKS
R4 = 39k when using TLC27M2
R4 = 27k when using LM358 // don't use pull-up on int = digitalWrite(RXDATA, 0) LM358 can't pull it to zero;
R2 can be 470k-1M5 1M5 can be to sensitive for codes send within 2 meters .
FSK will not work with these changed RF12 init values,but you can send and receive OOK with these wonderful jeenodes.