Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
MANCHESTER CODE LIBRARY
The mikroPascal PRO for AVR provides a library for handling Manchester coded sig-
nals. 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 transi-
tion 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 first half is the complement
of the true bit value (as shown in the figure below).
Notes: 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).
Note: Manchester code library implements time-based activities, so interrupts need
to be disabled when using it.
External dependencies of Manchester Code Library
262
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
The following variables
must be defined in all
projects using Sound
Library:
Description: 
Example : 
var MANRXPIN : sbit;
sfr; external;
Receive line.
var MANRXPIN : sbit
at 
PINB.B0;
var MANTXPIN : sbit;
sfr; external;
Transmit line.
var MANTXPIN : sbit
at 
PORTB.B1;
var
MANRXPIN_Direction :
sbit; sfr; external;
Direction of the Receive pin.
var
MANRXPIN_Direction :
sbit at DDRB.B0;
var
MANTXPIN_Direction :
sbit; sfr; external;
Direction of the Transmit pin.
var
MANTXPIN_Direction :
sbit at DDRB.B1;