Forums

DSP 56F807 EVM SCI sending byte.

Started by skyf...@MIT.EDU April 15, 2005
Hello..

I am start to woking with DSP EVM with flash app.

I want to send more than 8 bytes at once but my teminal just showed 8 bytes.
For example if I send "abcdefghi" then, my terminal just printed out "abcdedfg".

Is there any data limit for the flash app?
Or is there any problem to the my code?

Here's my code

void write_string(char *f)
{
char tx_char;
int i;
int nf;

nf = strlen(f);

tx_cnt = 0;
for(i=0;i<nf;i++)
{
tx_char = f[i];
tx_buffer[tx_cnt++]=tx_char;
}

write(SCI0,tx_buffer,tx_cnt);
}

void main(void)
{
UWord16 SciReadLength;
sci_sConfig SciConfig;

int i;

SciConfig.SciCntl = SCI_CNTL_WORD_8BIT | SCI_CNTL_PARITY_NONE;// | SCI_CNTL_LOOP_NO;
SciConfig.SciHiBit = SCI_HIBIT_0;
SciConfig.BaudRate = SCI_BAUD_115200;

SCI0 = open(BSP_DEVICE_NAME_SCI_0, O_RDWR | O_NONBLOCK, &SciConfig);

if (SCI0 == -1)
{
assert(!"Open/sci0 device failed.");
}

// Set the data format for 8bit charaters
//and clear the read and write buffers
ioctl (SCI0,SCI_DATAFORMAT_EIGHTBITCHARS,NULL);

//Set the Receive Transmit and Exception Callback functions
ioctl (SCI0,SCI_CALLBACK_RX, sciRxCallBack);
//ioctl (SCI0,SCI_CALLBACK_TX, sciTxCallBack);
ioctl (SCI0,SCI_CALLBACK_EXCEPTION, sciExceptionCallBack);

//The SCI Rx CallBack function will be called by the SCI driver after one
// charater is received by setting the read lenght to 1
SciReadLength = 1;
ioctl(SCI0, SCI_SET_READ_LENGTH, &SciReadLength);

//wait for data to be received
//Use hyperterminal to send charaters that will be echoed back by the
//Receive CallBack Function

write_string("START!");

count = 0;

while(1)
{

write_string("abcdefghijk");
for (i = 0; i <5000; i++);
}

return;
}

Best
Myunghee Kim



Check your appconfig.h and if you need more than 8 bytes, say 20, then you
need to add buffer length as follows,

#define SCI0_SEND_BUFFER_LENGTH 20
#define SCI0_RECEIVE_BUFFER_LENGTH 20 JS

> -----Original Message-----
> From: skyforme@skyf... [SMTP:skyforme@skyf...]
> Sent: Friday, April 15, 2005 8:53 PM
> To: motoroladsp@moto...
> Subject: [motoroladsp] DSP 56F807 EVM SCI sending byte.
>
> Hello..
>
> I am start to woking with DSP EVM with flash app.
>
> I want to send more than 8 bytes at once but my teminal just showed 8 bytes.
> For example if I send "abcdefghi" then, my terminal just printed out "abcdedfg".
>
> Is there any data limit for the flash app?
> Or is there any problem to the my code?
>
> Here's my code
>
> void write_string(char *f)
> {
> char tx_char;
> int i;
> int nf;
>
> nf = strlen(f);
>
> tx_cnt = 0;
> for(i=0;i<nf;i++)
> {
> tx_char = f[i];
> tx_buffer[tx_cnt++]=tx_char;
> }
>
> write(SCI0,tx_buffer,tx_cnt);
> }
>
> void main(void)
> {
> UWord16 SciReadLength;
> sci_sConfig SciConfig;
>
> int i;
>
> SciConfig.SciCntl = SCI_CNTL_WORD_8BIT | SCI_CNTL_PARITY_NONE;// | SCI_CNTL_LOOP_NO;
> SciConfig.SciHiBit = SCI_HIBIT_0;
> SciConfig.BaudRate = SCI_BAUD_115200;
>
> SCI0 = open(BSP_DEVICE_NAME_SCI_0, O_RDWR | O_NONBLOCK, &SciConfig);
>
> if (SCI0 == -1)
> {
> assert(!"Open/sci0 device failed.");
> }
>
> // Set the data format for 8bit charaters
> //and clear the read and write buffers
> ioctl (SCI0,SCI_DATAFORMAT_EIGHTBITCHARS,NULL);
>
> //Set the Receive Transmit and Exception Callback functions
> ioctl (SCI0,SCI_CALLBACK_RX, sciRxCallBack);
> //ioctl (SCI0,SCI_CALLBACK_TX, sciTxCallBack);
> ioctl (SCI0,SCI_CALLBACK_EXCEPTION, sciExceptionCallBack);
>
> //The SCI Rx CallBack function will be called by the SCI driver after one
> // charater is received by setting the read lenght to 1
> SciReadLength = 1;
> ioctl(SCI0, SCI_SET_READ_LENGTH, &SciReadLength);
>
> //wait for data to be received
> //Use hyperterminal to send charaters that will be echoed back by the
> //Receive CallBack Function
>
> write_string("START!");
>
> count = 0;
>
> while(1)
> {
>
> write_string("abcdefghijk");
> for (i = 0; i <5000; i++);
> }
>
> return;
> }
>
> Best
> Myunghee Kim > * To <http://docs.yahoo.com/info/terms/>.
>