![CML Microcircuits CMX649 Application Note Download Page 25](http://html1.mh-extra.com/html/cml-microcircuits/cmx649/cmx649_application-note_2627444025.webp)
CMX649 Wireless Voice Link Design Guide
©
2004 CML Microcircuits
Page 25 of 42
Switch to TX?
f rom RESET or
Audio/RF sense
No
Y es
Switch to RX?
Y es
No
Call
START_RFTX
Call
LEDFLASH
Call
START_RFRX
Figure 8, MAINLOOP Routine
When a byte is ready for transmission, or if a received byte is ready for
microcontroller processing, the USART transmit or receive interrupt will occur and
the firmware will vector to either the RFCHIPTX or RFCHIPRX subroutines. If no
USART interrupts occur, the MAINLOOP routine loops back onto itself.
5.1.6 START_RFTX
When the START_RFTX subroutine is called, the transmit flag bit in the
PROG_FLAGS variable is cleared, the SPI port is primed with 0xAA and the
preamble counter is initialized to 48, which is the number of preamble bytes to be
sent after the transmitter is enabled. The output buffer counter, TORF_CNTR, is
initialized to 84 (counter range is from 83 to 0) and the SET_RF_TX subroutine is
called. When the SET_RF_TX subroutine has finished, the USART0 transmit
interrupt is enabled, and control reverts back to the MAINLOOP routine.
5.1.7 SET_RF_TX
When the “SET_RF_TX” subroutine is called, MICRF505 control register 0x00 is
manipulated to enable transmit operation in synchronous mode. Microcontroller Port
3 is then configured as follows: