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

A N 7 4 6

26

Rev. 0.1

5.4.  Empty Project Structure

An empty project structure can be found along with sample projects on the 

silabs.com

 website for reference. 

The empty project has been created to help users starting to write their custom firmware with preconfigured project
files, common directory structure, and Silicon Labs drivers.
The project follows the convention for directory structure introduced in the sample projects. It contains driver
modules for the radio and MCU peripherals as well as a default MCU initialization procedure.
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 be generated, edited then added to project in order to enable the

vRadio_Init()

 function to initialize the radio chip. The 

vPlf_McuInit()

 shall be modified according to the hardware

used.
The additional header files should be included in the common 

bsp.h

 located in src/drivers directory.

The 

bsp.h

 file already contains included headers:

void

 

main

(

void

)

 

{

 

  

//

 

Initialize

 

the

 

Hardware

 

and

 

Radio

 

  

vInitializeHW

();

 

 
  

while

 

(TRUE)

 

  

{

 

    

//

 

Write

 

your

 

code

 

HERE.

 

  

}

 

}

 

void

 

vInitializeHW

(

void

)

 

{

 

  

//

 

Initialize

 

the

 

MCU

 

peripherals

 

  

vPlf_McuInit

();

 

 
  

//

 

Initialize

 

the

 

Radio

 

  

vRadio_Init

();

 

}

 

Содержание 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...

Отзывы: