Mikroelektronika MIKROE-350 Fiche De Données
MANCHESTER CODE LIBRARY
The mikroBasic 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).
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.
to be disabled when using it.
External dependencies of Manchester Code Library
247
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
The following variables
must be defined in all
projects using Man-
chester Code Library:
Description:
Example :
dim MANRXPIN as sbit
sfr external
sfr external
Receive line.
dim MANRXPIN as sbit
at PINB.B0
at PINB.B0
dim MANTXPIN as sbit
sfr external
sfr external
Transmit line.
dim MANTXPIN as sbit
at PORTB.B1
at PORTB.B1
dim
MANRXPIN_Direction
MANRXPIN_Direction
as
sbit sfr external
Direction of the Receive
pin.
pin.
dim
MANRXPIN_Direction
MANRXPIN_Direction
as
sbit at DDRB.B0
dim
MANTXPIN_Direction
MANTXPIN_Direction
as
sbit sfr external
Direction of the Transmit
pin.
pin.
dim
MANTXPIN_Direction
MANTXPIN_Direction
as
sbit at DDRB.B1