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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/28/03 19:19
Read: times


 
#57392 - RE: Parity Calculation
Responding to: ???'s previous message
Ray

I hope this helps - basically the PSW does it all for you automatically, you just need to add it onto the the byte before it is sent, don't forget that you have to put your uController into 9bit mode so that there is a gap to actually fit the parity in

here is the code I use

if (TI!=0){
TI = 0; // Now clear it
if (u8TransmitIn != u8TransmitOut){

//this is for even parity
ACC = au8TransmitBuffer [u8TransmitOut++];
TB8 = P; //PSW.P = even parity of ACC //TB8 = ~P; //odd parity
SBUF = ACC;

//this is for no parity
// SBUF = au8TransmitBuffer [u8TransmitOut++];
}

Sorry about the ugly formatting not sure how to cut and paste into this forum while maintaing tabs etc

Marshall Brown

List of 8 messages in thread
TopicAuthorDate
Parity Calculation            01/01/70 00:00      
   RE: Parity Calculation            01/01/70 00:00      
      RE: Parity Calculation            01/01/70 00:00      
         RE: Parity Calculation            01/01/70 00:00      
   RE: Parity Calculation            01/01/70 00:00      
      Formatting for source code            01/01/70 00:00      
         Example Formatted source code            01/01/70 00:00      
            RE: Example Formatted source code            01/01/70 00:00      

Back to Subject List