View Single Post
  #4   Spotlight this post!  
Unread 07-12-2006, 09:39
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: 2004 Edubot Serial String Help (TTL in)

Quote:
Originally Posted by Kingofl337
The TTL runs at 115,200bps by default and most GPS devices run at 9600bps. You need to intialize the serial port at 9600 or convert 9600 to 115,200.

I don't know what to change in the code to properly initialize the port for 9600.
If its the BAUD then you will need to open serial_ports.c, and find the Init_Serial_Port_Two;

The current code should look like this:
Code:
void Init_Serial_Port_Two(void)
{
	// Start by initializing the serial port with code 
	// common to receive and transmit functions
	SPBRG2 = BAUD_115200;	// baud rate generator register [251]
							//
	TXSTA2bits.BRGH = 1;	// high baud rate select bit (asynchronous mode only) [248]
							//  0: low speed
							//  1: high speed
							//
You need to change the TXSTA2bits.BRGH to 0, and SPBRG2 = BAUD_9600.

When your finished the code should look like this:
Code:
void Init_Serial_Port_Two(void)
{
	// Start by initializing the serial port with code 
	// common to receive and transmit functions
	SPBRG2 = BAUD_9600;	// baud rate generator register [251]
							//
	TXSTA2bits.BRGH = 0;	// high baud rate select bit (asynchronous mode only) [248]
							//  0: low speed
							//  1: high speed
							//
I haven't tested this code, but I think its correct.
__________________
Eric Haskins KC9JVH