Jump to content

bazuchan

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. I can't get shockburst work on NRF24L01 with msprf24 library. If I use w_tx_payload_noack instead of w_tx_payload everything works, but without shockburst. Transmitter on msp430g2553 #include <msp430.h> #include "uart.h" #include "msprf24.h" #include "nrf_userconfig.h" int main(void) { uint8_t addr[5] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 }; uint8_t buf[32]; uint8_t onoff = 0; WDTCTL = WDTPW | WDTHOLD; if (CALBC1_16MHZ==0xFF) { while(1); } // MCLK 16MHz, SMCLK 8MHz DCOCTL = CALDCO_16MHZ; BCSCTL1 = CALBC1_16MHZ; BCSCTL2 = DIVS_1; uart_init(); uart_puts("ready\n"); rf_crc = RF24_EN_CRC; rf_addr_width = 5; rf_speed_power = RF24_SPEED_1MBPS | RF24_POWER_MAX; rf_channel = 120; msprf24_init(); msprf24_set_pipe_packetsize(0, 32); msprf24_open_pipe(0, 1); msprf24_standby(); w_tx_addr(addr); w_rx_addr(0, addr); __bis_SR_register(GIE); while (1) { if (onoff=!onoff) strcpy(buf, "ON"); else strcpy(buf, "OFF"); uart_puts(buf); uart_puts("\n"); w_tx_payload_noack(32, buf); //w_tx_payload(32, buf); msprf24_activate_tx(); while (!(rf_irq & RF24_IRQ_FLAGGED)) LPM4; msprf24_get_irq_reason(); if (rf_irq & RF24_IRQ_TX) uart_puts("txon ok\n"); if (rf_irq & RF24_IRQ_TXFAILED) uart_puts("txon fail\n"); msprf24_irq_clear(RF24_IRQ_MASK); msprf24_standby(); __delay_cycles(100*DELAY_CYCLES_5MS); } } Receiver on msp430f5529 #include <msp430.h> #include "uart.h" #include "msprf24.h" #include "nrf_userconfig.h" int main(void) { uint8_t addr[5] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 }; uint8_t buf[32]; WDTCTL = WDTPW | WDTHOLD; // Stop WDT UCSCTL3 = SELREF__REFOCLK; // Set DCO FLL reference = REFO UCSCTL4 = SELA__REFOCLK | SELM__DCOCLKDIV | SELS__DCOCLKDIV; // Set ACLK = REFO, MCLK = DCOCLKDIV, SMCLK = DCOCLKDIV UCSCTL5 = DIVA__1 | DIVM__1 | DIVS__2; // ACK = REF0, MSCK = DCO, SMCLK = DCO/2 __bis_SR_register(SCG0); // Disable the FLL control loop UCSCTL0 = 0x0000; // Set lowest possible DCOx, MODx UCSCTL1 = DCORSEL_5; // Select DCO range 24MHz operation UCSCTL2 = FLLD_1 + 499; // Set DCO Multiplier for 16MHz // (N + 1) * FLLRef = Fdco // 499 + 1) * 32768 = 16MHz // Set FLL Div = fDCOCLK/2 __bic_SR_register(SCG0); // Enable the FLL control loop __delay_cycles(375000); // Loop until XT1,XT2 & DCO fault flag is cleared do { UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG); // Clear XT2,XT1,DCO fault flags SFRIFG1 &= ~OFIFG; // Clear fault flags } while (SFRIFG1&OFIFG); // Test oscillator fault flag uart_init(); uart_puts("ready\n"); rf_crc = RF24_EN_CRC; rf_addr_width = 5; rf_speed_power = RF24_SPEED_1MBPS | RF24_POWER_MAX; rf_channel = 120; msprf24_init(); msprf24_set_pipe_packetsize(0, 32); msprf24_open_pipe(0, 1); msprf24_standby(); w_tx_addr(addr); w_rx_addr(0, addr); if (!(RF24_QUEUE_RXEMPTY & msprf24_queue_state())) flush_rx(); msprf24_activate_rx(); __bis_SR_register(GIE); while (1) { while (!(rf_irq & RF24_IRQ_FLAGGED)) LPM4; msprf24_get_irq_reason(); while (rf_irq & RF24_IRQ_RX || msprf24_rx_pending()) { r_rx_payload(32, buf); msprf24_irq_clear(RF24_IRQ_RX); uart_puts("received: "); uart_puts(buf); uart_puts("\n"); } } }
  2. bazuchan

    Any kernel hackers here ?

    I believe you do not need to look in the code. This is what I get on x86 machine # sysctl -a | grep nmi kernel.nmi_watchdog = 1 kernel.panic_on_io_nmi = 0 kernel.panic_on_unrecovered_nmi = 0 kernel.unknown_nmi_panic = 0 on BBB it should be the same.
  3. bazuchan

    MSP-EXP430F5529LP CCS6.1.1 linux "surprise" :D

    I had the same problem with CCS6.0 under Linux and FR4133 launchpad. I fixed it with IAR under Windows (run the suggested recovery).
  4. I have a small project on MSP430F55xx, which is only need to be usb connected to pc. And I want to skip step of designing and/or manufacturing hardware. I need something like usb stick or small board with usb connector and MCU. I could use launchpads, but they are large boards with extra functionality (FET). Is there any design or device which I can use for my project?
×