EmbeddedRelated.com
Forums

help required on SC28C94 Data Transmission

Started by Niranjan podduturi December 15, 2004
Hi,
	we are working with SC28C94 for data communication.
	this IC(SC28C94) we are using in polling mode 
	not in interrupt mode.My main aim is to trasmit
	a single charecter(ie A(0x41) or B(0x42) or  .....) continuously.
	we are giving 8MHz clock from external.
	Here iam sedning my Code

	typedef unsigned long USHORT;
	typedef unsigned int UINT;
	typedef unsigned char UCHAR;


	int main()
	{
	UINT *Tx;
	UINT *Rd_st;
	UINT *Base,*Cmd,*Aux,*Comm;

	Base	= (UINT *)0x10000000;	/* MR0, MR1,MR2  Addr */
	Comm	= (UINT *)0x10000004;	/* CSR  Addr */
	Cmd		= (UINT *)0x10000008;	/* CR   Addr */
	Aux		= (UINT *)0x10000010;	/* ACR  Addr */

	Rd_st	= (UINT *)0x10000004;	/* SR  Addr */
	Tx		= (UINT *)0x1000000C;	/* Tx HOLD  Addr */

	*Base	= 0x07;			/* Even parity ,8 bits/char */
	*Base	= 0x07;			/* 1 stop bit				*/
	*Comm	= 0x0B;			/*9600 bps					*/
	*Cmd	= 0x06;			/* Tx Enable and Rx Disable */
	*Aux	= 0x00;
	
	while(1)
	{
	while(((*Rd_st)&0x04)==0x00);	/* check TxRdy bit =1 in SR  */
		*Tx	= 0x43;
	}
}

by using the above code , we are recieving the data but junk.
if any one knows about This Quart,please veryfy our code and if
possible suggest any modifications required to getthe exact data.

Thanking You
waiting for your response ASAP.

Niranjan Poddutur,
Sr Software Engg,
ACL,
Hyd,India.
Niranjan podduturi wrote:
> Hi, > we are working with SC28C94 for data communication. > this IC(SC28C94) we are using in polling mode > not in interrupt mode.My main aim is to trasmit > a single charecter(ie A(0x41) or B(0x42) or .....) continuously. > we are giving 8MHz clock from external. > Here iam sedning my Code > > typedef unsigned long USHORT; > typedef unsigned int UINT; > typedef unsigned char UCHAR; > > > int main() > { > UINT *Tx; > UINT *Rd_st; > UINT *Base,*Cmd,*Aux,*Comm; > > Base = (UINT *)0x10000000; /* MR0, MR1,MR2 Addr */ > Comm = (UINT *)0x10000004; /* CSR Addr */ > Cmd = (UINT *)0x10000008; /* CR Addr */ > Aux = (UINT *)0x10000010; /* ACR Addr */ > > Rd_st = (UINT *)0x10000004; /* SR Addr */ > Tx = (UINT *)0x1000000C; /* Tx HOLD Addr */ > > *Base = 0x07; /* Even parity ,8 bits/char */ > *Base = 0x07; /* 1 stop bit */ > *Comm = 0x0B; /*9600 bps */ > *Cmd = 0x06; /* Tx Enable and Rx Disable */ > *Aux = 0x00; > > while(1) > { > while(((*Rd_st)&0x04)==0x00); /* check TxRdy bit =1 in SR */ > *Tx = 0x43; > }
When accessing the MR registers it is a good idea to reset them to the first position before writing to them. I believe *Cmd = 0x1a will reset the MR pointer allowing the next two access to function properly. At least, it works on my SCC2691 Your code will be more correct...do you really need even parity? That seems wierd to me, but then what the heck do I know. T.