TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F280045: F280045芯片LIN端口用作SCI功能,使用查询接受和发送,测试没有数据;驱动配置是否正确?示波器看不到波形。SYSCLK时钟100MHZ

Part Number:TMS320F280045Other Parts Discussed in Thread:C2000WARE

CpuSysRegs.PCLKCR19.bit.LIN_A = 1;

// LIN
Drv_GPIO_SetupPinMux(33, GPIO_MUX_CPU1, 6);//LIN-A RX
Drv_GPIO_SetupPinOptions(33, GPIO_INPUT, (GPIO_PULLUP + GPIO_ASYNC));

Drv_GPIO_SetupPinMux(58, GPIO_MUX_CPU1, 9);//LIN-A TX
Drv_GPIO_SetupPinOptions(58, GPIO_OUTPUT, GPIO_PULLUP);

//Allow write to protected registers
EALLOW;
LinaRegs.SCIGCR0.bit.RESET = 0; //Into reset
LinaRegs.SCIGCR0.bit.RESET = 1; //Out of reset
LinaRegs.SCIGCR1.bit.SWnRST = 0; //Into software reset

//SCI Configurations
LinaRegs.SCIGCR1.bit.COMMMODE = 0; //Idle-Line Mode
LinaRegs.SCIGCR1.bit.TIMINGMODE = 1; //Asynchronous Timing
LinaRegs.SCIGCR1.bit.PARITYENA = 1; //Parity enabled. A parity bit is generated during transmission and is expected during reception
LinaRegs.SCIGCR1.bit.PARITY = 0; //Odd Parity
LinaRegs.SCIGCR1.bit.STOP = 0; //One Stop Bit
LinaRegs.SCIGCR1.bit.CLK_MASTER = 1; //Enable SCI Clock
LinaRegs.SCIGCR1.bit.LINMODE = 0; //SCI Mode
LinaRegs.SCIGCR1.bit.SLEEP = 0; //Ensure Out of Sleep
LinaRegs.SCIGCR1.bit.MBUFMODE = 1; //The multi-buffer mode is enabled.
LinaRegs.SCIGCR1.bit.LOOPBACK = 0; //External Loopback 0
LinaRegs.SCIGCR1.bit.CONT = 1; //Continue on Suspend

//Set baudrate
LinaRegs.BRSR.bit.M = 8;
LinaRegs.BRSR.bit.SCI_LIN_PSL = 324; //Baud = 9600bps(9600bps)
LinaRegs.BRSR.bit.SCI_LIN_PSH = 0;

LinaRegs.SCIGCR1.bit.RXENA = 1; //Enable RX
LinaRegs.SCIGCR1.bit.TXENA = 1; //Enable TX

LinaRegs.SCIPIO0.bit.RXFUNC = 1; // configure the LINRX and LINTX pins for SCI
LinaRegs.SCIPIO0.bit.TXFUNC = 1;

//Ensure IODFT is disabled
LinaRegs.IODFTCTRL.bit.IODFTENA = 0x0;
//Set transmission length
LinaRegs.SCIFORMAT.bit.CHAR = 7; //Eight bits
LinaRegs.SCIFORMAT.bit.LENGTH = 0; //4 byte 3

LinaRegs.SCIGCR1.bit.SWnRST = 1; //bring out of software reset
//Disable write to protected registers
EDIS;

Green Deng:

你好,我已经收到问题了,需要咨询一下相关工程师,会尽快回复你。

,

Green Deng:

有没有参考过这个例程?

C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f28004x\examples\lin\lin_ex2_sci_loopback.c

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F280045: F280045芯片LIN端口用作SCI功能,使用查询接受和发送,测试没有数据;驱动配置是否正确?示波器看不到波形。SYSCLK时钟100MHZ
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1