Silicon Laboratories Si4012 Скачать руководство пользователя страница 10

A N 7 4 6

10

Rev. 0.1

5.  Sample Projects

Several complete sample projects are provided in the AN746SW.zip file available at 

www.silabs.com

.

5.1.  General Project Structure 

All the sample projects have a unified structure and common driver set. This chapter gives the reader a brief
introduction of the structure of the sample projects. 

5.1.1. Prerequisites

The settings in the sample project files assume that some Silicon Labs or third party software tools are already
installed on the PC where the sample project going to be compiled. The tools need to be installed depends on the
functionality to be used. The following list contains a complete set of such programs:



Silicon Laboratories IDE—

Used to open the preconfigured project files and manage the build process.



Keil C51 v9.0+ 

or

 SDCC v3.0+—

Compilers to use in accordance with the Silicon Laboratories IDE to 

manage build process.



Silicon Labs Flash Programming Utility (optional)—

Needed only if programming outside the Silicon 

Labs IDE is necessary.



Make (optional)—

This tool is needed in case other compiler is used, or the build process takes place 

outside of the SiLabs IDE.

5.1.2. Supported Compilers

The projects come with two SiLabs IDE project file. The one that name ends with “_Keil” contains the settings for
and is appropriate to compile with Keil’s C51 tool chain. The other that ends with “_SDCC” is prepared to use the
SDCC compiler tool chain. Please note, if you use the 2k limited evaluation license for Keil’s C51 compiler, you
may need to unlock it to 4k, as some project's size exceeds the 2k code size limit. 
However, the sample projects can be complied not only with the two mentioned compiler, but with almost any ANSI
C compiler for 8051 architecture with little or no modifications.
Each project already contains a “Makefile” in order to provide an easy and convenient way to compile the code
outside the Silicon Labs’ IDE with the toolchain of choice.
Each sample project described in this document contains a compiled version of the source code in Intel hex format
that is widely supported by a variety of programming and debugging tools. The compiled file in the projects has
been generated using the SiLabs IDE and the Keil C51 tool chain. 

5.1.3. Directory Structure

All sample project has a common directory structure, with separated source and project files in order to ease the
understanding of the individual modules. For every sample project the following directories and files can be found
in the main directory:



bin

—Contains the SiLabs project files for Keil and SDCC compilers and the Makefile if the make tool is 

used instead.



doc

—Doxygen generated documentation based on comments inside the source files in html format.



out

—The outputs of the compilation process come to this folder. After successful compilation, this directory 

contains for example the hex file, the linker output and the OMF file.



src



application



drivers

Directories containing the source files.



Doxyfile

—In this file, the Doxygen documentation generator settings can be found.



Cleanup.bat

—Batch file used to delete all files generated during build process.

Содержание Si4012

Страница 1: ...following operation examples are covered in the programming guide How to configure the Si4012 How to use the Si4012 transmitter for packet transmission in FIFO mode How to measure battery voltage The...

Страница 2: ...that contains an EZRadio IC matching network and pcb antenna The RF output is selectable between the PCB antenna and a 50 SMA output connector via a 0 resistor The boards also have a factory loaded bo...

Страница 3: ...P3 Since JP3 is shorted by a PCB track on the bottom side of the board the user have to cut the track if this feature is used Steps of connecting the platform to a PC Connect an RF Pico Board to the L...

Страница 4: ...C8051F930 that is used on the hardware platforms described in this document The Silicon Laboratories IDE integrates a project manager a source code editor source level debugger and an in system flash...

Страница 5: ...the host configured as master and the Si4012 as slave Both standard 100 kbs and fast 400 kbs modes are supported with 7 bit addressing The device address is 1110000x where x is the R W bit Since shut...

Страница 6: ...AN564 Si4012 Calculator Spreadsheet Usage available at www silabs com The user inputs the required values into the spreadsheet Center frequency Modulation type FSK deviation Total PA power Bit rate a...

Страница 7: ...stant arrays have to be initialized with the defined commands first Here is the corresponding part of the example program arrays initialized with precompiled commands SEGMENT_VARIABLE C_CHIP_CONFIG U8...

