Freescale Semiconductor MC1322x Reference Manual

Simple media access controller

Advertisement

Quick Links

MC1322x Simple Media Access
Controller (SMAC)
Reference Manual
Document Number: 22xSMACRM
Rev. 1.7
09/2011

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MC1322x and is the answer not in the manual?

Questions and answers

Summary of Contents for Freescale Semiconductor MC1322x

  • Page 1 MC1322x Simple Media Access Controller (SMAC) Reference Manual Document Number: 22xSMACRM Rev. 1.7 09/2011...
  • Page 2 Technical Information Center Schatzbogen 7 support or sustain life, or for any other application in which the failure of the Freescale Semiconductor 81829 Muenchen, Germany product could create a situation where personal injury or death may occur. Should Buyer purchase...
  • Page 3: Table Of Contents

    MC1322x SMAC Block Diagram ........
  • Page 4 RadioInit ............. . . 3-27 MC1322x SMAC Reference Manual, Rev. 1.7...
  • Page 5: About This Book

    The MC1322x SMAC is incorporated in the Freescale BeeKit Wireless Connectivity Toolkit. The incorporation of the MC1322x SMAC into BeeKit makes it easier for users to employ and customize the MC1322x SMAC and associated applications. The MC1322x SMAC is not the same SMAC used for the MC1319x and MC1321x. The primary differences are as follows: •...
  • Page 6: Definitions, Acronyms, And Abbreviations

    CodeWarrior IDE and is the product from the linking process. S19 does not contain additional information for a debugger (where to look for source files) Safe Mode Boot The Embedded Bootloader boots up using safe default system values SMAC Simple Media Access Controller MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 7: Mc1322X Smac Introduction

    The MC1322x SMAC is incorporated in the Freescale BeeKit Wireless Connectivity Toolkit. The incorporation of the MC1322x SMAC into BeeKit makes it easier for users to employ and customize the MC1322x SMAC and associated applications, see the MC1322x SMAC Demonstration Applications User’s Guide (22xSMACDAUG) for more information on these applications.
  • Page 8: Available Devices

    MC1322x SMAC Introduction Available Devices The MC1322x family is available as two part numbers. These device types differ only in their ROM contents, all other device hardware, performance, and specifications are identical: • MC13224V - this is the original version and is the generic part type.
  • Page 9: Mcu Resource Requirements

    BeeKit Wireless Connectivity Toolkit, allows users to create, modify, and update various wireless networking implementations. The MC1322x SMAC is released in an independent Codebase that is part of the Freescale BeeKit Wireless Connectivity Toolkit. To create a project for the MC1322x SMAC, users must employ the BeeKit Codebase that contains the MC1322x SMAC code.
  • Page 10 MC1322x SMAC Introduction Figure 1-1. Example Project Folder Structure MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 11: Mc1322X Smac Software Architecture

    MC1322x SMAC Software Architecture This chapter describes the MC1322x SMAC software architecture. The MC1322x SMAC Codebase is different than the S08 targeted SMAC Codebase. BeeKit can use the MC1322x SMAC codebase to create projects to be compiled with the IAR Embedded Workbench IDE.
  • Page 12: Hardware Support

    • Security Enabled • OTAP Enabled An API is implemented in the MC1322x SMAC as a C header file ( ) that allows access to the code. The code includes the API to specific functions. Hardware Support This section describes the MC1322x SMAC hardware support...
  • Page 13: Security Module

    MC1322x SMAC and they are implemented as messages. Energy detection and radio idle time out are also implemented as messages. That is why messages are the core of the MC1322x SMAC and it is important to explain the messages in detail both in how are they structured and how they are processed and interfaced.
  • Page 14: Message Types

    These functions call the Radio Management handle_new_message function. Because the messages are processed by their states, the process_radio_msg function must also be called periodically to run the message state machine. 2.4.1 Message Types The MC1322x SMAC defines four types of messages: • Reception (RX) • Transmission (TX) •...
  • Page 15 MSG_RX_RQST_ABORT, MSG_RX_ABORTED, MAX_MSG_RX_STATE }msg_rx_state_t; Energy Detect typedef enum msg_ed_state_tag{ MSG_ED_RQST = initial_state_c, MSG_ED_PASSED_TO_DEVICE, MSG_ED_ACTION_COMPLETE_SUCCESS, MSG_ED_ACTION_COMPLETE_FAIL, MSG_ED_RQST_ABORT, MSG_ED_ABORTED, MAX_MSG_ED_STATE }msg_ed_state_t; Timeout typedef enum msg_to_state_tag { MSG_TO_RQST = initial_state_c, MSG_TO_PASSED_TO_DEVICE, MSG_TO_ACTION_COMPLETE_SUCCESS, MSG_TO_ACTION_COMPLETE_FAIL, MSG_TO_RQST_ABORT, MSG_TO_ABORTED, MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 16: Message State Machine

    Messages passed to the Radio Management module are in an initial state of “requested”. Then they are commanded to the MACA module in the MC1322x PiP to request that the radio perform the indicated command. Then the Radio Management module processes the messages depending on the MACA interrupts.
  • Page 17: Mc1322X Smac Data Types

    Signed 8 bit definition int16_t Signed 16 bit definition int32_t Signed 32 bit definition Usage These data types are used in the MC1322x SMAC project as well as in the applications projects. They are defined in the file. typedef.h 2.5.1 message_t This type defines a structure to store the messages information.
  • Page 18: Generic Application Code Example

    This section provides a sample generic application code snippet. For details about a specific function see Chapter 3, MC1322x SMAC Primitives. void a_simple_rx_callback_fn (void) message_t a_TX_msg; message_t a_RX_msg; uint8_t dataTX[smac_pdu_size(TX SIZE)]; uint8_t dataRX[smac_pdu_size(RX SIZE)]; uint8_t main() MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 19 This macro reads a message state: get_pmsg_state([pointer to the message]) This macro reads a message buffer: tx_pmsg_payload_buffer([Pointer to the message], [Position in the buffer]) This macro sets a message size: set_pmsg_size([Pointer to the message], [Size in bytes]) MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 20 MC1322x SMAC Software Architecture MC1322x SMAC Reference Manual, Rev. 1.7 2-10 Freescale Semiconductor...
  • Page 21: Mc1322X Smac Primitives

    This is the type defined for general callbacks, that is a function that is that is passed as an argument to other code. It allows the MC1322x SMAC API to call a subroutine (or function) defined in the application layer.
  • Page 22: Core Smac Api

    When the ciphering process success when validating the authentication code value. gFail_c Is the generic (all other failed cases) fail. Core SMAC API This section describes the MC1322x SMAC API functions. 3.2.1 ConfigureBuckRegulator This primitive allows users to enable, disable or bypass the buck regulator. Prototype void ConfigureBuckRegulator(BuckTypes_t BuckRegState);...
  • Page 23: Drvconfigurertc

    Call ConfigureBuckRegulator with the required parameters. NOTE Do not enable the buck regulator when the operating voltage is lower than 2.5 volts. See the MC1322x Reference Manual for more details. 3.2.2 DRVConfigureRTC This primitive allows configuring the Real Time Clock (RTC) to call back a function with a rate defined by the RTC using the indicated reference clock.
  • Page 24: Mlmedozerequest

    == [The TX message].u8Status.msg_state) { MCPSDataRequest([Pointer to the TX message]); 3.2.4 MLMEDozeRequest Doze request allow the user to put the SoC Doze Mode. Review the appropriate MC1322x Reference Manual for details regarding low power modes. Prototype FuncReturn_t MLMEDozeRequest(crmSleepCtrl_t SleepCtl);...
  • Page 25: Mlmeenergydetect

    When the message can be added to the message queue. Usage • Create a message object • Associate a buffer with such message object, this buffer will used to store the energy detect value. Use the macro MSG_INIT MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 26: Mlmegetchannelrequest

    The current RF channel. 0xFF If current channel could not be detected Usage Call MLMEGetPromiscuousMode. 3.2.7 MLMEGetPromiscuousMode This function returns the current state of promiscuous mode. Prototype bool_t MLMEGetPromiscuousMode(void); Arguments None. MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 27: Mlmegetrficversion

    3.2.9 MLMEHibernateRequest This call places the radio into Hibernate mode. Refer to the MC1322x Reference Manual for more information on the operation modes. This low power mode retains the 96Kb of RAM. If no fail is returned, gSuccess_c is returned after the system wakes up.
  • Page 28: Mlmelinkquality

    LQi(dbm) = (LQI(dec)/3)-100 Eqn. 3-1 Prototype FuncReturn_t MLMELinkQuality (uint8_t * u8ReturnValue); Arguments u8ReturnValue A pointer to a 8 bit value where the LQI value will be stored. Returns gSuccess_c This function always return gSuccess_c. MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 29: Mlmepaoutputadjust

    1322x-SRB (dBm) Lock Mode 0x00 -30 dBm 0x01 -28 dBm 0x02 -27 dBm 0x03 -26 dBm 0x04 -24 dBm 0x05 -21 dBm 0x06 -19 dBm 0x07 -17 dBm 0x08 -16 dBm MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor...
  • Page 30: Mlmephyresetindication

    MLMEPHYSoftReset The MLMEPHYSoftReset function is called to perform a soft reset to the SoC. This function differs from previous SMAC where just the radio is reset. Prototype void MLMEPHYSoftReset(void); Arguments None MC1322x SMAC Reference Manual, Rev. 1.7 3-10 Freescale Semiconductor...
  • Page 31: Mlmephyxtaladjust

    None Usage Simply calls the MLMEPHYSoftReset () function directly. NOTE This function resets the complete MC1322x PiP. The behavior is the same as a power on reset. 3.2.14 MLMEPHYXtalAdjust This function adjusts the external oscillator supply by a trim value. For more information about the trim value, see the MC1322x Reference Manual and Data Sheet.
  • Page 32: Mlmerxdisablerequest

    Use zero value for receive without a timeout. The timeout value is given in MACA CLK ticks. If this is a 250 KHz frequency, then each count on the Timeout value represents 4 micro seconds. MC1322x SMAC Reference Manual, Rev. 1.7 3-12 Freescale Semiconductor...
  • Page 33: Mlmescanrequest

    This function scans the predefined channels and stores the scanned Energy Detect value on every channel. Energy detect values range from 0x00 to 0xFF 0x00 The channel has practically no activity 0xFF The channel has heavy traffic and is very busy MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor 3-13...
  • Page 34: Mlmesetchannelrequest

    If a correct channel between gChannel11_c to gChannel26_c is requested. gFailNoValidCondition_cIf trying to set gChannel26_c while external PA is configured. gFailOutOfRange_c If the value passed is not between gChannel11_c to gChannel26_c. MC1322x SMAC Reference Manual, Rev. 1.7 3-14 Freescale Semiconductor...
  • Page 35: Mlmesetpromiscuousmode

    (the flags that indicate each one of the options are: gTimerWuEn_c, gRTCWuEn_c and gExtWuKBI_c). u8KBIPol This argument indicates the polarity at KBI which will awake the device. MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor 3-15...
  • Page 36: Mlmetestmode

    MLMETestMode By employing this function, users can execute a test of the radio. Some basic test modes are necessary to help MC1322x SMAC users evaluate their hardware. Test mode implements the following: • Force_idle — Places the radio back into idle mode •...
  • Page 37: Security - Module Api

    AES-128 and supporting three operation modes: • • • For further details about MC1322x Advanced Security Module, refer to the MC1322x Reference Manual. 3.3.1 CipherConfigure The CipherConfigure function sets the key, counter, and cipher mode. Function...
  • Page 38: Cipherengineinit

    CTR and CBC modes. CCM mode combines the CTR mode for protecting the privacy of data and the CBC mode to generate a MAC to protect the data from unauthorized modifications. Figure 3-1. CTR and CBC Ciphering Modes MC1322x SMAC Reference Manual, Rev. 1.7 3-18 Freescale Semiconductor...
  • Page 39: Ciphermsg And Ciphermsgu8

    – Buffer length exceeds the maximum value – Buffer length is not a multiple of 128 bits – Buffer length is zero gFailCorrupted ASM hardware does not respond. gSuccess_c Ciphering action was performed. MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor 3-19...
  • Page 40: Deciphermsg And Deciphermsgu8

    /* Variable declarations */ ctr_value_t Ctr_Value; cipher_key_t CTR_Key; /* Init section */ CipherEngineInit(); Ctr_Value.ctr0 = [32BitsValue]; Ctr_Value.ctr1 = [32BitsValue]; Ctr_Value.ctr2 = [32BitsValue]; Ctr_Value.ctr3 = [32BitsValue]; CTR_Key.key0 = [32BitsValue]; CTR_Key.key1 = [32BitsValue]; CTR_Key.key2 = [32BitsValue]; MC1322x SMAC Reference Manual, Rev. 1.7 3-20 Freescale Semiconductor...
  • Page 41: Otap - Module Api

    This section details the functions required to use the OTAP module from the application. Only one function is currently provided. For more details about how an application uses the OTAP module, see the MC1322x SMAC Demonstration Applications User’s Guide (22xSMACDAUG).
  • Page 42: Otap_Execute

    #endif [Normal application tasks] NOTE The global variable gbOtapExecute controls the execution of the OTAP and this variable is set or reset by OTAP module, it does not write to it. MC1322x SMAC Reference Manual, Rev. 1.7 3-22 Freescale Semiconductor...
  • Page 43: Otap_Init

    RX message between the application and the OTAP module. Returns None Usage OTAP_Init must be called at the end of the initialization section as shown on the following sample code. #if OTAP_ENABLED == TRUE OTAP_Init(&RX_msg); gbOtapExecute = OTAP_ENABLED; #endif MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor 3-23...
  • Page 44: Support Function Api

    MC1322x SMAC Primitives Support Function API This section describes support functions included with the MC1322x SMAC Codebase, accessible through library. For more details about module configuration and these functions, see the MC1322x MC1322x.a Reference Manual (MC1322xRM). 3.5.1 ConfigureRfCtlSignals ConfigureRfCtlSignals the the functionality for RF signals: ANT1, ANT2, TXON and RXON.
  • Page 45: Setedccathreshold

    0x39. 3.5.3 SetComplementaryPAState SetComplementaryPAState enables (argument equals TRUE) or disables (argument equals FALSE) the complementary PA. Prototype void SetComplementaryPAState(bool_t state); Arguments state Enable or disable the complementary PA. Returns None MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor 3-25...
  • Page 46: Setdemulatormode

    If the SetDemulatorMode option is not used, by default, the SMAC uses DCD. Prototype void SetDemulatorMode(DemTypes_t demodulator); Arguments demodulator Chooses the type of demodulator. Returns None Usage Call this function with NCD or DCD, depending on the desired mode. SetDemulatorMode(NCD); MC1322x SMAC Reference Manual, Rev. 1.7 3-26 Freescale Semiconductor...
  • Page 47: Setpowerlevellockmode

    RadioInit(uint32_t u32ClockFreq, uint8_t u8PN, uint32_t u32LoopDiv); Arguments uint32_t u32ClockFreq This is the platform clock frequency set to 24 MHz. uint8_t u8PN Integer value of the reference XTAL| loop divider for synthesizer. uint32_t u32LoopDiv Loop divider frequency. MC1322x SMAC Reference Manual, Rev. 1.7 Freescale Semiconductor 3-27...
  • Page 48 MC1322x SMAC Primitives Returns None Usage Call this function to configure the radio and for low power mode operation. RadioInit(PLATFORM_CLOCK, gDigitalClock_PN_c, u32LoopDiv); MC1322x SMAC Reference Manual, Rev. 1.7 3-28 Freescale Semiconductor...

Table of Contents