Showing posts with label CC1310DK. Show all posts
Showing posts with label CC1310DK. Show all posts

Thursday, October 19, 2017

Using CC13xx/CC26xx running Contiki OS to toggle LED from UART.

The following example shows how to using CC13xx/CC26xx running Contiki OS to toggle LED from UART.

1. Replace the following code into hell-world.c

#include "contiki.h"
#include "dev/cc26xx-uart.h"
#include "dev/serial-line.h"
#include "dev/leds.h"

#include < stdio.h >/* For printf() */
#include  < string.h >


 PROCESS(test_serial, "Serial line test process");
 AUTOSTART_PROCESSES(&test_serial);

 PROCESS_THREAD(test_serial, ev, data)
 {
   PROCESS_BEGIN();
   cc26xx_uart_set_input(serial_line_input_byte);
  
   printf("Hello, world Serial line test\n");

   for(;;) {
     PROCESS_YIELD();
     if(ev == serial_line_event_message) {
       printf("received line: %s\n", (char *)data);
       if(strcmp(data,"ON")==0)
           leds_on(LEDS_GREEN);
       else if(strcmp(data,"OFF")==0)
           leds_off(LEDS_GREEN);
     }
   }
   PROCESS_END();
 }


2. Build hello-world.bin for LAUNCHXL-CC1310 using  "make TARGET=srf06-cc26xx BOARD=launchpad/cc1310 hello-world.bin"

3. Download hello-world.bin to LAUNCHXL-CC1310 using Flash Programmer 2.

4. Start a terminal tool like teraterm to connect to LAUNCHXL-CC1310 application virtual COM port..

5. Enter "ON" and "CTRL+Enter" to send ON command with end character "0x0A" to LAUNCHXL-CC1310 and you will see green led is turned on

6. Enter "OFF" and "CTRL+Enter" to send OFF command with end character "0x0A" to LAUNCHXL-CC1310 and you will see green led is turned on

Wednesday, January 11, 2017

Build 6lbr running on CC2650DK, CC1310DK, LAUNCHXL-CC2650 or LAUNCHXL-CC1310

The following steps show how to build 6lbr running CC2650DK or CC1310DK

1. Refer to http://sunmaysky.blogspot.tw/2016/03/running-6lbr-on-cc2538dk-with-enc28j60.html which shows you how to connect ENC28J60 to SmartRF06EB.

2. git clone --recursive https://github.com/cetic/6lbr

3. Change "#define CETIC_6LBR_NVM_DEFAULT_CHANNEL 26" in \6lbr\examples\6lbr\6lbrnvm-data.h to "#define CETIC_6LBR_NVM_DEFAULT_CHANNEL 25"

4.  Add "#define RF_CORE_CONF_CHANNEL 25" into common configuration in \6lbr\examples\6lbr\project-conf.h

5. Change directory to \6lbr\examples\6lbr

6. Change the macro CETIC_6LBR_NVM_SIZE from 2048 to 4096 in file cc26xx-int-nvm.c (p.s. this is not necessary if you use LAUNCHXL-CC2650 or LAUNCHXL-CC1310)
          #define CETIC_6LBR_NVM_SIZE 4096//2048

7a. Run "make TARGET=srf06-cc26xx BOARD=srf06/cc26xx all" for CC2650DK or
7b. Run "make TARGET=srf06-cc26xx BOARD=srf06/cc13xx all" for CC1310DK or
7c. Run "make CC26XX_NVM=ext TARGET=srf06-cc26xx BOARD=launchpad/cc2650 all" for LAUNCHXL-CC2650 or
7d. Run "make CC26XX_NVM=ext TARGET=srf06-cc26xx BOARD=launchpad/cc1310 all" for LAUNCHXL-CC1310

8. Download cetic_6lbr_router.bin under \6lbr\examples\6lbr\bin_srf06-cc26xx to CC2650DK , CC1310DK, LAUNCHXL-CC2650, or LAUNCHXL-CC1310 with Flash Programmer 2.

9. You should see the following outputs on UART of CC2650DK , CC1310DK, LAUNCHXL-CC2650, or LAUNCHXL-CC1310.



9. You can access to [bbbb::100] now.



Tuesday, September 6, 2016

How to porting collector example in TI-15.4 Stack from CC1310 LaunchPad to CC1310DK

You only have to revise the following red codes in  CC1310_LAUNCHXL.h to make it work. RLED on CC1310 LaunchPad is mapped to LED1 on CC1310DK, GLED on CC1310 LaunchPad is mapped to LED2 on CC1310DK, BTN-1 on  CC1310 LaunchPad is mapped to LEFT BTN on CC1310DK, and BTN-2 on  CC1310 LaunchPad is mapped to RIGHT BTN on CC1310DK.

/* Discrete outputs */
#define Board_RLED                  IOID_25
#define Board_GLED                  IOID_27
#define Board_LED_ON                1
#define Board_LED_OFF               0

/* Discrete inputs */
#define Board_BTN1                  IOID_15
#define Board_BTN2                  IOID_18

/* UART Board */
#define Board_UART_RX               IOID_2          /* RXD  */
#define Board_UART_TX               IOID_3          /* TXD  */
#define Board_UART_CTS              IOID_19         /* CTS  */
#define Board_UART_RTS              IOID_14         /* RTS */

/* SPI Board */
#define Board_SPI0_MISO             IOID_8          /* RF1.20 */
#define Board_SPI0_MOSI             IOID_9          /* RF1.18 */
#define Board_SPI0_CLK              IOID_10         /* RF1.16 */
#define Board_SPI0_CSN              PIN_UNASSIGNED
#define Board_SPI1_MISO             PIN_UNASSIGNED
#define Board_SPI1_MOSI             PIN_UNASSIGNED
#define Board_SPI1_CLK              PIN_UNASSIGNED
#define Board_SPI1_CSN              PIN_UNASSIGNED

/* I2C */
#define Board_I2C0_SCL0             IOID_4
#define Board_I2C0_SDA0             IOID_5

/* SPI */
#define Board_SPI_FLASH_CS          IOID_20
#define Board_FLASH_CS_ON           0
#define Board_FLASH_CS_OFF          1

/* Booster pack generic */
#define Board_DIO0                  IOID_0
#define Board_DIO1_RFSW             IOID_1
#define Board_DIO12                 IOID_12
#define Board_DIO15                 IOID_13
#define Board_DIO16_TDO             IOID_16
#define Board_DIO17_TDI             IOID_17
#define Board_DIO21                 IOID_21
#define Board_DIO22                 IOID_22

#define Board_DIO23_ANALOG          IOID_23
#define Board_DIO24_ANALOG          IOID_24
#define Board_DIO25_ANALOG          IOID_26
#define Board_DIO26_ANALOG          IOID_26
#define Board_DIO27_ANALOG          IOID_26
#define Board_DIO28_ANALOG          IOID_28
#define Board_DIO29_ANALOG          IOID_29
#define Board_DIO30_ANALOG          IOID_30