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]