在线时间0 小时
UID407162
注册时间2012-12-15
NXP金币0
该用户从未签到
中级会员
 
- 积分
- 238
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2013-7-22 10:54:54
|
显示全部楼层
RE:KL15关于串口通讯的问题!!!
串口使用PE初始化,设置如下:
/** ###################################################################
** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : UART1.c
** Project : ProcessorExpert
** Processor : MKL15Z128VFM4
** Component : AsynchroSerial
** Version : Component 02.601, Driver 01.00, CPU db: 3.00.000
** Compiler : IAR ARM C Compiler
** Date/Time : 2013-07-15, 16:33, # CodeGen: 84
** Abstract :
** This component "AsynchroSerial" implements an asynchronous serial
** communication. The component supports different settings of
** parity, word width, stop-bit and communication speed,
** user can select interrupt or polling handler.
** Communication speed can be changed also in runtime.
** The component requires one on-chip asynchronous serial channel.
** Settings :
** Serial channel : UART1
**
** Protocol
** Width : 8 bits
** Stop bits : 1
** Parity : none
** Breaks : Disabled
** Input buffer size : 0
** Output buffer size : 0
**
** Registers
**
** Input interrupt
** Vector name : INT_UART1
** Priority : 0
**
** Output interrupt
** Vector name : INT_UART1
** Priority : 0
**
** Used pins:
** ----------------------------------------------------------
** Function | On package | Name
** ----------------------------------------------------------
** Input | 2 | PTE1/SPI1_MOSI/UART1_RX/SPI1_MISO/I2C1_SCL
** Output | 1 | PTE0/UART1_TX/RTC_CLKOUT/CMP0_OUT/I2C1_SDA
** ----------------------------------------------------------
**
**
**
** Contents :
** RecvChar - byte UART1_RecvChar(UART1_TComData *Chr);
** SendChar - byte UART1_SendChar(UART1_TComData Chr);
** GetCharsInRxBuf - word UART1_GetCharsInRxBuf(void);
** GetCharsInTxBuf - word UART1_GetCharsInTxBuf(void);
**
** Copyright : 1997 - 2012 Freescale, Inc. All Rights Reserved.
**
** http : www.freescale.com
** mail : support@freescale.com
** ###################################################################*/
串口发送数据:
void USART_OUT(uint8_t *Data,uint16_t Len)
{
uint16_t i;
for(i=0; i |
|