TMS570LC43x开发套件的SCI3当作UART使用时,不能发送数据,为什么?
gaoyang9992006:
上个图,我没见过这个开发套件,是不是有什么跳线设置之类的。或者拨码开关之类的,一般开发板会有一些跳线设置,另外这个作为UART是可以接收数据吗?如果可以接收,应该就可以发送
Yabin Li:
回复 喝可乐的马甲:
果然是高手啊!问题已解决,谢谢您的帮助,有问题多联系
mr bryant:
回复 喝可乐的马甲:
tms570lc43xx HDK sic如下配置 ,波特率是多少?串口工具接收到数据乱码?
/** – bring SCI1 out of reset */ sciREG1->GCR0 = 0U; sciREG1->GCR0 = 1U; /** – Disable all interrupts */ sciREG1->CLEARINT = 0xFFFFFFFFU; sciREG1->CLEARINTLVL = 0xFFFFFFFFU; /** – global control 1 */ sciREG1->GCR1 = (uint32)((uint32)1U << 25U) /* enable transmit */ | (uint32)((uint32)1U << 24U) /* enable receive */ | (uint32)((uint32)1U << 5U) /* internal clock (device has no clock pin) */ | (uint32)((uint32)(1U-1U) << 4U) /* number of stop bits */ | (uint32)((uint32)0U << 3U) /* even parity, otherwise odd */ | (uint32)((uint32)0U << 2U) /* enable parity */ | (uint32)((uint32)1U << 1U); /* asynchronous timing mode */ /** – set baudrate */ sciREG1->BRS = 259U; /* baudrate */ /** – transmission length */ sciREG1->FORMAT = 8U – 1U; /* length */ /** – set SCI1 pins functional mode */ sciREG1->PIO0 = (uint32)((uint32)1U << 2U) /* tx pin */ | (uint32)((uint32)1U << 1U); /* rx pin */ /** – set SCI1 pins default output value */ sciREG1->PIO3 = (uint32)((uint32)0U << 2U) /* tx pin */ | (uint32)((uint32)0U << 1U); /* rx pin */ /** – set SCI1 pins output direction */ sciREG1->PIO1 = (uint32)((uint32)0U << 2U) /* tx pin */ | (uint32)((uint32)0U << 1U); /* rx pin */ /** – set SCI1 pins open drain enable */ sciREG1->PIO6 = (uint32)((uint32)0U << 2U) /* tx pin */ | (uint32)((uint32)0U << 1U); /* rx pin */ /** – set SCI1 pins pullup/pulldown enable */ sciREG1->PIO7 = (uint32)((uint32)0U << 2U) /* tx pin */ | (uint32)((uint32)0U << 1U); /* rx pin */ /** – set SCI1 pins pullup/pulldown select */ sciREG1->PIO8 = (uint32)((uint32)1U << 2U) /* tx pin */ | (uint32)((uint32)1U << 1U); /* rx pin */ /** – set interrupt level */ sciREG1->SETINTLVL = (uint32)((uint32)0U << 26U) /* Framing error */ | (uint32)((uint32)0U << 25U) /* Overrun error */ | (uint32)((uint32)0U << 24U) /* Parity error */ | (uint32)((uint32)0U << 9U) /* Receive */ | (uint32)((uint32)0U << 8U) /* Transmit */ | (uint32)((uint32)0U << 1U) /* Wakeup */ | (uint32)((uint32)0U << 0U); /* Break detect */ /** – set interrupt enable */ sciREG1->SETINT = (uint32)((uint32)0U << 26U) /* Framing error */ | (uint32)((uint32)0U << 25U) /* Overrun error */ | (uint32)((uint32)0U << 24U) /* Parity error */ | (uint32)((uint32)1U << 9U) /* Receive */ | (uint32)((uint32)0U << 1U) /* Wakeup */ | (uint32)((uint32)0U << 0U); /* Break detect */ /** – initialize global transfer variables */ g_sciTransfer_t[0U].mode = (uint32)0U << 8U; g_sciTransfer_t[0U].tx_length = 0U; g_sciTransfer_t[0U].rx_length = 0U; /** – Finaly start SCI1 */ sciREG1->GCR1 |= 0x80U;
mr bryant:
回复 mr bryant:
VCLK = 80 Mhz baudrate = 19200 我计算错了,嘻嘻
SZ1:
回复 mr bryant:
所以还是直接拿HalCogen配好哈~~