![Silicon Laboratories RF-to-USB-RD2 Скачать руководство пользователя страница 12](http://html1.mh-extra.com/html/silicon-laboratories/rf-to-usb-rd2/rf-to-usb-rd2_user-manual_1271794012.webp)
R F - t o - U S B - R D 2
12
Rev. 0.2
5.4. Understanding the Project
Examine the user code. One file, mainTxRx.c, contains the user code. Other files contain the code modules from
the ppPhy and do not need to be modified.
The first items called in main.c set the Si1014's DC-DC converter. In this example, the DC-DC converter is used to
step a single-cell battery voltage up to 3.3 V.
void main (void)
{
U8 status;
U8 RxPacketLength;
U8 transmitWord=0;
S16 tmp;
PCA0MD &= ~0x40; // disable watchdog
// Configure DC/DC converter
DC0CN = 0x47; // 20ns min, big SW, 3.3V
DC0CF = 0x04; // Local osc, High-Peak Current
Next, initialization functions for the system clock, ports, and radio serial port are called:
SYSCLK_Init();
PortInit();
SPI1_Init();
Then the radio is initialized by the ppPhy:
status = ppPhyInit();
status = ppPhyInitRadio();
These functions are included in ppPhy.c. Refer to “AN474: Si1000 Code Examples” and “AN440: Si4430/31/32
Register Descriptions” for additional detail.
Next, enable the interrupts and turn on the radio to receive any incoming packets:
EA = 1;
status = ppPhyRxOn();
Once initialized, the firmware loops, checking for either a keypress (requesting a packet to be transmitted) or a
receive flag, indicating a packet in the RX buffer.
For this example, the transmitter increments a variable, transmitWord, loads this in to the TxBuffer, and sends it.
The green LED winks to show the transmission.
while(1)
{
// transmit [1..3] value, incrementing each keypress
if(SW==0)
{
while(SW==0);
TxBuffer[0] = trans+;
if(transmitWord >3)
transmitWord = 1;
LED_GRN = ~LED_GRN;
status = ppPhyTx(64,TxBuffer);
LED_GRN = ~LED_GRN;
}//if TX
Содержание RF-to-USB-RD2
Страница 16: ...RF to USB RD2 16 Rev 0 2 6 PCB Schematics and Layouts Figure 22 Node Schematic ...
Страница 17: ...RF to USB RD2 Rev 0 2 17 Figure 23 Dongle Schematic ...
Страница 19: ...RF to USB RD2 Rev 0 2 19 Figure 27 Node PCB Layout L4 Bottom ...
Страница 20: ...RF to USB RD2 20 Rev 0 2 Figure 28 Dongle PCB Layout L1 Top Figure 29 Dongle PCB Layout L2 ...
Страница 21: ...RF to USB RD2 Rev 0 2 21 Figure 30 Dongle PCB Layout L3 Figure 31 Dongle PCB Layout L4 Bottom ...
Страница 24: ...RF to USB RD2 24 Rev 0 2 DOCUMENT CHANGE LIST Revision 0 1 to Revision 0 2 Content completely revised ...
Страница 25: ...RF to USB RD2 Rev 0 2 25 NOTES ...