Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Doubt regarding EDK - help needed

Status
Not open for further replies.

vlsi_dst

Junior Member level 1
Joined
May 25, 2008
Messages
18
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,388
Doubt regarding EDK

I am using Xilinx Spartan-3AN starter board and XILINX EDK 9.2i tool.Using MicroBlaze I want to implement a small program. I have selected UART DCE and have taken BRAM as a peripheral.I want to store 5 values into the BRAM through the UART port in a specific address and recall the data in a way that the last entered value should come into the first address and the last but one entered value should come into the second address and so on.I have written the logic for that in C. But i am not able to recollect the values correctly.

Here is the code I have written.

#include "xparameters.h"
#include "xuartlite_l.h"
#include "stdio.h"


int main()
{
int i,j;
Xuint8 data;
Xuint8 temp;

Xuint32 *customLogicPtr;

print("Enter the desired number\r\n");
customLogicPtr = (Xuint32 *)0x84018000;//bram base address is initialised..


for(i=0;i<5;i++)
{
data = XUartLite_RecvByte(0x84000000);
*(customLogicPtr) = data;
xil_printf("%c,%x\r\r\n",data,customLogicPtr);
customLogicPtr++;

}

print (" This is the temporary register...\r\n");
for (i=0,j=4;i<=4;i++,j--)
{
customLogicPtr--;
temp= data[j];
xil_printf("%c,%x\r\r\n",temp,customLogicPtr);

}

print("The entered numbers are ....\r\n");
for(i=0;i<=4;i++)
{
data = temp ;
xil_printf("%c,%x\r\r\n",data,customLogicPtr);
customLogicPtr++;

}
}


My desired output is

If I enter the values as
1,84018000 \\ the address gets generated automatically\\
2,84018004
3,84018008
4,8401800C
5,84018010

then my output should be
5,84018000
4,84018004
3,84018008
2,8401800C
1,84018010

Also I am not able to enter values like 11 or 100 etc i.e 2-digit and 3-digit values.Whatever values i give the system is converting it into ASCII i guess.I am able to enter only a single value i.e numbers from 0 to 9. Can you please rectify my mistake in the program I have written and let me know where I went wrong!!![/code]
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top