> Howard Winter wrote: > > Why are you worrying about DC balancing a radio system? > > It simplifies the data slicer. With a little more > sophistication determining the high/low threshold, all you > need is to encounter a high and low "often enough", like > every few bits. The signal from a UART would be sufficient > as long as there were a steady stream of characters. First of all, sorry if this is not the goal of the thread. I've lost the beginning of it, so I can be a little biased from my own problems. As Michael, in my case using the UART in the receiver part of the RF link was a must. As Olin says, more UART speed would be good to make the data slicer and the AGC in the receiver work better without the need of DC balancing, in a steady characters stream. But speeds over 57600bps in an RF link between PIC and a PC would be troublesome In my case, a simple RF datalink, where the importance of losing single packets now and then is not crucial, i just used only those bytes in the 0-255 range that better suited the RF link needs. I sorted the binnary numbers from 0 to 255, including start and stop bits added by the USART, attending several criteria: number of transitions in each code, DC balancing (number of 1's and 0's), number of consecutive equal bits (0's or 1's). There are 70 numbers with 0 DC level (same number of 0's and 1's), and 112 with 1 DC level. I chosen this 70+112=182 bytes, and sorted them by maximum number of consecutive equal bits. Choosing 3 bits maximum, there are 125 bytes. So I got this 125 and added 3 more bytes with 4 consecutive equal bits, but with the most possible transitions 0-1 and 1-0. There would be, of course, other criteria based on the expected noise, range, and error handling. This way I discarded the "worse" 128 values from each byte (losing 1 bit), and ended up with a much more convenient code set to get through the RF link. My first objective was data speed, and this may not be the target of Michael, but this can easily be changed as suited... I made an Excel sheet to make this calculations, but don't know if it is allowed to attach it in a mail in this list, so here goes a link to it: ftp://anonymous@193.144.52.77/pub/Codification.xls Regards, Alvaro Deibe Diaz. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist