jitter in usbdrvasm16.inc
Posted: Wed Feb 15, 2017 11:48 am
Code: Select all
txBitLoop:
sbrs shift, 0 ;[-3] [7]
eor x1, x4 ;[-2] [8]
out USBOUT, x1 ;[-1] [9] <-- out N <- jitter is here - AZ
ror shift ;[0] [10]
ror x2 ;[1]
It is possible to solve - make bitcnt dependent of data to compensate jitter:
Code: Select all
; calc shift comp pare - 1+4 cycles
ldi bitcnt, 0xFF
EOR bitcnt,shift
andi bitcnt,0x3F
ORI bitcnt,0x20
nop ; AZ
I placed it before
Code: Select all
dec cnt ;[3]
brne txByteLoop ;[4]