Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
恩智浦汽车电子MCU讨论区博客
  • Community Management
  • Archive
  • 中文社区
  • 恩智浦汽车电子MCU讨论区博客
  • Jump...
  • Cancel
恩智浦汽车电子MCU讨论区博客
恩智浦汽车电子MCU讨论区博客 [TRK-KEA使用经验分享] 尝试使用UART
  • Blog
  • 恩智浦汽车电子MCU讨论区博
  • Videos
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • Jump...
  • Cancel
  • New
恩智浦汽车电子MCU讨论区博客 requires membership for participation - click to join
More blogs in 恩智浦汽车电子MCU讨论区博客
  • 恩智浦汽车电子MCU讨论区博客

 

Tags
Actions
  • RSS
  • More
  • Cancel
Related blog posts
Related forum threads

[TRK-KEA使用经验分享] 尝试使用UART

zyd
zyd
November 1, 2015

1.UART:Universal Asynchronous Receiver/Transmitter

2.KEA8板子中用到的UART的结构:

2.1发送器部分结构框图

最上面是只能写入的内部总线,上位机将数据通过该总线写入到Tx Buffer中,然后传入到11bits的发送移位寄存器(11-BIT Transmit Shift Register),11-BIT Transmit Shift Register在波特率时钟的触发下和发送控制器的控制下,从Tx Buffer中取得数据,发送到Tx Pin上。

2.2 接收部分结构框图

3.UART中寄存器的定义

4.TRK-KEA8_Lab1

部分关键代码:

int main(void)
{
  UINT32 counter = 0;
  Clk_Init();       /* Configure clocks to run at 20 Mhz */
  UART_Init();      /*Initialize Uart 0 at 9600 bauds */
  Uart_SetCallback(Uart_Interrupt); /* Set the callback function that the UART driver will call when receiving a char */
  Enable_Interrupt(INT_UART0);    /* Enable UART0 interrupt */

 
for(;;) {   
     counter++;

}

return 0;
}

void Uart_Interrupt (UINT8 data)
{
  Uart_SendChar(data); /* Echos data that is received*/

}

void Enable_Interrupt(UINT8 vector_number)
{

vector_number= vector_number-16;


/* Set the ICPR and ISER registers accordingly */
NVIC_ICPR |= 1 << (vector_number%32);
NVIC_ISER |= 1 << (vector_number%32);

}

使用了UART的callback功能,UART1口收到一个字符。可以通过串口打印工具打印出来来检查争取与否。

5.如何上板?

如何快速使用KEA8开发板执行CodeWarrrior软件中的代码?这方面的资料我没有找到,尝试着通过Lab1中提供的makefile文件来找到图形界面的执行步骤:


first : all
-include ../makefile.init
-include makefile.local

RM := "$(GNU_Make_Install_DirEnv)/rm" -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include Sources/subdir.mk
-include Project_Settings/Startup_Code/subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(ASM_UPPER_DEPS)),)
-include $(ASM_UPPER_DEPS)
endif
ifneq ($(strip $(SX_DEPS)),)
-include $(SX_DEPS)
endif
ifneq ($(strip $(S_DEPS)),)
-include $(S_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables
EXECUTABLES += \
TRK_KEA8_Lab1.elf \

EXECUTABLES_QUOTED += \
"TRK_KEA8_Lab1.elf" \

EXECUTABLES_OS_FORMAT += \
TRK_KEA8_Lab1.elf \

可见:上板前 需要产生一些mk文件、defs文件、elf文件。

还在摸索中。。。。

6.CodeWarrior软件对硬件的要求上板是不是比较高?打开、退出都比较慢,而且使用起来也不如Keil C感觉好,可能是我第一次使用还不习惯吧。

后期弄懂上板调试方法后,就可以开始着手开发申请时的想法了。

Anonymous
恩智浦汽车电子MCU讨论区博客
  • i.MX6-Android User Manual V2.2.pdf

    Grace
    Grace
    i.MX6Q Android manual
    • April 21, 2016
  • 恩智浦汽车电子MCU讨论区简介

    Song Bin 宋斌
    Song Bin 宋斌
    本讨论区是ARM中文社区子版块,专供中国用户使用中文讨论和分享恩智浦公司ARM相关汽车电子技术。                 您可以提问,分享文档,视频,发起投票。       本专区由恩智浦公司和ARM共同维护
    • February 18, 2016
  • [TRK-KEA使用经验分享] 第1篇:安装开发环境

    litx
    litx
    TRK-KEA64 光盘里工具和文档很全,软件安装基本是下一步。CodeWarrior Development Studio(开发工作室)是完整的用于编程应用中硬件bring-up的集成开发环境。 采用CodeWarrior IDE,开发人员可以得益于采用各种处理器和平台(从Motorola到TI到Intel)间的通用功能性。根据Gartner Dataquest的报告,CodeWarrior编译…
    • November 6, 2015