Hi!
That's not that easy to integrate without modifying the libs...
But, that might be something to do anyway, as the soon-to-come family of 
18(L)FxxK42 chips does finally have hardware parity support.
Software implementation in jal could be easily made quite cheap on code space 
and running time if all chips would support a bit toggle assembler command. 

Calculating parity in assembler is quite easy, but people don't like to see 
that in the libs. It would cost about 20 instruction cycles, 20 code words and 
a byte of ram.

So, for the time being I would do it in a readable way which costs about 50 
instruction cycles and about 70 code words:

var byte data
var bit data_bit0 at data:0
var bit data_bit1 at data:1
var bit data_bit2 at data:2
var bit data_bit3 at data:3
var bit data_bit4 at data:4
var bit data_bit5 at data:5
var bit data_bit6 at data:6
var bit data_bit7 at data:7

var bit parity

var bit odd_parity=falseĀ  -- make it true for odd parity

parity=data_bit0 ^ data_bit1 ^ data_bit2 ^ data_bit3 ^ data_bit4 ^ data_bit5 ^ 
data_bit6 ^ data_bit7 ^ odd_parity 

The parity bit needs to be written to the usart hardware before the 
corresponding data byte, which can just be reliably done within the lib. 


      Von: "[email protected]" <[email protected]>
 An: jallib <[email protected]> 
 Gesendet: 9:52 Sonntag, 30.Juli 2017
 Betreff: [jallib] Serial 8 bits and parity BIT
  
Hi, can anyone help me with the routine to transmit via serial with bit 
parity?-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.


   

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to