gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TDMA Phones


From: KarlisFreibergs
Subject: Re: TDMA Phones
Date: Wed, 26 Jun 2002 23:47:16 +0300

Eduardo Spremolla wrote:
> 
> I don't understund, may you mean that checksum must not consider
> sequence number parity bit ?
> the serial port is at 9600,O,8,1 so you don't have the parity bits in
> the buffer you send .
> Can you post the code you modify.
> 
> Thanks
> 
> Eduardo
> 
> On Wed, 2002-06-26 at 08:36, KarlisFreibergs wrote:
> >
> > Im played around with m2bus on nokia 6110 and 7110. I get
> > similar problems
> > Im find out than the sequence number must build with all
> > message bits except checksum odd parity.
> > in this case first or second packet is accepted and answered
> >
> > Karlis Freibergs,Latvia  (forgive me my bad english)
> >
im can only give code for AVR microcontroller therefore im
work not with gnokkii but with standalone microcontroller
but i try to explain:
if you have to send
 0    1     2      3  4  5  6  7  8  9  10 11 12 13    
1F    00    1D     02 00 06 00 01 00 33 64 01 sq cs
pref  dest  source       ln                   
then XOR of bytes 0-11 (51h) and sq number must have odd
parity
   51h=01010001bin
sq 01h=00000001
xor -----------------
       01010000 is is not ok (even count of 1)

   51h=01010001bin
sq 02h=00000010
xor -----------------
       01010011 is is not ok (even count of 1)

   51h=01010001bin
sq 03h=00000011
xor -----------------
       01010010 is is ok (odd count of 1)


try_next_numb:  inc     sq_numb
                lds     r18,length
                ldi     r16,$1F
                ldi     r31,$01         ;output buffer start
                ldi     r30,$00
next_byte:      ld      r0,Z+           ;get byte where point r31,r30 reg pair
and increment pair
                eor     r16,r0
                dec     r18
                brne    next_byte
next_bit:       mov     r0,r16
                eor     r0,sq_numb              ;xor seq number
                clr     r18
parity1s:       sbrc    r0,0                    ;skip increment if bit=0
                inc     r18
                lsr     r0
                tst     r0                      ;is R0=00?
                brne    parity1s                ;if not zero
                sbrc    r18,0                   ;skip next command if in r18 
bit0=0
                rjmp    seq_number_ok
                rjmp    try_next_numb



reply via email to

[Prev in Thread] Current Thread [Next in Thread]