Страница 8: ...to the host The host should poll the NIRQ pin or use interrupts NIRQ to get interrupt status The host can then read the interrupt status of the radio with GET_INT_STATUS command that also clears the...

Страница 9: ...f Si4012 is in sensor mode and low battery interrupt is enabled The period and threshold can be set in the LBD_CONFIG property 4 6 Crystal Oscillator Tuning Capacitor When crystal is used the accuracy...

Страница 10: ...license for Keil s C51 compiler you may need to unlock it to 4k as some project s size exceeds the 2k code size limit However the sample projects can be complied not only with the two mentioned compi...

Страница 11: ...shows the software layers and its relations The individual software modules are separated into several source files In the sample projects there is one header file that is included in the source files...

Страница 12: ...o chip This project is the essential core of the following three sample codes CW_Transmit PN9 TX It is primarily responsible for initializing the MCU and RFIC as well It also initializes the Human Mac...

Страница 13: ...upt Finally it enables the MCU related internal interrupts In the main function the SampleCode_Demo_Pollhandler is responsible for several tasks 1 It checks if the Si4012 Pico board is connected to th...

Страница 14: ...AN746 14 Rev 0 1...

Страница 15: ...xt state will execute the user application code 3 SM_STEP2 User application code can be started from this point The state of SM_STEP1 simply configures the chip by calling the Si4012_Configure functio...

Страница 16: ...shortly thereafter To illustrate how to expand the code with dynamic behavior SM_STEP2 provides the user with a clear example of how to use the LCD baseboard push buttons for turning in out the CW tra...

Страница 17: ...llustrate how to expand the code with dynamic behavior SM_STEP2 provides the user with a clear example of how to use the LCD baseboard push buttons for turning in out the PN 9 transmission After start...

Страница 18: ...AN746 18 Rev 0 1...

Страница 19: ...sure error free packet reception The two byte CRC is implemented in the CRC h module by CRC_CalculateCRC16 U8 pbInputData U8 bLengthOfInputData function The Si4012 related functions are implemented in...

Страница 20: ...n added to the project in order to enable the Si4012_Configure function to initialize the radio chip During the configuration the Si4012_SetProperty function will initialize the API properties by send...

Страница 21: ...AN746 Rev 0 1 21 The additional header files should be included in the common bsp h located in the src drivers directory The bsp h file already contains included headers...

Страница 22: ...ponsible for handling the dedicated internal peripherals such as the IO the timers the SPI and the PCA The HMI holds them together so it gives a higher abstraction level to the User Application in for...

Страница 23: ...terval can be calculated from the frequency of the system clock which is generally 24 5 MHz External clock sources can be selected as timer input and moreover the required timing frequency can be adju...

Страница 24: ...n event is always available first amongst the unhandled events HANDLERS Start the push button handler void vHmi_InitPbHandler void Start the Led handler void vHmi_InitLedHandler void Start the Buzzer...

Страница 25: ...zState void vHmi_BuzzHandler void typedef enum _eHmi_BuzzStates eHmi_BuzzOff_c 0x00 Buzz is in off state eHmi_BuzzStdBy_c 0x01 Buzz waits for state change eHmi_BuzzOn_c 0x10 Buzz is in on state eHmi_B...

Страница 26: ...dure The main function in the empty project is as follows User defined init functions should be placed before the while loop The vInitializeHW looks as follows The radio_config h configuration should...

Страница 27: ...d custom configurations to this file radio_hal h Common hardware abstraction layer for both Si446x and Si4455 radio families radio_comm h Common communication layer for both Si446x and Si4455 radio fa...

Страница 28: ...bs hardware platform This may be modified according to the new architecture and hardware spi c spi h The SPI driver module shall be supplied to enable the communication with the radio radio_hal c radi...

Страница 29: ...AN746 Rev 0 1 29 NOTES...

Страница 30: ...th which if it fails can be reasonably expected to result in significant personal injury or death Silicon Laboratories products are generally not intended for military applications Silicon Laboratorie...

Отзывы: