Thanks for the link! I had just cobbled up my own decode routine, but I didn't tackle using the bit stream to sync the rate. I just use a 'standard' bit banged serial routine to wait for a sync byte after '1' '0' balanced preamble bytes. Then I decode the buffer. I hope you find your routine (and post it ;-). If anyone is interested in an ugly, fat, second pic project, manchester decode routine: decode ; data starts off stored in temp (rxreg is also used) movlw 0x00 ; start with all 0 movwf rxreg ; temp space for holding output bcf STATUS, C ; make sure carry is cleared btfsc temp, 7 ; check bit bsf STATUS, C ; if set, shift 1 into dest byte rlf rxreg, F bcf STATUS, C ; make sure carry is cleared btfsc temp, 5 bsf STATUS, C rlf rxreg, F bcf STATUS, C ; make sure carry is cleared btfsc temp,3 bsf STATUS, C rlf rxreg, F bcf STATUS, C ; make sure carry is cleared btfsc temp,1 bsf STATUS, C rlf rxreg, W ; store in W for last bit return Les Otter wrote: > > Well, if anyone else is interested, I have found the most useful decoding routines > yet.. > http://www.microchip.com/download/appnote/keeloq/91045a.pdf > It's the "KEELOQ MAnchester Encoding Routines" TB045 document. > Still searching for others.... > > Les > > > -----Original Message----- > > From: James Newton. Admin 3 [mailto:jamesnewton@piclist.com] > > Sent: 20 February 2002 01:55 > > To: LesOtter@saurel.demon.co.uk > > Subject: RE: [PIC]:Manchester encoding/decoding routine examples please > > > > > > Oops! Good point. There is some discussion in the archive at > > http://www.piclist.com/techref/postbot.asp?by=time&id=piclist/1998/03/06/183 > > 030a > > and > > http://www.piclist.com/techref/postbot.asp?by=time&id=piclist/2001/01/02/164 > > 503a > > > > But no code. I looked at rocketaware.com and the US Patent office and > > without much success... you might look through the results for Manchester > > and decode and preamble at the patent office: > > http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetah > > tml%2Fsearch-adv.htm&r=0&p=1&f=S&l=50&Query=manchester+and+decode+and+preamb > > le&d=ft00 > > > > Please consider sharing what you find. > > > > --- > > James Newton, webmaster piclist.com (former Admin #3) > > mailto:jamesnewton@piclist.com > > 1-619-652-0593 VM 1-208-279-8767 FAX > > PIC/PICList FAQ: http://www.piclist.com or .org > > > > > > > > -----Original Message----- > > From: Les Otter [mailto:LesOtter@saurel.demon.co.uk] > > Sent: Tuesday, February 19, 2002 15:55 > > To: jamesnewton@piclist.com > > Subject: RE: [PIC]:Manchester encoding/decoding routine examples please > > Importance: Low > > > > > > James > > Thanks for that, but that's just a code snippet for encoding..not a codec. > > I am now up to speed on what bit translation goes on at each end, but the > > ancoding and decoding of a packet is what I am interested in. > > > > I am still trying to figure out how best to process a preamble header stream > > to sync the bit time to (thereby catering for various bps rates), and adjust > > the sample timer as reception proceeds to account for frequency drift. > > > > I would like to send, say a 32 bit preamble (16 1-0 or 0-1 pairs), followed > > by a header block of say 4 bytes (of 0-0 pairs) - which would signify the > > start of actual data. > > > > Then receive (in Manchester format of course!) two bytes which signifiy the > > length of data packet. Then process the bitstream, adjusting the clock as > > we go. > > > > I think the KEELOQ encoders send a similar pattern, but without the variable > > data packet bytes. > > > > Rgds > > Les > > > > > -----Original Message----- > > > From: pic microcontroller discussion list > > > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of James Newton. Admin 3 > > > Sent: 19 February 2002 23:12 > > > To: PICLIST@MITVMA.MIT.EDU > > > Subject: Re: [PIC]:Manchester encoding/decoding routine examples please > > > > > > > > > source= http://www.piclist.com/postbot.asp?id=piclist\2002\02\19\071218a > > > > > > Manchester codec for PIC's in the FAQ at > > > http://www.piclist.com/techref/microchip/manchester.htm > > > > > > --- > > > James Newton: PICList.com webmaster, former Admin #3 > > > mailto:jamesnewton@piclist.com 1-619-652-0593 phone > > > http://www.piclist.com/member/JMN-EFP-786 > > > PIC/PICList FAQ: http://www.piclist.com > > > > > > -- > > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > > > > > > > > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu