>Greetings: > >Does anyone have any info on manchester encoding and decoding. I have Andy >Warren's "psudo code" from his FFE site, and I found a link that appears to be >"dead" at: http://hobbes.king.ac.uk/matt/pic/manchest.html. > >I want to manchester encode a data stream using 16C84's for a radio link and >any *more* help or pointers would be greatly appreciated. I was obviously >hoping someone has some code they could share . > I don't have any PIC code for you, but you sure brought back some memories for me! That gray matter is very wierd stuff! Manchester Coding There is a transition at the middle of each bit period The transition serves a clocking mechanism and also as data A low to high represents a 1 A high to low transition represents a 0 Widely used in LANs, and open-reel data tape drives A simple diagram of how a byte is encoded: http://www.optimized.com/tech_cmp/manchest.html see also: http://www.erg.abdn.ac.uk/users/gorry/eg3561/phy-pages/man.html and this one: http://knuth.sirti.org/~clark/cs333/Exam1_s97_key.html (and Exam2) The last referance above is VERY good for people who want to know more about physical data encoding! The objective is to mark all changes in bit values, not the actual values of the bits. But, they put a spin on it to avoid a contant tone in the event of a string of 1's or 0's. This much is called NRZ, "non-return-to-zero" coding. To save on the number of cycles, they use a half-cycle of the main tone as their standard period - this is where their brains came in! The reason it's used is to allow you to transmit twice as much data as FSK for a given bandwidth. If you use 1200 hz as your main frequency, you can actually send data at 2400 baud. But, your bandwidth will exceed 1200 hz in the real world (the math gets heavy). It's became popular for use with data tape drives, since it is somewhat tolerant of WOW and flutter induced timing skews. The first use that I saw of Manchester coding was in the "Don Tarbell" cassette interface for S-100 computers, circa 1979 or 1980. Of course, it was used earlier in mainframe tape drives. Both Ethernet and Token Ring networks also use Manchester - again, because of concern about timing skews. Another concern is that they don't have enough time to decode more advanced encoded signals. Manchester gives you twice as much data as FSK, along with the same timing tolerance as FSK. To get mode data into the same bandwidth, you can opt for GCR - Group code recording. Most disk drives use GCR, because disk drives don't have the same WOW and Flutter problems as tapes. Many hackers like myself who wanted to read "protected" floppy disks on the Apple 2 had to learn about GCR encoding. They called it "nybble encoding", and the good copy programs like LockSmith were called "nybble copy" programs. The book "Beneath Apple DOS" explained the coding in detail. To really pack data, you can use quadrature encoding, as in 9600 baud modems (I think 2400 baud modems use Manchester?). A quarter of a sine wave is used to hold 2 bits of data, I believe. Once you go above 9600, the math gets way over my head! For work over radio waves, the newest coding methods include "feed-forward" error-correcting codes (similar to hamming codes). These extra bits allow for error-correction at the other end without the need to retransmit the data. You pay about 20% extra in overhead, but it can be worth it because you save the "turn-around" latency that modern transceivers have. On the HF bands, CLOVER is the best protocol going! It's totally remarkable - it can dig down below the noise level to read the data. I think they even have a Clover+ out now. On VHF and higher, you don't need sophisticated coding methods because there's much less interferance. Simple FSK is the easiest if you can tolerate low speed, or if you have lots of bandwidth. For highest speed and lowest bandwidth, use real modem chips, as is done with ham radio "packet" protocols. Modem chips are usually far better than anything us hardware hackers can do, short of DSP (Clover uses advanced DSP methods). But, the newest modem chips all use DSP now, too! Eric Engler, KC8YB