This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM串口发送ADC的数据?

Other Parts Discussed in Thread: TM4C123GH6PM

ADC已经弄好 怎样用串口把数据发给PC?

  • 看官方ADC的例子,就是串口发送AD值给PC的。在TIVA WARE包中。

  • 我是小白,刚开始学这块板子,都是按照datasheet配置寄存器来弄的。我找到例程后复制进来,也把头文件拖进工程文件里了。但是编译出现这样的错误:

    main.c(30): error: #20: identifier "GPIO_PA0_U0RX" is undefined
    GPIOPinConfigure(GPIO_PA0_U0RX);
    main.c(31): error: #20: identifier "GPIO_PA1_U0TX" is undefined
    GPIOPinConfigure(GPIO_PA1_U0TX);

    我把这两段话注释之后,又冒出来这样的错误:

    .\ADC.axf: Error: L6218E: Undefined symbol GPIOPinTypeUART (referred from main.o).
    .\ADC.axf: Error: L6218E: Undefined symbol SysCtlPeripheralEnable (referred from main.o).
    .\ADC.axf: Error: L6218E: Undefined symbol UARTClockSourceSet (referred from main.o).
    .\ADC.axf: Error: L6218E: Undefined symbol UARTStdioConfig (referred from main.o).

    这就相当于我调用的函数 没有一条能用的

    这是我的头文件:

    #include <stdbool.h>
    #include <stdint.h>
    #include "tm4c123gh6pm.h"
    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/debug.h"
    #include "driverlib/fpu.h"
    #include "driverlib/gpio.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/rom.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"

    project那一栏的情况见附件

  • 工程的配置问题,一定是自己配置的工程吧。前一个问题是由于没有进行芯片名称的宏定义,后面的原因是因为头文件路径的问题。新手的话,建议在官方的基础上修改,然后考虑自己配置工程文件。或者你搜索下我以前的帖子,有介绍怎么配置工程文件的。