UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
8,168 Views
Registered: ‎12-06-2007

Re: Very Difficult , Need Aid:- FPGA Not Sending Out Data (UART Problem)U f

Good morning

 

    Are you there? Please help me .

 

 

 

Thank you.

0 Kudos
Explorer
Explorer
7,900 Views
Registered: ‎12-06-2007

Re: Very Difficult , Need Aid:- FPGA Not Sending Out Data (UART Problem)U f

Good evening sir

 

   I need your help. Are you free?

 

How do you do it ? After many months , I am still getting error .
I am not sure how to copy it in the second array at the first place?
Can you please attach the code for me to learn .
The modem output is in the attachment. I need to read the input 1, but it is too lenghty.
Your help is really being appreciated. Please reply to me as soon as possible. 

 

 

Thank you

0 Kudos
Explorer
Explorer
7,877 Views
Registered: ‎04-06-2009

Re: Very Difficult , Need Aid:- FPGA Not Sending Out Data (UART Problem)U f

For a long time I am also not in touch with your Code/Project and also I am bit busy with my ongoing project - so it'll be not possible for me to go through your entire code and give a solution. 1st I'll suggest you to take help from some local guys like your Prof / friends - That'll help you in a better way as you'll come to know where you are doing wrong. Anyway as a backup plan, I am giving you the algo which may help you to come out from the problem -

 

As stated by you, your Global_RX_Buffer (Or what ever array you are using to diplay in LCD) is having different data at different runs:

 

1st Run  - Original_Array = "1|| ||| OK"

2nd Run - Original_Array = "2" || ||| 1 || ||| OK" 

3rd Run  - Original_Array =  "32" || ||| 1 || ||| OK"

 

or So On.....

 

What I understood you want to retrieve the value "1" from the array. To do this as suggested earlier - take a 2nd Array (Second_Array) of same length. Let N is size of the Original_Array then

 

 

char Second_Array[N]; unsigned char End_Ptr; // Considering your array length is less than 255 int i; unsigned char Your_Req_Data_ASCII = 0x00; unsigned char Your_Req_Data_LED = 0x00;

//Initialize the 2nd Array for(i=0;i<N;i++) { Second_Array[i]=0x00;} //Copy ASCII Character & Numeric Value to 2nd Array from Original Array for(i=0, End_PTR=0;i<N;i++) { if((Original_Array[i]>= '0' && Original_Array[i]>= '9') || (Original_Array[i]>= 'a' && Original_Array[i]>= 'z') || (Original_Array[i]>= 'A' && Original_Array[i]>= 'Z')) { Second_Array[End_Ptr++]=Original_Array[i]; } } for(i=End_PTR-1;i>=2;i--) { if((Second_Array[i]="K") && (Second_Array[i-1]="O")) //Checking for OK { //This is the Byte you are looking for. For your eg it should be '1' Your_Req_Data_ASCII = Second_Array[i-2]; //As this is in ASCII so for '1' you will get 0x31 and so on.

//To light up tour LED using GPIO you need to convert it to Binary Your_Req_Data_LED = Your_Req_Data_ASCII - 0x30; //You can also put a check if the data you gat is valid } }

 

 

Shantanu Sarkar
http://www.linkedin.com/pub/shantanu-sarkar/0/33a/335
0 Kudos
Explorer
Explorer
7,865 Views
Registered: ‎12-06-2007

Re: Very Difficult , Need Aid:- FPGA Not Sending Out Data (UART Problem)U f

Good evening,

 

 Thank you for replying to me . I have a major problem. This FPGA's UART are function to receive only 16 bytes. If a string of data (more than 16 bytes) is sent to the FPGA, how can the UART break into pieces and display it? 

  Pls guide me in solving this difficult problem.

 

Thank you.

0 Kudos
Explorer
Explorer
7,862 Views
Registered: ‎04-06-2009

Re: Very Difficult , Need Aid:- FPGA Not Sending Out Data (UART Problem)U f


moraali wrote:

Good evening,

 

 Thank you for replying to me . I have a major problem. This FPGA's UART are function to receive only 16 bytes. If a string of data (more than 16 bytes) is sent to the FPGA, how can the UART break into pieces and display it? 

  Pls guide me in solving this difficult problem.

 

Thank you.


Pl try to use the UART in Interrupt Mode instead of Polling Mode - That will solve your issue.

 

Shantanu Sarkar
http://www.linkedin.com/pub/shantanu-sarkar/0/33a/335
0 Kudos
Explorer
Explorer
7,860 Views
Registered: ‎12-06-2007

Re: Very Difficult , Need Aid:- FPGA Not Sending Out Data (UART Problem)U f

Good evening sir,

 

     thank you for replying to me . Sorry to disturb you. Previously sir replied

 

//========================================================

 

Use Interrupt Mode instead of Polling Mode. Try out some ready examples avialable in Interrupt Mode which where it's receiving 100 Bytes at a time.
 

Shantanu Sarkar
http://www.linkedin.com/pub/shantanu-sarkar/0/33a/335

 

//========================================================

 

    Pls do not get furious . Besides googles , I just want to know where can I get the examples? Can you provide me the link(s) ?

 

 

Thank you

0 Kudos
Explorer
Explorer
7,858 Views
Registered: ‎12-06-2007

Re: Very Difficult , Need Aid:- FPGA Not Sending Out Data (UART Problem)U f

Good evening sir,

 

  About the link(s), can I read your code in this forum when you firstly tried to help me

 

 

Note: I have not configured the UART as STDIO and I am using both the UARTS in Interrupt Mode

.

.

.

I'll apreciate if any one can comment on my code. Normally it is working fine without any  delay. But when I am simultaneously trying to Receive and Transmit huge data then the UART is getting hang. In that case I am taking care with delay funcion.

 

In the Function "XUartLite_Recv" you have to pass the parameter how many byte you want to receive. I am not happy with this as when I am not knowing how many Bytes I am going to receive then its not comfortable in Interrupt Mode. In that case I am setting the parameter to 1 Byte which increasing the overhead.

 

Regards,

Shantanu

 

 

 Pls reply to me as soon as possible .

 

Thank you

0 Kudos
6,471 Views
Registered: ‎11-19-2010

Re: Very Difficult , Need Aid:- FPGA Not Sending Out Data (UART Problem)

HELLO SIR,

 

I have to write the code for sending and receiving bytes of data using xilinx uartlite functions.I can able to use XUartLite_Send function and send the data to the FPGA kit and view that data using RS 232 port  on Hyperterminal. But using XUartLite_Recv i am unable to Receive the bytes of data and then sending through XUartLite_Send function.So pls help me to know  how to use the XuartLite_Recv function with an example

0 Kudos