piclist 2001\01\10\131911a >
Thread: yet another algorithm challange
face BY : Dave Bell email (remove spam text)

I've really enjoyed the challanges posted lately, and picked up some good
coding ideas from them. Here is one I had almost decided to do in external
hardware. Maybe some of the gurus here can help me find an efficient way
of doing it in software!

I have a PIC (16F873 or 7) generating a synchronous (clock + data) data
stream through the on-board USART. There are two odd formats I need to
support in feeding out the variable data: Given an input byte, I need to
"stretch" the data bits by 2X or 6X, producing 2 or 6 bytes of output.

For example, in 2X mode, '0xA1' would translate to '0xCC 0x03', or in
6X mode, to '0xFC 0x0F 0xC0 0x00 0x00 0x3F'. I planned on implementing the
conversion so that it output the bytes to a software FIFO that I would
manage, as I pulled bytes out to transmit.

Obviously, a full byte-in, bytes-out lookup table would be horrendously
big and inefficient of RAM or ROM. Bit-by-bit seems like a little slow,
even in ASM (mainly coding in C, but inline ASM or functions where
needed). Possibly a hybrid lookup of bit pairs or quads, but I was getting
all tied up in trying to handle the loops and differential shifting...

I'd very much appreciate any suggestions!

Dave Bell

http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) yet another algorithm challange

month overview.

new search...