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.
今天在用fr5989控制IO口时遇到了不知名问题,
是这样的,程序中没有时钟,所以使用的是默认的DCO,可是控制IO口输出电平时却没有任何现象;
代码如下:
#include "driverlib.h" void main(void) { //Stop WDT WDT_A_hold(WDT_A_BASE); GPIO_setAsOutputPin(GPIO_PORT_P1,GPIO_PIN2); GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN2); while(1) { GPIO_setOutputLowOnPin(GPIO_PORT_P1,GPIO_PIN2); for(uint8_t i=0;i<0xff;i++); GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN2); for(uint8_t i=0;i<0xff;i++); } }
最后,把ACLK时钟引脚输出,用示波器也是还没发现有波形输出:
#include "driverlib.h" void main(void) { //Stop WDT WDT_A_hold(WDT_A_BASE); GPIO_setAsOutputPin(GPIO_PORT_P1,GPIO_PIN2); GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN2); GPIO_setAsOutputPin(GPIO_PORT_P5,GPIO_PIN2); GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P5,GPIO_PIN2,GPIO_SECONDARY_MODULE_FUNCTION); while(1) { GPIO_setOutputLowOnPin(GPIO_PORT_P1,GPIO_PIN2); for(uint8_t i=0;i<0xff;i++); GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN2); for(uint8_t i=0;i<0xff;i++); } }
我新手,有谁看出问题所在吗。请教一下