English
Language : 

PIC16LF1824T39A_12 Datasheet, PDF (328/418 Pages) Microchip Technology – 20-Pin Flash Microcontrollers with XLP Technology
PIC16LF1824T39A
28.5 Applications
28.5.1 SOFTWARE INITIALIZATION
EXAMPLE 28-1: SAMPLE INITIALIZATION CODE
#define APP_REG_PREFIX 0
#define FREQ_REG_PREFIX 0x18
void sendTxCommand(unsigned char cmd)
{
// The ‘T39A samples data on the rising edge of clock. Clock is idle low.
unsigned char i;
for (i=0; i<8; i++)
{
if (cmd & 0x80)
DATA_OUT = 1;
else
DATA_OUT = 0;
}
}
CTRL_OUT = 1;
NOP();
NOP();
CTRL_OUT = 0;
cmd = cmd << 1;
void TX_Init(void)
{
unsigned char app_high = (T39A_APP_CONFIG & 0x00FF00) >> 8;
unsigned char app_low = (T39A_APP_CONFIG & 0x0000FF);
unsigned char f_upper = (T39A_FREQ_CONFIG & 0x70000) >> 16;
unsigned char f_high = (T39A_FREQ_CONFIG & 0x0FF00) >> 8;
unsigned char f_low = (T39A_FREQ_CONFIG & 0x000FF);
sendTxCommand(APP_REG_PREFIX);
sendTxCommand(app_high);
sendTxCommand(app_low);
sendTxCommand(FREQ_REG_PREFIX | f_upper);
sendTxCommand(f_high);
sendTxCommand(f_low);
return;
}
28.5.2 APPLICATION CIRCUIT
Figure 28-8 describes a sample four-button remote
transmitter application schematic. Table 28-8 contains
its bill of materials. This schematic and bill of materials
is a design suggestion only. Actual component values
will be dependent on implementation parameters.
DS41657A-page 328
Preliminary
 2012 Microchip Technology Inc.