Hi
I wrote a small program that transfers a file from the
BF533 to an another PC through RS232 using UART.
Attached is the program
#include<stdio.h>
#include <cdefbf533.h>
void main(void)
{
FILE *fptr1;
static char val[]= "C:\Documents and
Settings\Adminstrator\Desktop\testfile.txt";
//static int valdup[]={1,2,3,4,5,6,7,8,9,0};
//valdup[10]= (1,2,3,4,5,6,7,8,9 );
fptr1=fopen(val,"r");
//fptr2=fopen("valdup","rb");
//Starting the transfer through DMA using UART
*pDMA7_PERIPHERAL_MAP=0x7000;//setting up the
UART TX DMA regsiter
*pUART_GCTL=0x1;//enabling the UART Clocks
*pUART_LCR=0x0000;//Reset LCR regsiter
*pUART_IER=0x0003;//enabling the receive and
transmit buffer full interrupt
*pDMA7_CONFIG=0x1000;//enabling autobuffer
mode
*pDMA7_START_ADDR=fptr1;//setting the pointer
to the file as the starting address of the DMA
*pDMA7_X_COUNT0;//setting the count
*pDMA7_X_MODIFY=0x1;//modifying register
*pUART_LCR=0x0083;//enabling 8 bits,1stop
bit,no parity
*pUART_DLL=0x001D;//setting the baud rate
*pUART_DLH=0x0000;
*pDMA7_CONFIG=0x0001;//starting the DMA
transfer
}
1.The program compiles but could not get anything at
the terminal program on the PC.
2.On other hand when the change the the starting addr
of the DMA to val i see charecters on the terminal
(c:\documents....)becoz it points to the string array.
That means it prints the charecters.
3.when i changed the type to static char and tried
sending some integer values but i do not receive any.
4.I tried sending a file of charecters even it does
not work.
Plz suggest me where i m going wrong.
Thank u
Regards
sriram
__________________________________
|