Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/07/06 01:01
Read: times


 
#106749 - parity code
Responding to: ???'s previous message
I wrote this code for 89LPC952 processor to send 0x55 character to hyperterminal for 9600,Odd,8,1 as baud rate setting on the hyperterminal.

#include <REG952.H> // register definition

Void main()
{

P1M1 &= ~0x01;
P1M2 |= 0x01;
P1M1 |= 0x02;
P1M2 &= ~0x02;

//The other registers are configured

PCON &= ~0x40;
S0CON = 0xD0; // Mode 3
PCON &= 0x7f;
PCON |= (0 << 8);

// configure baud rate generator
BRGCON_0 = 0x00;
// to generate 9600 Baud rate using internal oscillator
BRGR0_0 = 0xE4;
BRGR1_0 = 0x02;
BRGCON_0 = 0x03;
EA =1;
ACC = 0X55;

for(;;)

{

// Transmit through Serial buffer for odd parity
#pragma asm
PARITY_C: CLR TI_0
CLR TB8_0
JB P,PARITY_OK
SETB TB8_0
PARITY_OK:MOV S0BUF,A
JNB TI_0,$
#pragma endasm


}

}

When hyperterminal is set as 9600,Odd,8,1 the character being received on hyperterminal is 0X55.When I change the configuration on the hyperterminal as 9600,Even,8,1 the characters are not supposed to be received as 0x55.But still the characters are being received as 0x55 irrespective of the parity setting on hyperterminal.
Can anyone explain what is wrong in the code I have written to transmit 0x55 character as 9600,Odd,8,1?



List of 11 messages in thread
TopicAuthorDate
Parity settings in 89LPC952            01/01/70 00:00      
   If the 952 has changed ther meaning of S            01/01/70 00:00      
      Parity 89LPC952            01/01/70 00:00      
         yes            01/01/70 00:00      
            parity            01/01/70 00:00      
               not really            01/01/70 00:00      
                  parity code            01/01/70 00:00      
                     how do you know that the character is in            01/01/70 00:00      
   For Philips            01/01/70 00:00      
      so, REN is ren            01/01/70 00:00      
         Search            01/01/70 00:00      

Back to Subject List