UART send byte

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

UART send byte

453件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Tue Jul 14 00:01:17 MST 2015
Hello,

I downloaded UART library where for UART send using function:

void Serial_write( uint8_t portNum, uint8_t send)
{
  if ( portNum == 0 )
  {

  /* THRE status, contain valid data */
  while ( !(UART0TxEmpty & 0x01) );
  LPC_UART0->THR = send;
  UART0TxEmpty = 0;/* not empty in the THR until it shifts out */


  }
....


I must send over UART
this array:
{0x55, 0x00, 0x07, 0x07, 0x01, 0x7A, 0xF6, 0x50, 0x00, 0x11, 0x30, 0x06, 0x30, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x2C, 0x00, 0x9C};


And I change function for send:

void Serial_wChar( uint8_t portNum, char send)
{
  if ( portNum == 0 )
  {

  /* THRE status, contain valid data */
  while ( !(UART0TxEmpty & 0x01) );
  LPC_UART0->THR = send;
  UART0TxEmpty = 0;/* not empty in the THR until it shifts out */

  }....


But when I monitoring data with FT232 on my terminal on computer I get failed data, I get something char.
Uart communication working, when I would like send string send normaly.
0 件の賞賛
返信
0 返答(返信)