Redwire M-12 User's Manual The M-12 module from Redwire is a fast and easy way to create a 6LoWPAN, Zigbee, or general 802.15.4 device without additional RF design or certications and without the need for an external host microcontroller. Features based on the Freescale MC13224v ARM7 Secondary boot ash to facilitate robust microcontroller with 802.15.4 radio 3.6V - 2.1V operating voltage 24MHz, 96kB RAM FCC certication FCC ID: QP0-M12 on-board PCB trace antenna 3dBm output power Integrated Bootloader
(UART1, SPI, or I2C) over-the-air reprogramming 32.768 kHz real time clock crystal includes buck inductor for additional eciency in battery operated applications Mini-card PCIe card edge connector (not PCIe compatible) 48 General purpose I/O pins, 46 with peripheral functions. 6LoWPAN support with the Contiki OS software environment Zigbee support with Freescale BeeKit Specications Dimensions Overall Current Draw Sleep Length:
Width:
Height:
45.1 mm 1.775 in 30.1 mm 1.185 in 6.2 mm in 0.245 Min:
Max:
2 150 uA uA Typical:
3 mA Idle RF TX power Max:
Min:
RX sensitivity 3 dBm
-30 dBm Max:
Min:
-96 dBm
-100 dBm Transmitting
@3dBm:
Receiving Typical:
35 mA Range 24 mA Indoors:
100 Outdoors: 300 ft ft Redwire M12 User Manual 1 Recommended PCB Footprint Suggested connectors:
1.7mm (0.68 in) clearance:
Connector:
JAE Mouser Stando:
JAE Digikey MM60-52B1-
B1-R***
656-
MM60-52B1-
B1-R NT1R3000 670-2481-1-
ND 3.6mm (0.141 in) clearance:
Connector:
Molex Mouser 48338-0065 538-48338-0065 NT1R3000 670-2481-1-
ND Stando:
JAE Digikey Screws:
M2 x 4mm:
McMaster-
Carr 92005A016
(dimensions in mm) Eagle .lbr Redwire M12 User Manual 2 Pinout Number 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 Name ADC0 ADC1 ADC2 ADC3 ADC4 ADC6 TDO TCK U2RTS U2RX U1RTS U1RX I2C_SDA TMR3 TMR1 SCK MISO SSI_BTCK SSI_RX KBI7 KBI5 KBI3 KBI1 RESERVED GPIO43 GND Number 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 Name VREF2H VREF1H VREF1L VREF2L ADC5 ADC7/RTCK TDI TMS U2CTS U2TX U1CTS U1TX I2C_SCL TMR2 TMR0 MOSI SS SSI_FSYN SSI_TX KBI6 KBI4 KBI2 KBI0 GPIO50 RESET VBATT The MC13224v will operate correctly when VBATT is between 3.6V and 2.1V. Applying voltages above 3.6V to any pin could result in permanent damage to the device. GND POWER Ground S1 and S2 are GND or NC Essential Pins Power Pins VBATT POWER 2.1V -
3.6V Redwire M12 User Manual 3 Bootloader Pins Reset INPUT VREF2H VREF2L INPUT INPUT U1RTS INPUT U1TX OUTPUT U1RX INPUT Resets MC13224v External ADC2 reference and internal ash erase UART 1 Ready-to-
send input. UART 1 transmit output. UART 1 receive input. A low voltage on this pin resets the MC13224v. Upon leaving reset, the MC13224v begins execution in the bootloader. Normally VREF2H and VREF2L are the HIGH and LOW references for ADC2 respectively. If, however, VREF2H is LOW and VREF2L is HIGH after reset, then the bootloader will erase the internal ash. This process takes less than 2 seconds to complete. After erasing the ash, the MC13224v must be reset again to perform any other function. If held low on RESET, the bootloader will use UART1 to load a program if there is not a valid image in internal ash. See the Bootloader Appendix in the MC13224v reference manual for more details about programming with UART1. Several software tools exist that can interface with the serial bootloader. mc1322x-load.{pl,c}: simple command-line tools with many programming features. Freescale TestTool: windows based GUI that can only be used to program the internal ash Redwire M12 User Manual 4 The MC13224v has two independent UART peripherals. They only support 8-bit data and can generate any multiple-of-2 baud rate between 1.2 kbaud and 1,843.2 kbaud. Example Code Libmc1322x provides the following examples for using the UARTs:
uart1-loopback.c reads a character from UART1 and echos it back. u1u2-loopback.c mirrors UART1 to UART2. Characters sent to UART1 are then passed along to UART2. Characters received by UART2 are then echoed by UART1. UART 1 & 2 U1RTS INPUT U2RTS INPUT U1CTS OUTPUT U2CTS OUTPUT U1TX U2TX OUTPUT OUTPUT U1RX INPUT U2RX INPUT UART 1 Ready-to-
send UART 1 Ready-to-
send UART 1 Clear-to-
send UART 1 Clear-to-
send UART 1 transmit UART 2 transmit UART 1 receive UART 2 receive Redwire M12 User Manual 5 ADC ADC0-7 VREFH
(1,2) VREFL
(1,2) INPUT INPUT INPUT Analog input Full-scale voltage reference Zero-
scale voltage reference The MC13224v has two independent 12-bit Analog-to-digital converters. They can run up to 300ksamp/sec and can be synchronized. The maximum usable code range is approximately 0 to 3900;
above 3900 and the conversion saturates (at about 200mV below the full-scale reference) Typical gain error is +/- 2.8%
Typical oset error is 8 codes. Interesting Features Absolute Reference: ADC1 contains an extra channel that reads an internal 1.2V reference. By reading this channel, you can solve ADC codes for absolute voltages even when running from an unregulated supply such as batteries. You can also use this as a measure of Vbatt by solving for the absolute voltage of full-scale. Sleep mode monitoring: The ADCs can be congured to continue to sample channels while the CPU core is in low-
power sleep mode. They can be programmed with a high and/
or low comparison value to generate an interrupt and wake the CPU when the voltage has changed. Example Code adc.c reads from all ADC channels and outputs the values to UART1 with printf. Redwire M12 User Manual 6 TMR TMR0-3 INPUT/
OUTPUT Timer /
Capture /
PWM pins KBI KBI0-3 OUTPUT KBI4-7 INPUT Keypad outputs External interrupt inputs SPI MISO MOSI SCK INPUT/
OUTPUT Master In, Slave Out Master Out, Slave In SPI Clock SS INPUT/
OUTPUT INPUT/
OUTPUT INPUT/
OUTPUT Slave Select Redwire M12 User Manual The MC13224v has four 16-bit counter modules that are very congurable. They can be used to create various waveforms as well as measure or trigger from external sources. The counters can share the 4 available external pins and they can also be cascaded. Timer Example tmr-ints.c sets TMR0 up as a periodic interrupt source and toggles an output pin accordingly. PWM Example pwm.c demonstrates PWM function. The MC13224v has four external inputs that can trigger interrupt: KBI4-7. Additionally, these pins can be paired with KBI0-3 to make a 16 switch keypad scanner that operates while the MC13224v is in SLEEP mode; the KBI4-7 can be used to wake-up from SLEEP. For more details about using the KBI pins for low-power wakeup see Section 3.4 Using KBI Signals as Keypad/
Pushbutton Interface of the MC13224v Reference Manual. The SPI controller runs at a maximum of 12 MHz and can be programmed as either a Master or a Slave. Typically SPI is used to interface with external peripheral chips. The SPI controller relieves some computational burden from the CPU when working with such chips. Booting from SPI The M12 can boot over SPI from the external dataash included in the module. The M12 includes a pullup resistor to signal the bootloader to check the external ash for a valid image. If a valid image is present then it will be used. Additionally, the SS pin is multiplexed between the external ash and the card-edge connector. To enable the SS pin on the card-edge connector, GPIO63 must be pulled HIGH. 7 Bit Clock SSI_FSYN SSI_TX INPUT/
OUTPUT Frame Sync Transmit SSI_RX INPUT/
OUTPUT The SSI controller is a fast and exible serial protocol engine. It can be used to interface to CODECS, DSPs, and chips that implement I2S. It can also be congured to do SPI. Its maximum clock rate is 24MHz (2x faster than the SPI controller) and it also has a two 8x24 bit FIFOs for both transmit and receive. SSI SSI_BTCK INPUT/
OUTPUT INPUT/
OUTPUT Receive I2C I2C_SCL INPUT/
OUTPUT Clock I2C_SDA INPUT/
OUTPUT Data JTAG TDO TDI TMS OUTPUT INPUT INPUT TCK INPUT ADC7/
RTCK GPIO GPIO43 GPIO50 OUTPUT INPUT/
OUTPUT INPUT/
OUTPUT Test Data Out Test Data In Test Mode Select Test Clock Adaptive Clock General Purpose only General Purpose only I2C is a simple and ecient two-wire communication interface widely supported by many peripherals. The I2C controller implements all of the features necessary for working which such chips. The JTAG interface can be used to monitor and debug the CPU while it is running. JTAG debugging hardware, such as an FT2232H USB debugger, is connected these pins, and the CPU is controlled via host debugging software such as OpenOCD. OpenOCD provides a debug interface to general code debuggers such as GDB which are in turn, often used by code IDE's such as Eclipse. All of the previously listed pins can also be used as general purpose input and output pins. GPIO43 and GPIO50, have no other special function and can only be used for general purpose input and output. Each GPIO pin has two bits dedicated in the FUNC_SEL register which enables its peripheral function or general purpose function. All GPIO pins have congurable pull-ups or pull-downs, input hysteresis, and retained state in low power mode. Redwire M12 User Manual 8 Buck Controller The M12 module contains all the necessary components to use the integrated buck controller in the MC13224v. This allows for more ecient run time operation for Vbatt voltages above 2.5V. Without the buck controller, Vbatt is regulated to the core voltage of 2.0V by an on-chip LDO regulator. By using a switching buck regulator, the core voltage is generated more eciently. The benets of the buck are lost, however, under 2.5V and it should not be used. For Vbatt = 3.6V, the buck converter reduces power consumption by 15.2%. For Vbatt = 2.5V, the savings are 5.7%. With the Contiki Operating System, control of the buck converter is automatic. The MC13224v will probe for the necessary components and enable the buck if appropriate. Vbatt will also be monitored and the buck will be enabled and disabled accordingly. Sleep Modes The MC13224v has a exible system of sleep modes. The two primary modes are Doze and Hibernate. Doze provides an accurate time base when a 32kHz crystal is not present, but uses signicantly more power. Since the M12 module has a 32kHz on board, Hibernate mode should always be used. Current 2 uA
+ 8 uA
+ 2 uA
+ 2 uA Mode Base hibernate, RAM page 0 retained
+ retain CPU state
+ retain RAM page 1 or 2
+ retain GPIO Note however, that when retaining GPIO state, extra current maybe used depending on what is connected to the GPIO pins. Redwire M12 User Manual 9 SPI Multiplexer The M12 contains a secondary boot ash to facilitate over-the-air reprogramming. This ash is connected to the MC13224v SPI controller. To allow for the M12 user to also use all of the features of the SPI bus, the SS line is multiplexed between the second boot ash and the pin on the card edge connector; a pull down resistor ensures that the secondary ash is selected at boot time. The multiplexer can be switched by driving GPIO63. Application code should drive this pin HIGH if the SS pin is to be used. Redwire M12 User Manual 10