cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
2,330 Views
Registered: ‎06-11-2010

tranfering data to ttyUSB0 and then reading it from FPGA using

Hello Everyone I am trying to send data to ttyUSB0 by using some system calls.

here is the code

 

 

#include<fcntl.h>
#include<stdlib.h>
#include<sys/stat.h>
#include<unistd.h>
#include<stdio.h>
#include <termios.h>
#include <sys/signal.h>
#include <sys/types.h>
#include <string.h>

int main(void){
int fd1;
fd1=open("/dev/ttyUSB0",O_RDWR);
printf(" the file discription value is = %d \n\r",fd1);
char buf[40]="Computer System Architecture Group";// this is the string of length 34
write(fd1,buf,34);      
return 1;
}

 

 

now this is throwing data onto  ttyUSB0 . Now in FPGA there is one application running

 

which uses

XUartLite_Recv(&uart,buff,34 );

 

but when i tried to print this " buff " . I am getng unreadable values. 

Can any one please help me.

Thank you

 

Regards,

Abhinav Pundir

Email ID : abhinavpundir@ymail.com

0 Kudos
1 Reply
2,304 Views
Registered: ‎06-11-2010

Re: tranfering data to ttyUSB0 and then reading it from FPGA using

Finally I waz able to send data from the Uart port(ttyUSB0) to the board.

But nobody helped me.

So strange??

 

 

abhinavpundir@ymail.com

Tags (1)
0 Kudos