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.
目前正在调试TMS570LS1227的SCI multi-buffer用法,从规格书中了解到LS1227这个片子的sci具有8个字节的buffer,看用法说明,是说将GCR1中的bit10即mbuf mode位置1,将SCIFORMAT寄存器的bit 16-bit18全部写1就可以实现multi-buffer功能,但是我尝试在HALCOGEN生产的代码中修改这几个bit,可是参数无法修改,如图在sciInit函数中修改,
/** - global control 1 */
sciREG->GCR1 = (uint32)((uint32)1U << 25U) /* enable transmit */
| (uint32)((uint32)1U << 24U) /* enable receive */
| (uint32)((uint32)1U << 10U) /* mbuf mode */
| (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 */
/** - transmission length */
sciREG->FORMAT = ((8U - 1U) | 0x70000U); /* length */
可是函数退出后,读取扫GCR1的bit10仍然为0,FORMAT的值仍然为7.这是为什么?
另外,规格书中没有介绍muti-buffer模式时,怎么读取RD寄存器,是否是在检测到RDY置位后,连续读取RD寄存器?
谢谢!
真是不好意思说了,我调试了半天,scilin已经可以正常发送数据,但是当我把GCR1的MBUF MODE置1之后,
/** - global control 1 */
scilinREG->GCR1 = (uint32)((uint32)1U << 25U) /* enable transmit */
| (uint32)((uint32)1U << 24U) /* enable receive */
| (uint32)((uint32)1U << 10U) /* mbuf mode */
| (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 */
scilinREG->BRS = 520U; /* baudrate */
/** - transmission length */
scilinREG->FORMAT =( 8U - 1U)|(7<<16); /* length */
串口调试助手就接收不到数据了,我翻看了规格书,数据的发送好像就是通过TD寄存器实现
29.5.2.2 Transmitting Data in Multi-Buffer Mode
Multi-buffer mode is selected when the MBUF MODE bit in SCIGCR1 is set to 1. Like single-buffer mode,
you can use the polling, interrupt, or DMA method to write the data to be transmitted. The transmitted data
has to be written to the SCITD registers. SCI waits for data to be written to the SCITD register and
transfers the programmed number of bytes to SCITXSHF to transmit one by one automatically.