GLK TTL Cannot change baud rate
GLK TTL Cannot change baud rate
GLK24064 rev 2.0 board re-wired for TTL. Writing and Reading Customer Data ('254 / 52 / data' and '254 / 53') at the default 19,200 is no problem. I then send Change Baud Rate Command '240 / 57 / 16' to change to 115,200, send the same Customer Data commands, but I get no communication back from the display (I see no activity on an oscilloscope monitoring the display's transmit line). Change Baud Rate command does not work for any baud rate except 19,200. It's as though the command is not working at all.
> ...make sure that you re-initialize your port to 115200...
If I get your drift, the processor should change baud rate after sending the command.
Here is the actual code, starting at 19,200.
----------------------------------------------
send_Company_Info(); // sends 254 / 52 / "THWING-ALBERT CO"
// I see data on the oscilliscope, so I know it's going out
if( compare_Company_Info() ) // sends 254 / 53, sees same characters back
{
// switch display to 115,200
s[ 0 ] = 254;
s[ 1 ] = 57;
s[ 2 ] = 16;
send_Display_Direct( s, 3 );
// switch microcontroller to 115,200
if( SerialSetRate( SER_C, BR_115200 ) )
{
send_Company_Info(); // sends 254 / 52 / "THWING-ALBERT CO"
// I see data on the oscilliscope, so I know it's going out
if( !compare_Company_Info() ) // sends 254 / 53, expects same characters back
{
retval = 2; // nothing comes back; returns error
}
}
}
If I get your drift, the processor should change baud rate after sending the command.
Here is the actual code, starting at 19,200.
----------------------------------------------
send_Company_Info(); // sends 254 / 52 / "THWING-ALBERT CO"
// I see data on the oscilliscope, so I know it's going out
if( compare_Company_Info() ) // sends 254 / 53, sees same characters back
{
// switch display to 115,200
s[ 0 ] = 254;
s[ 1 ] = 57;
s[ 2 ] = 16;
send_Display_Direct( s, 3 );
// switch microcontroller to 115,200
if( SerialSetRate( SER_C, BR_115200 ) )
{
send_Company_Info(); // sends 254 / 52 / "THWING-ALBERT CO"
// I see data on the oscilliscope, so I know it's going out
if( !compare_Company_Info() ) // sends 254 / 53, expects same characters back
{
retval = 2; // nothing comes back; returns error
}
}
}
Hi,
If you break the code temporarily to check if the display has changed to 115200 baud; ie. instead of sending command 254 / 52 / 16 bytes, send data to display on the screen, like "THWING-ALBERT CO" and see if you get it displayed on the screen.
If you break the code temporarily to check if the display has changed to 115200 baud; ie. instead of sending command 254 / 52 / 16 bytes, send data to display on the screen, like "THWING-ALBERT CO" and see if you get it displayed on the screen.
Raquel Malinis
Design and Development
Matrix Orbital
Design and Development
Matrix Orbital
Try installing manual override and then try the code again.
Maybe, for some reason there is a lock on the baud rate. Please see sections 2.2 and 12.3 of the manual.
Maybe, for some reason there is a lock on the baud rate. Please see sections 2.2 and 12.3 of the manual.
Raquel Malinis
Design and Development
Matrix Orbital
Design and Development
Matrix Orbital
I reset the Data Locks. No luck. To insure the Rabbit RCM3200 microcontroller was changing speed, I measured one data bit; it was approx. 8.6 microseconds, which is the 115.2K bit width. Here's the code I used. It prints company info for the 19,200, but not at 115,200.
(BTW, I have seen this work using Mogd Sharp and RS-232. I then removed the three zero-ohm resistors on the 232 pads and added two jumpers to the TTL pads.)
EDIT: I have used I2C as well without issues.
EDIT: I have tried a new GLK24064; same thing.
----------------------------------
(BTW, I have seen this work using Mogd Sharp and RS-232. I then removed the three zero-ohm resistors on the 232 pads and added two jumpers to the TTL pads.)
EDIT: I have used I2C as well without issues.
EDIT: I have tried a new GLK24064; same thing.
----------------------------------
Code: Select all
static char inBuffer[ 256 ];
static char outBuffer[ 256 ];
void read_Company_Info( void ) {
char s[ 24 ];
int i = 0;
char isDone = 0;
SerialPutcC( 254 );
SerialPutcC( 53 );
delay( 2 );
while( !isDone ) {
if( SerialRecvCountC() ) {
s[ i ] = SerialGetcC();
i++;
delay( 2 );
}
else
isDone = 1;
}
if( i == 16 ) {
printf( "%s\r\n", s );
}
}
void main( void ) {
SerialInitC( BR_19200, // Port and rate
SER_8BITS, SER_IP2, // 8 bits, IP 2
inBuffer, sizeof inBuffer, // Input buffer and size
outBuffer, sizeof outBuffer ); // Output buffer and size
// Uncomment the lines below to remove data locks
// SerialPutcC( 254 );
// SerialPutcC( 203 );
// SerialPutcC( 245 );
// SerialPutcC( 160 );
// SerialPutcC( 0 );
read_Company_Info();
// switch to 115200 baud on the display
SerialPutcC( 254 );
SerialPutcC( 57 );
SerialPutcC( 16 );
SerialSetRate( SER_C, BR_115200 );
read_Company_Info();
for(;;){}
}