Hi,
I am using GNU 4.7.4 Linearo tool chain to build the project,I have ported the SCI driver generated from the halcogen and I am using the same SCI drivers to send(sciSend function) the data through SCI2.but I can see that values sent on the port are not correct.
These SCI driver works fine on TI compiler and I am able to see the correct data being transmitted and I verified in hyperterminal.
I had a look on the other posts on this SCI issue but I couldn't find any solution
Is there any problems after porting the code from TI to GNU tool chain.?
below is the SCI init code,
//Baudrate -9600,8 data bits 1 stop bit
void sciInit(void)
{
/** - bring SCI out of reset */
scilinREG->GCR0 = 1U;
/** - Disable all interrupts */
scilinREG->CLRINT = 0xFFFFFFFFU;
scilinREG->CLRINTLVL = 0xFFFFFFFFU;
/** - global control 1 */
scilinREG->GCR1 = (1 << 25) /* enable transmit */
| (1 << 24) /* enable receive */
| (1 << 5) /* internal clock (device has no clock pin) */
| ((2-1) << 4) /* number of stop bits */
| (0 << 3) /* even parity, otherwise odd */
| (0 << 2) /* enable parity */
| (1 << 1); /* asynchronous timing mode */
/** - set baudrate */
scilinREG->BAUD = 650; /* baudrate */
/** - transmission length */
scilinREG->LENGTH = 8 - 1; /* length */
/** - set SCI pins functional mode */
scilinREG->FUN = (1 << 2) /* tx pin */
| (1 << 1) /* rx pin */
| (0); /* clk pin */
/** - set SCI pins default output value */
scilinREG->DOUT = (0 << 2) /* tx pin */
| (0 << 1) /* rx pin */
| (0); /* clk pin */
/** - set SCI pins output direction */
scilinREG->DIR = (0 << 2) /* tx pin */
| (0 << 1) /* rx pin */
| (0); /* clk pin */
/** - set SCI pins open drain enable */
scilinREG->ODR = (0 << 2) /* tx pin */
| (0 << 1) /* rx pin */
| (0); /* clk pin */
/** - set SCI pins pullup/pulldown enable */
scilinREG->PD = (0 << 2) /* tx pin */
| (0 << 1) /* rx pin */
| (0); /* clk pin */
/** - set SCI pins pullup/pulldown select */
scilinREG->PSL = (1 << 2) /* tx pin */
| (1 << 1) /* rx pin */
| (1); /* clk pin */
/** - set interrupt level */
scilinREG->SETINTLVL = (0 << 26) /* Framing error */
| (0 << 25) /* Overrun error */
| (0 << 24) /* Parity error */
| (0 << 9) /* Receive */
| (0 << 8) /* Transmit */
| (0 << 1) /* Wakeup */
| (0); /* Break detect */
/** - set interrupt enable */
scilinREG->SETINT = (0 << 26) /* Framing error */
| (0 << 25) /* Overrun error */
| (0 << 24) /* Parity error */
| (1 << 9) /* Receive */
| (0 << 1) /* Wakeup */
| (0); /* Break detect */
/** - initialize global transfer variables */
g_sciTransfer[1].mode = 0 << 8;
g_sciTransfer[1].length = 0;
/** - Finaly start SCILIN */
scilinREG->GCR1 |= (1 << 7);
}
main.c
void main(void)
{
sciInit();
sciSend(scilinREG,13,(unsigned char *)"SCI sample");
}