.

QuickBuilder
for Microchip PICs

Home - About- Consulting* - Articles - FAQs - Contact
Tour - Application Example - Sub circuits - Projects - Download
Sub-circuits: Communications
A Sub-circuit is a stand alone circuit function consisting of a software module and schematic.

AM RF Transponder

Description
Radio frequency transponder based on RF solutions AM-HRRN receiver and AM-RT4 transmitter. Bit rate 2000bps.

Software functions

RF data transponder based on the RF Solutions 
licence exempt AM-HRRN-xxx receiver module and 
AM-RT4-xxx transmitter module, where xxx is 
the operating frequency of the module. These 
modules are capable of data rates of 2000bps. 
The actual data rate is less (approx. 800bps) 
due to the necessary encoding (Manchester encoding)

The transponder may have any ID in the 
range 0-15 and can be implemented as a slave 
or a master. RFX_RDO() is called at regular
intervals (<50us) when data is expected to 
arrive. RFX_RNOTIFY indicates when data has 
arrived and at what location in RFX_DATA[] it 
was written.

General Functions
-----------------
RFX_REMOTE      : remote transponder ID (0-15)
RFX_LOCAL       : local transponder ID (0-15)


Transmit Functions
------------------
RFX_TSTART(addr): start trasmission to 
transponder RFX_REMOTE and set to write 
from location addr.

RFX_TSENDDATA(data) : send and write 
data to transponder, auto
increment addr.

void RFX_TSTOP() : send end of frame 
and stop transmitting.
transmitting

Example:
  RFX_REMOTE = 5;  // set ID of remote to send to
  RFX_TSTART(0);   // start transmission/set data address
  RFX_TSENDDATA(x);// data x to remote and auto inc address
  RFX_TSENDDATA(y);// data y to remote and auto inc address
  RFX_TSTOP();     // end transmission

Receive Functions
-----------------
RFX_RDO()        : services receive data. call at 
regular intervals (<50us)

RFX_RON()        : power up reciever. (1.5s power up time)
RFX_ROFF()       : power down reciever.
RFX_RDATA[]      : received data
RFX_RADDR        : data index
RFX_RNOTIFY      : 2=data write event, 0=no event
notifies data arived event. cleared by user.

RFRX_RINCOMING() : returns true if start of
data anticipated.

Example:
  while ( !RFX_RNOTIFY )
      RFRX_DO();

  if (RFX_RNOTIFY==2) {
      ...
      mydata = RFX_RDATA[ RFX_RADDR ];     
      ...
      RFX_RNOTIFY=0;
  }

Schematic

Projects
This sub-circuit is demonstrated in the following projects:

  • 'RF communications - master transponder' more
  • 'RF communications - slave transponder' more

AM RF Transmitter

Description
Radio frequency transmitter based on RF solutions AM-RT4 transmitter. Use with sub-circuit 'AM RF Receiver'.

Software functions

This transmitter sub-circuit is based on the RF Solutions 
licence exempt, AM-RT4-xxx transmitter module (where xxx 
is the operating frequency of the module). The sub-circuit is 
used in conjunction with the 'AM RX Receiver' sub-circuit. The 
RF Solutions modules are capable of data rates of 2000bps. 
The actual data rate is less (approx. 800bps) due to the 
necessary encoding (Manchester encoding).

The transmitter may address 
up to 256 receivers using 
RFTX_REMOTE.


Functions
----------
RFTX_START(addr): start trasmission to 
transponder RFTX_REMOTE and set 
to write from location addr.

RFTX_SENDDATA(data) : send and 
write data to transponder, auto
increment addr.

void RFTX_STOP() : send end 
of frame and stop transmitting.
transmitting

RFTX_REMOTE      : remote transponder ID (0-255)

Example:
  // set ID of remote to send to
  RFTX_REMOTE = 5;   
  // start transmission/set data address
  RFTX_START(0);     
  // data x to remote and auto inc address
  RFTX_SENDDATA(x);  
  // data y to remote and auto inc address
  RFTX_SENDDATA(y);  
  // end transmission
  RFTX_STOP();       

Schematic

Projects
This sub-circuit is demonstrated in the following projects:

  • 'RF communications - data transmitter' more

 

AM RF Receiver

Description
Radio frequency receiver based on RF solutions AM-HRRN-xxx receiver. Use with sub-circuit 'AM RF Transmitter'.

Software functions

See also sub-circuit 'AM RF Transmitter'
The receiver may have any ID in the
range 0-255. RFRX_DO() is called at regular
intervals (<50us) when data is expected to
arrive. RFRX_NOTIFY indicates when data has
arrived and at what location in RFRX_DATA[] it
was written.

Functions
---------
RFRX_DO() : services receive data. call at
regular intervals (<50us)
RFRX_ON() : power up reciever. (1.5s power up time)
RFRX_OFF() : power down reciever.
RFRX_DATA[] : received data
RFRX_ADDR : data index
RFRX_NOTIFY : 2=data write event, 0=no event,
notifies data arived event. cleared by user.
RFRX_LOCAL : receiver ID (0-255)
RFRX_INCOMING() : returns true if start of
data anticipated.
Example:
while ( !RFRX_NOTIFY )
RFRX_DO();
if (RFRX_NOTIFY==2) {
...
mydata = RFRX_DATA[ RFRX_ADDR ];
...
RFRX_NOTIFY=0;
}

Schematic

Projects
This sub-circuit is demonstrated in the following projects:

  • 'RF communications - addressable data receiver' more

 

I2C slave RAM

Description
I2C Slave mode RAM using SSP module. Use as communications interface for slave I2C PIC.

Software functions

I2CSLRAM_DISABLE() : disables/turns off i2c operation
I2CSLRAM_ENABLE() : enables/turns on i2c operation
I2CSLRAM_SETDADD() : SET i2c 3 bit device address,
defaults to 0 or set at run time.
I2CSLRAM_ADDR : address of last data to read or written
I2CSLRAM_DATA[] : data array, size set at design time
I2CSLRAM_DO() : mandatory - call at regular intervals
to clear error conditions.
I2CSLRAM_UPDATE : 1=read occurred,2=write occured.
cleared by user.

Example:
if ( I2CSLRAM_UPDATE == 2) {
I2CSLRAM_UPDATE = 0; // clear update flag
...
your code here
...
}

Schematic

Projects
This sub-circuit is demonstrated in the following projects:

  • 'LCD Graphics 128x64 display with I2C interface' more...
  • 'I2C slave Multiplexed Display' more...

RS232

Description
RS232 serial transceiver using MAX232

Software functions

RS232_IN()      : receive character
RS232_OUT(c)    : send character c
RS232_INCOMING(): return true if receiving

Schematic

Copyright 2002-2009 Summit Electronics Ltd
www.quickbuilder.co.uk