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 21:12
Read: times


 
#106803 - Parity code
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 15 messages in thread
TopicAuthorDate
Parity code            01/01/70 00:00      
   Not necessarily your problem!            01/01/70 00:00      
      hyperterminal            01/01/70 00:00      
         serial watcher            01/01/70 00:00      
            Serial watcher            01/01/70 00:00      
   as stated in the crossposting            01/01/70 00:00      
      parity even or odd            01/01/70 00:00      
         Rotten program            01/01/70 00:00      
            serial watcher            01/01/70 00:00      
               UART Rx parity (and other errors) on PC            01/01/70 00:00      
   Comparing with google entries            01/01/70 00:00      
      7 bits            01/01/70 00:00      
         7bit ASCII in 8bit frame?            01/01/70 00:00      
            still same problem...            01/01/70 00:00      
               Make the parity check by yourself            01/01/70 00:00      

Back to Subject List