Quantcast
Channel: Wireless Connectivity
Viewing all articles
Browse latest Browse all 116964

Forum Post: UART Configuration trouble

$
0
0

Hi All, 

First post, be merciful.   I have CC2540-MINI keyfob setup, IAR 8.20 with 1.3 BLE Stack . My goal is to setup a simple UART communication link.  I studied DN112 to familiarize myself with UART configuration and principles.  I started a new project of existent KeyFob demo project and configured as such:

void serial_init(){
  // Configure UART1 for Alternative 2 => Port P1 (PERCFG.U1CFG = 1)
  PERCFG |= 0x02;
  // P1SEL.SELP1_4/5/6/7 = 1 => CT = P1_4, RT = P1_5, TX = P1_6, RX = P1_7
  P1SEL |= 0xF0;
  // Configure relevant Port P0 pins back to GPIO function
  P0SEL &= ~0x3C;
 
 
  halUARTCfg_t uartConfig;
 
  // configure UART
  uartConfig.configured           = TRUE;
  uartConfig.baudRate             = HAL_UART_BR_115200;
  uartConfig.flowControl          = FALSE;
  uartConfig.flowControlThreshold = 48;
  uartConfig.rx.maxBufSize        = 128;
  uartConfig.tx.maxBufSize        = 128;
  uartConfig.idleTimeout          = 6;
  uartConfig.intEnable            = TRUE;
  uartConfig.callBackFunc         = serialPacketParser;
 
  // start UART
  // Note: Assumes no issue opening UART port.
  HalUARTOpen( HAL_UART_PORT_1, &uartConfig );
}

TX part works flawlessly on P1_6  using HalUARTWrite (DMA mod) function , however I have troubles with the  incoming traffic reception in p1_7. My serialPacketParser callback wouldn't get invoked. I was wondering if someone could shed some light onto this issue.

Thank you very much,

-B


Viewing all articles
Browse latest Browse all 116964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>