DSPRelated.com
Forums

SPORT for MC45 module

Started by ajax...@yahoo.co.in April 11, 2005

Up dateing The Task

Using the sport0 send an word 'AT' to the modem. The modem has to respond back with an response like 'OK'.
Started on 4/04/2005.

complition on 5/04/2005.

hello every budy.
i wanted to use sport0 for setting the modem of seimens company fpr the GSM use .which uses AT comands.

one simple task

i have an ex code for sport0 for codec but that is not helping me to understand the sport.y bcos the ex is on initialization of the link between SPORT0 on ADSpBF532 AND THE AD1836 stereo Codec.which is done in TDM MODE and Implementing a sample talk-through.

according to my requriment can u help .

using sport0 i have to transmit an word called 'AT' to modem ,this modem will respond automatically back with an relpy 'OK', on Terminal.as it is already connceted sport0 to modem of seimens.

plz any one help me to set this simple thing ,

well i am using ADSPBF532 with Blackfin summit Ice on VisualDSp++ 3.1
can u help me accordingly to above.

just tell me the stepswhich one to intialize for transmiting and receving
and for interrupts .

i have gone thru the sport0 thing but it is not easyas UART i am not able to under stand how to use the status reg of sport and also config reg also.

just help only with this thing and from next time i won't trouble u again. i will be wating for ur reply

MODEM's(MC45 GSM module baud rate 9600)

MODEM's transfer format (num bits, parity, num stop-bits)
num bits 8
partiy none
num stop-bits 1

Specific byte sequence to need to send to MOdule

well specific byte is 'AT' only that bcos to mODEm is workng or not

Specific bytes you need to receive from MODEM

if i Send AT word to it then i need to recive a word 'OK' from the modem

Clock rate info for your Blackfin (XTAL value, PLL settings)

about this i do not know any thing ,as i am very much new to this ADSPBF532 processor.i have no idea at all on XTAL and PLL settings . well i am using ADSPBF532 on balckfin SUmmit ice software is VisualDSP++ 3.1

hello all
i have written an simple program for tranmiting an word thru an sport of BF532 , it is not working ,since i am not able to set the sys clock for sport_tclk ,

importent thing is that , the sport0 of BF532 in hardware connection ,is concceted to hyperterminal along with MC45 GSM module ,
So i have to set baudrate to 9600 and i should see on terminal what ever i send thru sport ,

that is if i send an word "HAI"
this word should bee seen on the hyperterminal ,then only it can b assumed that sport transmision is perfect .
plz someone can go thru this sipmle program and help me to find the solution

#include<stdio.h>
#include<string.h>
#include <cdefbf532.h>
#include <sys/exception.h>
#include <sys/excause.h>
#include <defBF532.h>
volatile int l,i, recevie;

char *a,s[]="AT";
void Init_Sport0(void);
//void Init_Sport0_TX_RX(void);

void main()
{

a=s;
l=strlen(s);

Init_Sport0(); // intilizing sport

for(i =0;i<=l;i++)
{
*pSPORT0_TX=*a;
while (!(*pSPORT0_STAT & TXHRE)) { }; //wait
*pSPORT0_TCR1|=0x0001; //enabling Sport.after checking the TXHRE bit ,
a++;
}

while (!(*pSPORT0_STAT & RXNE)) { }; //wait
*pSPORT0_RCR1|=0x0001; //enabling rceive.
recevie=*pSPORT0_RX;

}// end main void Init_Sport0(void)
{ //int rate,div;
// rate = 2*(div+1) = sysclk/2(div+1);
*pSPORT0_TCLKDIV = (25000000/(2*9600))-1;

//(SYS_CLOCK_FREQUENCY/2*MODEM_BAUD_RATE)) - 1

*pSPORT0_TFSDIV = 0x0009;
*pSPORT0_TCR2 = 0x0009;
*pSPORT0_TCR1 = 0x1612;

*pSPORT0_RCLKDIV = *pSPORT0_TCLKDIV;//same as TCLKDIV
*pSPORT0_RFSDIV = 0x0007;
*pSPORT0_RCR2 = 0x0007;
*pSPORT0_RCR2 = 0x1412;

} //sport tx configuration/*
/* *pSPORT0_TCR1=0x0802; /*
*pSPORT0_TCR2=0x001f; /* this is i written program for intilization of SPort .
*pSPORT0_TCLKDIV = 0x6; /*
/*
//Sport0 rx configuration /*
*pSPORT0_RCR1=0x0000; /*
*pSPORT0_RCR2=0x001f;
*pSPORT0_RCLKDIV = 0x6;*/
/*rate = 2*(div+1) = sysclk/2(div+1)
SPORT TCLKDIV = (SYS_CLOCK_FREQUENCY/(2*MODEM_BAUD_RATE)) - 1
SPORT TFSDIV = 0x0009
SPORT TCR2 = 0x0009
SPORT TCR1 = 0x1613

SPORT_RCLKDIV = same as TCLKDIV
SPORT RFSDIV = 0x0007
SPORT RCR2 = 0x0007
SPORT RCR2 = 0x1413*/