User manual
mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
379
Manchester Code Library
The mikroPascal PRO for dsPIC30/33 and PIC24 provides a library for handling Manchester coded signals. The
Manchester code is a code in which data and clock signals are combined to form a single self-synchronizing data
stream; each encoded bit contains a transition at the midpoint of a bit period, the direction of transition determines
whether the bit is 0 or 1; the second half is the true bit value and the rst half is the complement of the true bit value
(as shown in the gure below).
Important:
- The Manchester receive routines are blocking calls (Man_Receive_Init and Man_Synchro). This means that
MCU will wait until the task has been performed (e.g. byte is received, synchronization achieved, etc).
- Manchester code library implements time-based activities, so interrupts need to be disabled when using it.
The following variables must be dened in all
projects using Manchester Code Library:
Description: Example:
var MANRXPIN : sbit; sfr; external;
Receive line.
var MANRXPIN : sbit at RF0_bit;
var MANTXPIN : sbit; sfr; external;
Transmit line.
var MANTXPIN : sbit at LATF1_bit;
var MANRXPIN_Direction : sbit; sfr;
external;
Direction of the Receive pin.
var MANRXPIN_Direction : sbit at
TRISF0_bit;
var MANTXPIN_Direction : sbit; sfr;
external;
Direction of the Transmit
pin.
var MANTXPIN_Direction : sbit at
TRISF1_bit;
External dependencies of Manchester Code Library