Other Parts Discussed in Thread: MSP430F5438A
I wanted to share my experience with implementing Manchester encoding/decoding on the MSP430 (specifically MSP430F5438A) because a brief search on the forums didn't fill me with confidence that it would be possible. I achieved rates of 1Mbit/s (target for my application) by using SPI & DMA modules for Encode and Timer & DMA modules for decode. This is necessary as an interrupt based solution only leaves a few clock cycles for processing (i.e. filling buffers - very tight, and leaves nothing for background tasks in the MCU) + lower power as CPU is off whilst encoding/decoding. I achieved 500uA on an evaluation board - so can probably be lower power with custom board and correct IO assignments, MCU sits in LPM0. (CPU MCLK = 25MHz).
Manchester Encoder:
- In a RAM Buffer store either 0xF0 or 0x0F corresponding to 0 or 1 - the data changes twice as faster as the clock
- Use the SPI module (MOSI output)
- The SPI port needs to transmit the above bit/symbol at 1Mbit/s therefore SPI port is configured to run at 8MHz to achieve the 1Mbit/s line rate.
- Use a DMA channel to ensure no gaps appear between the bit symbols
- Fill the buffer with the symbols you want and trigger by toggling the SPI_TXIFG flag.
Manchester Decoder:
- Use Timer mode in capture mode to trigger on rising and falling edges.
- Configure DMA to transfer timer values on triggers into RAM
- Once packet received (use DMA counter register) study the timer values to determine if the symbol is a zero or a one (delta = T or T2)
I have found the MSP430 to be very flexible - just have to think through applications to find the right architecture.
