Hallo,
ich wollte den RFM12 (an MBED NXP1768) mit der Betty ansteuern,
aber irgendwie krieg ich keine Kommunikation hin.
http://www.mikrocontroller.net/topic/194471 hat mir nicht geholfen, das rfm12 scheint nix zu empfangen ,obwohl ich data whitening ausgeschaltet und den RFM12 auf 19200 Baud gestellt hab.
Kann jemand der die Verbindung geschafft hat da helfen?
RFM12 CONF:
writeCmd(0x0000); // intitial SPI transfer added to avoid power-up problem
writeCmd(RF_SLEEP_MODE); // DC (disable clk pin), enable lbd
// wait until RFM12B is out of power-up reset, this takes several *seconds*
writeCmd(RF_TXREG_WRITE); // in case we're still in OOK mode
while (NIRQ == 0) writeCmd(0x0000);
//my init
writeCmd(0x80D7); //EL,EF,433band,11.5pF
writeCmd(0x82D9); //!er,!ebb,ET,ES,EX,!eb,!ew,DC
writeCmd(0xA514); //433,25 MHz
writeCmd(0xC611); //19.200 baud
// writeCmd(0xC647); //4.8kbps
writeCmd(0xC48C); //VDI,FAST,200kHz Bandbreite, -6dB Verstärkung, DRSSI threshold: -79dBm
// writeCmd(0x94A0); //VDI,FAST,134kHz,0dBm,-103dBm
writeCmd(0xC2AC); //AL,!ml,DIG,DQD4
writeCmd(0xCA81); //FIFO8,SYNC,!ff,DR
writeCmd(0xC483); //@PWR,NO RSTRIC,!st,!fi,OE,EN
writeCmd(0x9870); //!mp,120kHz,MAX OUT
// writeCmd(0x9850); //!mp,9810=30kHz,MAX OUT
writeCmd(0xE000); //
writeCmd(0xC800); //
writeCmd(0xC400); //1.66MHz CLK-Pin,2.2V Battery
writeCmd(0xCA81); //FIFO initialisieren
writeCmd(0xCA83); //FIFO aktivieren
betty :
in mainmenu.c
const struct MENU_ENTRY mainMenuEntries[] =
{
{ 0, (void*)&gamesMenu, MENUENTRY, "Games", "Play some games" },
{ 0, (void*)&testMenu, MENUENTRY, "TestStuff", "Various tests" },
{ enter_settings_menu, 0, FUNCENTRY, "Settings", "Change settings" },
{ 0, (void*)&toolsMenu, MENUENTRY, "Tools", "Tools" },
{ RF_send, 0, FUNCENTRY, "RFM12", "RFM12 Mbed Test" },
/*{ RF_send("12345!", 6), 0, FUNCENTRY, "RFM12", "RFM12 Mbed Test" },*/
/*{ show_credits, 0, FUNCENTRY, "Credits", "Show Credits" },*/
{ show_info, 0, FUNCENTRY, "Info", "Show Info" }
};
in cc1100.c
const unsigned char conf_rfm12[0x2F]={
0x29, // IOCFG2
0x2E, // IOCFG1
0x06, // IOCFG0
0x47, // FIFOTHR
0x2D, // SYNC1
0xD4, // SYNC0
0x3E, // PKTLEN
0x1A, // PKTCTRL1
0x05, // PKTCTRL0 datawhitening aus machen
0x01, // ADDR
0x00, // CHANNR
0x06, // FSCTRL1
0x00, // FSCTRL0
0x10, // FREQ2 #
0x0B, // FREQ1 #
0xDA, // FREQ0 # -> 433,249969 MHz
0x49, // MDMCFG4
0x75, // MDMCFG3
0x02, // MDMCFG2
0x32, // MDMCFG1
0xC1, // MDMCFG0 CHANSPC_M
0x35, // DEVIATN
0x04, // MCSM2
0x0C, // MCSM1 0c
0x38, // MCSM0
0x16, // FOCCFG
0x6C, // BSCFG
0x43, // AGCCTRL2
0x40, // AGCCTRL1
0x91, // AGCCTRL0
0x46, // WOREVT1
0x50, // WOREVT0
0x78, // WORCTRL
0x56, // FREND1
0x10, // FREND0
0xA9, // FSCAL3
0x0A, // FSCAL2
0x00, // FSCAL1
0x11, // FSCAL0
0x41, // RCCTRL1
0x00, // RCCTRL0
0x57, // FSTEST
0x7F, // PTEST
0x3F, // AGCTEST
0x98, // TEST2
0x31, // TEST1
0x0B // TEST0
};
void RF_send() {
unsigned char buf[0x06] = "12345!";
int payload_cnt=6;
switch_to_idle();
cc1100_strobe(SFTX);
cc1100_strobe(SCAL);
cc1100_write1(TX_fifo, payload_cnt+2);
cc1100_write1(TX_fifo, 1);
cc1100_write(TX_fifo | BURST, buf, payload_cnt);
cc1100_write1(TX_fifo, 0x04);
cc1100_strobe(STX);
}
wäre echt um hilfe froh.
wenn ich den menu eintrag aufrufe, erscheint das sendesymbol im display nicht, heißt das , das auch gar nichts gesendet wurde?
Danke,
Thomas