Home
MICRF405 User Manual for Development System 315MHz
Contents
1. If 25 frequencies are pre programmed The frequency table still holds 25 entries That is several frequency indexes points to the same frequency refer to Introduction In this mode of operation a Message is sent from the board The message is build of 5 or 26 printable ascii characters e First a character a y indicating the frequency index for the frequency used not the frequency number but the index in a look up table e 2characters BC or 21 characters e m the message is sent from a master e Finally carriage return 0x0D is tx ed as the last byte of the message the payload Micrel Norway Oslo Norway 15 MCRFA065 User Manual for Development System FW v 2 The following procedure is implemented for Link Test LOOP Enter transmit mode on frequency n Transmit Message and CRC checksum Enter power down mode Wait for timer period approx 100msec Use next frequency from a randomly ordered list and repeat END_LOOP Micrel Norway Oslo Norway 16 MCRFA065 User Manual for Development System FW v 2 7 Interface in Simple Byte Transfer Mode In Simple Byte Transfer Mode Interface to the board in the following way Select interface e Insert the 4 jumpers A B C D to select RS232 interface e Remove the 4 jumpers A B C D to select logic levels Connect jumper pins directly to e g a micro controller The board is treated as a DCE
2. and wait for lock detect tristate until modulation starts Flow Chart 9 RFPRG Tx 0 Complete Pattern AL Xx AZ Dib DX 2000 2000 xxx DO PA LDc en 0 and MOD LDc en 0 Enter tx procedure first time after power on and starting to tx 1010 using bitwise interface Screen Capture 2 For RFPRG Tx 0 Complete Micrel Norway Oslo Norway 40 MCRFA065 User Manual for Development System FW v 2 RFPRETX0 Sub E et Do not enter the complete control word Get the value to fill into the Desktop register and make sure PA 0 Bring SEN line active low Start writing from address 0 write 1 byte of the controlword Bring SEN line inactive high Fill frequency dividers Bring SEN line active low asumes SEN has been high long enough i e gt 1fc periode Start writing from address 1 write 11 bytes of the controlword includes VCO Freq setting Bring SEN line inactive high Test if PA should be turned on and wait for lock detect Flow Chart 10 RFPRG Tx 0 Sub Micrel Norway Oslo Norway 41 MCRFA065 User Manual for Development System FW v 2 RFPRG Wait Lock in lock 0 Quit lock 0 detected high 0 No Is LO high Yos Sot flag detected high Is PA LDc en 1 and MOD LDc en 1 fres Initiate for a 1 usec Timeoutt B Repeat until LO stuck ON until Timeout1 or LO detected low LO high until Ti
3. User Manual for Development System FW v 2 12 6 Flow Charts Below flow charts for selected procedures are given These should give the reader an overview still the interested reader is encouraged to look at the source code as well Initiate Firmware Repeat Initiate Main Is DIP1 ON Yes Is DIP2 ON IsDIP20N NO Yes yes L RF Test Mode LINK Test Mode RF Test Mode2 BYTE Transfer Mode I L Until power off Flow Chart 1 Main program Micrel Norway Oslo Norway 34 MCRFA065 User Manual for Development System FW v 2 a S RF Test Mode RFPRG FREQ FOUND FLAG 1 RFPRG Frequency DEF FREQ Is DIP3 on ee Is wen P Is DIP4 on Yes PC Prog Mode RF Test TxCarrier RF Test Tx1010 Flow Chart 2 RF Test Mode LINK Test Modo Is DIP3 on Flow Chart 3 LINK Test Mode Micrel Norway Oslo Norway 35 MCRFA065 User Manual for Development System FW v 2 RF Test Mode2 RFPRG FREQ FOUND FLAG 1 RFPRG Frequency DEF FREQ Is DIP3 on Yes t Is DIP4 on Is DIP4 on Ma Yes Yes RF Tx ASK Packet RF Tx Random Manch RF Tristate Pins Flow Chart 4 RF Test Mode2 BYTE Transfer Mode RFPCK Init Regsi E Is DIP3 on es N Is DIP4 on Is DIP4 on 2 lves RFPCK COMP F
4. observe change in range distance between transmitter and receiver The Transmit 1010 command is found here 2 Tools 2 Commands to Dev Board It is possible to use the firmware pre programmed settings stored in the FLASH program memory or the settings stored in EEPROM for the other modes of operation as well that is not only in PC mode Select FLASH or EEPROM via a command in RF TestBench Tools 2 Commands to Dev Board If EEPROM settings are used in Link Test Mode no frequency hopping will be done only the frequency and control bits stored in EEPROM will be used If EEPROM settings is selected the board can be disconnected from the PC and the different modes of operation can be run and now the settings stored in EEPROM are used To use the pre programmed settings again Enter PC Mode DIP setting described above and give command from RF TestBench Instruct the board to use the FLASH memory as the source where to get the control word from Other possibilities are C Tools 2 Development Board Commands Read out the firmware version number the firmware stored in flash program memory of the micro controller Restart micro controller MCU program like a power on reset Note This does not reset the MICRF405 transmitter chip Reset EEPROM control word settings to default pre programmed settings from firmware Read out the present EEPROM control word Read out the present
5. MICRF405 register values In PC mode the settings entered by the User and stored in EEPROM are always used Micrel Norway Oslo Norway 22 MCRFA065 User Manual for Development System FW v 2 10 Firmware change upgrade The development boards are equipped with a socket for ICSP in circuit serial programming Through ICSP it is possible to download new firmware into the micro controller The download feature is made for use with MPLAB ICD2 from Microchip Connect the development board directly to the ICD2 using the cable from the ICD2 kit Via ICD2 it s possible to step through and debug firmware code as well That is Make your own program download it debug it and run it MPLAB IDE integrated development environment is available for free from Microchip s homepage C compiler must be bought but you do not need it for firmware upgrading that is if you have a new hex file to download How to upgrade firmware xxx hex xxx firmware name skip reading this if you are familiar with ICD2 Connect ICD2 to your PC and to power please refer to ICD2 user manual Connect ICD2 and development board via the standard ICD2 cable Start MPLAB IDE menu selections below refer to the MPLAB IDE program Select Configure gt Select Device gt PIC18F4320 gt OK File gt Import gt xxx hex gt Open Programmer gt Select Programmer gt MPLAB ICD2 Programmer gt Settings gt Power Tab Make sure
6. MICRF405_ 868 define MICRF405_915 12 2 Tools What do you want to do The tools you need depend on your answer to this question Below some suggestions are given If you want to e Open up the source files to get hints ideas to your own program o Any text editor can be used e Control the development board MICRF405 chip by your own external MCU o Make sure the DIP switches are set to Tristate on board MCU mode and connect to the development board header pins then power on the development board e Flash the on board MCU with a new hex file o Install MPLAB IDE free of charge from microchip com o Getand install a MPLAB ICD 2 in circuit debugger programmer This is a box between the PC running MPLAB IDE and the development board Micrel Norway Oslo Norway 25 MCRFA065 User Manual for Development System FW v 2 o Other flash utilities exist as well e Make your own program based on the assembly language o MPLAB IDE This includes an assembler o MPLAB ICD2 Use this to flash the MCU e Make your own program based on the C language o MPLAB IDE and ICD2 as above o C compiler A demo version of MPLAB C18 compiler can be downloaded for free from microchip com Notes on Tools You may get errors warnings messages if you try to compile the included FW This may happen if a new version of the MPLAB and or the C compiler is introduced It is suggested to always use the latest versions but these m
7. OxCC 11001100 The user can change the number of preamble bytes the number of sync bytes the values of the sync bytes number of CRC bytes If from the PC program the User selects to Use the control word from EEPROM several fields are in any case overruled by the firmware when type 2 is used These are e Sync en 1 e Load en 1 e BIT IO en 0 Refer to the MICRF405 data sheet for a detailed description of these fields Micrel Norway Oslo Norway 14 MCRFA065 User Manual for Development System FW v 2 6 Link Test Mode Refer to chapter 5 for a description of Type 1 and Type 2 format DIP switch setting 1 means ON 0 means OFF Combin DIP1 DIP2 DIP3 DIP4 Text 1 1 0 0 0 5 bytes payload Type 1 format compatible with MICRF6x0 2 1 0 0 1 5 bytes payload Type 2 format not compatible with MICRF6x0 3 1 0 1 0 26 bytes payload Type 1 format compatible with MICRF6x0 4 1 0 1 1 26 bytes payload Type 2 format not compatible with MICRF6x0 Use of LEDs LED2 LED3 LED4 Not used in Link Test Mode LEDI On while tx ing a packet In this mode of operation the MICRF405 board is a Master The packet engine in the MICRF405 chip is used If not overruled from the PC program all pre programmed frequencies are used refer to RF Test Modes Enable configuration via PC Automatic hopping between the frequencies is implemented
8. Power target circuit from MPLAB ICD2 is checked Programmer gt Settings gt Program Tab Make sure Allow ICD 2 to select memories and ranges is checked gt OK Identify and press the Reset and connect to ICD button in the main menu field If the Target not found warning pops up repeat steps above Identify and press the Program target device button in the main menu field Wait for programming to finish refer to the Output window and remove the development board from ICD2 e Optional Confirm firmware version via RF TestBench 7 A demo version is available for free Assumes correct drivers for MPLAB ICD are installed when connected to the USB port for the first time your PC should detect the new device and guide you through the installation note 2 drivers will be installed Micrel Norway Oslo Norway 23 MCRFA065 User Manual for Development System FW v 2 11 Changes in this Firmware Version V2 2006 03 03 PKB Included ASK modulation test mode By default MOD LDc is not used for the packet engine The SEN line is kept high a minimum time 1 fc period RFPRG Wait Lock procedure updated RFPRG Enter Tx procedure updated ClkOut en default value 0 In Init Main Always reset USART registers user input will be ignored in RF test modes and Link test When tx1010 or a random pattern uing bit banging Change DATAIN asap after a raising edge of DATACLK MICRF405 samples DATAIN at raising ed
9. Started Before power up of the development board e Get familiar with the inputs outputs refer to Development Board Inputs Outputs e Select mode of operation via DIP switches e IfSimple Byte Transfer Mode is selected Select interface to user data Insert the 4 jumpers DTE RTS DTE CTS DTE RX DTE TX to select RS232 interface Remove the jumpers to select logic level interface connect to e g another micro controller As a first step it is suggested to set the development board in transmit 1010 mode DIP1 2 and 4 ON Use an oscilloscope a spectrum analyzer a MICRF6x0 dev system or your own receiver board to monitor receive the transmitted signals Enter PC mode all DIPs ON and use the PC program RF TestBench to change the frequency output power and bitrate If you are using a development system for the 433 92MHz 868MHz or 915MHz band and you have the corresponding MICRF6x0 development system available you can try the Link Test Mode only DIP1 ON On the MICRF6x0 board make sure DIP1 and DIP4 are ON This will be the Slave Try to increase decrease the distance between the boards and observe LED1 on the MICRF6x0 board LED 1 MICRF6x0 board will be on as long as the link is OK Set the board in Simple Byte Transfer Mode all DIPs OFF Connect it to a PC running HyperTerminal Send characters or text files via the board Note No ARQ is used number of data packets getting through depend
10. This is and should be an asm file When the program is compiled and then flashed into the MCU some EEPROM values are set to their default values Micrel Norway Oslo Norway 31 MCRFA065 User Manual for Development System FW v 2 Name gen c Short description General procedures for use in all types of applications Header file gen h Typical procedures GEN Enable Int void GEN Init Ports void Notes Name main c Short description Main program including initial set up and interrupt vectors Header file Typical procedures Main void Notes Includes all files to make the main program work Name rfpck c Short description RF chip procedures for tx ing packets with a defined format Header file rfpck h Typical procedures RFPCK Tx Packet void Notes Name rfprg c Short description RF chip procedures for programming RF chip Header file rfprg h Typical procedures RFPRG Enter Tx void Notes Micrel Norway Oslo Norway 32 MCRFA065 User Manual for Development System FW v 2 Name usart c Short description USART interface procedures including handshaking Header file usart h Typical procedures USART Output Byte uint8 usart byte USART Init void USART Enable Input From DTE void Notes USART Universal synchronous asynchronous receiver transmitter an on board micro controller module made for serial communication via e g RS232 Micrel Norway Oslo Norway 33 MCRFA065
11. after PA is turned on DATAIN is kept in tristate until modulation starts AL 2 00v 5002 50017 WA Sngl PatSTOP A UO e 5 Pattern AL Xx AZ DIS DX 2000 20000 xxx DO P LDc en 1 and MOD LDc en 0 Enter tx procedure first time after power on and starting to tx 1010 using bitwise interface Screen Capture 1 For RFPRG Tx 1 Complete Micrel Norway Oslo Norway 38 MCRFA065 User Manual for Development System FW v 2 Pa EN RFPRG Tx 1 Sub Do not enter the complete control word Fill frequency dividers into buffer index starts with 1 Get value to fill into desktop register Bring SEN line active low Start writing from address 0 write 12 bytes of the controhword includes VCO Freq setting Bring SEN line inactive high Wait for lock Tx with PA on END Flow Chart 8 RFPRG Tx 1 Sub Micrel Norway Oslo Norway 39 MCRFA065 User Manual for Development System FW v 2 RFPRG Tx 0 Complete A screen capture is shown below Observe e 2 programming sequences SEN going low then high first enter tx with PA off then enter tx with PA on Get the value to fill into the e MCU turns on PA when LD Desktop register and make sure PA 0 Enter the complete control word Sa with PA 0 brought high Clear flag for control word filled Modulation starts when LD goes high after PA is turned Test if PA should be turned on on DATAIN is kept in
12. and number of frequency channels Dev System On the air for frequency Modulation bit rate Manchester Number of band frequencies 315MHz Modulation 1 using 2 sets of dividers 433 92MHz Modulation 4 using 2 sets of dividers 868MHz Modulation 2 using 2 sets of dividers 915MHz Modulation 19231 No 25 using 2 sets of dividers Micrel Norway Oslo Norway MCRF405 User Manual for Development System FW v 2 Note that all development systems for MICRF405 have the same firmware version and all source files are available in a common set of files a Project Outline of this document Following this introduction an overview of the board s inputs outputs is given Then a Get started chapter is included and the different modes of operation are described An overview of how to program update the firmware is also included Finally a list of changes for this firmware version is given as well as a description of the firmware Purpose of the Development system The development system provides hands on experience with the MICRF405 transmitter The user can use the included firmware and hardware or make a new program and flash it into the micro controller That is the user can use the boards both to evaluate the MICRF405 and as an aid in the development of a radio communication system A separate PC program is available Through this program it is possible to set the programming word for the MICRF405 both the frequency divid
13. edd seine ctu eio geales 27 12 5 Source File DesertptlOTis sedeo eln e eei eE o aE oer SUV UN oo 27 12 6 Flow Chart IE PR 34 Micrel Norway Oslo Norway 1 MCRFA065 User Manual for Development System FW v 2 1 Introduction This document MICRF405 User Manual for Development System describes the features of the development system for MICRF405 For details on the MICRF405 transmitter a product in the RadioWire product line Please refer to the appropriate data sheet For the latest updates on products related to RadioWire please visit www micrel com The MICRF405 can be used in several frequency bands Several development systems are made For the e 315MHz band e 433 92MHz band e 868MHz band and e 915MHz band Default frequencies are selected to match the MICRF600 MICRF610 and MICRF620 development systems The MICRF6x0 modules are using a MICRF505 or MICRF506 transceiver chip They can be used to receive the signals transmitted by the MICRF405 development system of course any adequate receiver can be used but the development systems for these modules match the development system for the MICRF405 e For the 433 92MHz band MICRF620 can be used as a receiver e For the 868MHz band MICRF610 can be used as a receiver e For the 915MHz band MICRF600 can be used as a receiver The operation and features of the development system are equal for all frequency bands The main differences are the frequency band bit rate
14. programmed into the FLASH program memory or it will use the control word entered from the PC program and stored in the EEPROM Which one to select the source of the control word is selected in the PC program select Tools Development Board Commands From the PC program try e g to change the output power level PA setting and observe the effect on spectrum power consumption and link range Note If using the PC program to read out the contents of the MICRF405 registers Make sure to have no external load on the SIO and SCK pins or else you might get some unwanted results The EEPROM control word can be used in RF Test Modes Link Test Mode and Simple Byte Transfer Mode If the EEPROM control word is used in Link Test Mode No frequency jumping is done only the user entered control word stored in EEPROM will be used Micrel Norway Oslo Norway 9 MCRFA065 User Manual for Development System FW v 2 Combination 5 Bypass Micro Controller Using this combination it is possible to use an external micro controller to control the RF part Connect to the interface pins as described in Development Board Inputs Outputs The interface pins are connected to the MCU side of the MCU RF connection All I O pins of the on board micro are tristated None of the MCU s IOs are set as output at power on if this combination is selected That is The User has full control without the MCU interactin
15. 8 msec Flow Chart 11 RFPRG_Wait_Lock Micrel Norway Oslo Norway 42 MCRFA065 User Manual for Development System FW v 2 RFPRG Test PA Should PA be turned on No ig Include delay to make sure SEN is high long enough i e gt 1 fc period Assumes fc gt 72kHz fc period 14 usec approx pe No ante on seing Wait for lock Tx with PA off Bring SEN line active low Start writing from address 0 write 1 byte of the controlword Wait for lock Tx with PA off Bring SEN line inactive high Wait for lock Tx with PA on Flow Chart 12 RFPRG Test PA Micrel Norway Oslo Norway 43 MCRFA065 User Manual for Development System FW v 2 RFPCK Tx Packet Make sure RDY line going low will set RBO interrupt flag Set position in output buffer to tx noxt data byte from 1 Packet compatible with MICRF6x0 dev system I RFPCK Out Length Length of Length Payload and CRC To be MICRF6x0 compatible overrule packet engine settings rog0 Sync on 1 Load_en 1 reg12 MOD_LOc_en 0 10913 BIT 10 en 0 Manchester en 0 RFPCK Out Length Length of Payload and CRC Overrule packet engine settings reg0 Sync en 1 Load en 1 rog 3 Sel CRC making CRC in MCU SynclD Len 2 txing 3 sync bytes Pream Len 2 txing 3 preamble bytes reg26 27 28 SynciDi i 2 1 0 OxCC 11001100 Set flag for controlword fillod E
16. Features e Pre programmed frequencies centre RF frequencies i e middle of tx0 and tx1 e 315MHz band 1 frequency f02315 00MHz e 433 92MHZz band 4 frequencies f0 433 43MHz f12433 71MHz f2 434 00MHz f3 434 29 MHz e 868MHz band 2 frequencies f02868 31 MHz f1 868 95MHz e 915MHz band 25 frequencies f0 904 30MHz 12 915 25MHz f24 926 25MHz e Default frequencies used in RF test mode and Simple byte transfer mode Dev System Centre freq Single sided for frequency TX1 TX0 2 deviation band TX0 MHz TX1 MHz MHz TX1 TX0 2 KHz 315MHz 314 909091 315 087719 314 998405 89 433 92MHz 433 333333 433 517241 433 425287 92 868MHz 868 210526 868 400000 868 305263 95 915MHz 915 151515 915 354839 915 253177 102 Note for the frequencies used in ASK test mode refer to the section ASK Test Mode e Automatic hopping e In Link Test Mode Development board jump to a new frequency channel approx 10 times sec Channels are used randomly e Flash based micro controller PIC18LF4320 for easy firmware upgrade testing Plug directly into ICD2 from Microchip e Antenna External antenna User interface Asynchronous serial interface RS232 level or logic level I O pins 9600 8 N 1 4 DIP switches to select mode of operation I LED to indicate power on LED to indicate RF powered 4 LEDs to indicate status or control information Possible to use 5 external I O pins for user FW developm
17. LAG 0 Use CRC Preamble Sync as described by the control word RFPCK COMP FLAG 1 Use CRC Preamble Sync to make the txed frame compatible with the MICRF6x0 module I Flow Chart 5 BYTE Transfer Mode Micrel Norway Oslo Norway 36 MCRF405 User Manual for Development System FW v 2 Enter Tx procedure Below the Enter Tx procedure and some selected sub procedures are shown Note These are made for the 915MHz band which is slightly different from the other bands The VCO Freq setting is constant over the band for all frequency bands except for the 915 Therefore when entering a few bytes only In addition to the A N M dividers the register holding VCO Freq is entered as well Observe the following cases e Use PA LDc en 1 and enter a complete control word e Use PA LDc en 1 and enter a few bytes only e Use PA LDc en 0 and enter a complete control word e Use PA LDc en 0 and enter a few bytes only Flow Chart 6 RFPRG Enter Tx Micrel Norway Oslo Norway 37 MCRFA065 User Manual for Development System FW v 2 RFPRG Tx 1 Complete Enter the complete control word Clear flag for control word filled Wait for lock Tx with PA on or Tx with PA off Flow Chart 7 RFPRG Tx 1 Complete A screen capture is shown below Observe e Only I programming sequence SEN going low then high e The RF chip turns on PA when LD goes high e Modulation starts when LD goes high
18. MCRFA065 User Manual for Development System FW v 2 12 4 Zdefines in Source Files In all source files some definitions are made before the code is started In all c files the following definition is included e define C FILE In all asm files the following definition is included e define ASM FILE The C FILE or ASM FILE definition is used to include the correct header file standard Microchip definitions of registers and bits In addition a define is included to identify the file name Example In gen c the following is included e define GEN FILE This definition is tested in the header files If the definition is made then procedure prototypes and variables are declared in the header file If not def ed then procedures and variables are included as an extern type Example gen h can be included in all source files procedures variables will be declared only 1 time when included in the gen c file 12 5 Source File Description Below the source files and header files are described Refer to the flowcharts of the main procedures as well The source files typically include several header files The include tree for main c is given in the figure below In particular the following header files are included in several source file e pl8def h o Here the frequency band is def ed o Other general def s are made as well e pl8xxxx h o Here the correct header file standard definitio
19. MICRF405 User Manual for Development System 315MHz 433MHz 868MHz 915MHz FW v 2 Micrel Norway AS Strandveien 13 1366 LYSAKER Norway Tel 47 67 83 08 00 Fax 47 67 83 08 10 MCRFA065 User Manual for Development System FW v 2 Table of contents dntroduction uio ab ead ene ee eens nek 2 2 Development Board Inputs Outputs sees eere 5 2 1 Summary of DIP Switch Settings ence de eee eceicedeo iue Pope ipe da a qedratds 6 3 Cete Started RR ats 7 Z2 RF Test Moderne se es nah cbe aet 8 5 Packet format in Link Test and Simple Byte Transfer Modes 12 5 1 Packet Iormat Type Land Type Lukas sea 12 Packet format Type Lu jurasosesssestesd enno comes defeat fetus 13 Packet format Type 2 5 reete RR MESA RU AI AUS NURSES ES ENS RTVR PATENS UR FER a e teabantesebaneds 14 6 dank Test Mode eee pre aa ad tea eaii 15 7 Interface in Sample Byte Transfer Mode etti een deese ed 17 8 Simple Byte Transfer M de AS 19 9 JC program RF T stBench Luse See duce a Sb 21 10 Firmware change upsgrade ii iere te hane uS esa Rena e Ran a I ie Ee URN venda ed 23 11 Changes in this Firmware Verston e At eee eee 24 12 MICRFA405 Development System Firmware Description esse 25 12 1 Projecteur T 25 12 2 His EE CT 25 12 3 Pile SUUCLUELe cenae ber o xa alge ease ed 26 12 4 defines in Source Files ted e eei
20. Testing 1 Set the development board to transmit a carrier Use a spectrum analyser to observe the frequency spectrum 2 Repeat for transmit 1010 3 Use a MICRF6x0 dev board or your own board as receiver and use the MICRF405 board in transmit 1010 mode Use an oscilloscope to observe the tx ed and rx ed data Data I O Set tx ed data as the trigger source Micrel Norway Oslo Norway 11 MCRF405 User Manual for Development System FW v 2 5 Packet format in Link Test and Simple Byte Transfer Modes In Link Test and Simple Byte transfer mode the development board will construct a packet and transmit it The format of the packets is equal in both modes and described in the figure below Preamble Sync Framelength Payload CRC Preamble 1 4 bytes always a 1010 pattern Used as a training sequence by the receiver the receiver can use this pattern to adjust it s sampling clock for the incoming data Sync 1 4 bytes This field is used to identify Start of frame It can hold a fixed sync pattern an ID or an address Framelength 1 byte Refer to description of Packet type 1 and Packet type 2 below Payload n bytes This is the message or the useful data CRC 0 2 bytes Checksum Refer to description of Packet type 1 and Packet type 2 below 5 1 Packet format Type I and Type 2 Two different format types are implemented The difference is how the Framelen
21. aced in a single component In addition ON is written on the component In the table below 1 means ON 0 means OFP DIP1 DIP2 DIP3 DIP4 Mode of operation 0 0 0 0 Simple byte transfer mode type 1 0 0 0 1 Simple byte transfer mode type 2 0 0 1 0 not used 0 0 1 not used 0 1 0 0 RF Test Tristate all uC I Os 0 1 0 1 RF Test Transmit a random pattern 0 1 1 0 RF Test ASK Test Mode 0 1 1 not used 0 0 0 Link Test 5 bytes payload type 1 0 0 1 Link Test 5 bytes payload type 2 0 1 0 Link Test 26 bytes payload type 1 0 1 Link Test 26 bytes payload type 2 1 0 0 not used 1 0 1 RF Test Transmit 1010 1 1 0 RE est ransmit carrier 1 18 RF Test PC mode Type 1 this refers to the format of the packets transmitted Framelength length of Framelength Payload and CRC CRC 2 bytes is calc ed by firmware on Framelength and Payload fields Compatible with MICRF6x0 Link Test Simple byte transfer mode Type 2 this refers to the format of the packets transmitted Framelength length of Payload and CRC CRC 0 1 or 2 bytes is calc ed on chip by MICRF405 on Payload field Packet Engine data interface used in Simple byte transfer mode and Link Test Bitwise data interface used in Transmit 1010 and Transmit random Micrel Norway Oslo Norway 6 MCRFA065 User Manual for Development System FW v 2 3 Getting
22. acket format refer to chapter 5 In addition to the different packet format the following should be noted When the packet engine is used and CRC is generated on chip then the payload must be gt 1 byte Because of this a frame is transmitted when gt 1 byte is entered Observe the consequence The last entered user byte may not be transmitted until user enters another byte Micrel Norway Oslo Norway 19 MCRFA065 User Manual for Development System FW v 2 Example how to use Simple Byte Transfer Mode User A connected to board A wants to transfer 6 bytes Hello User B connected to a receive board receives the bytes User A e Test if CTS at board A is active If CTS is active the board is ready to accept bytes from the user e Transfer Hello into the board using 9600 8 N 1 Transfer Isb of every byte first after the start bit Board A e Read bytes from User A e Format a packet to transmit 1 2 3 4 5 or 6 bytes of Hello e Enter transmit mode e Transmit the packet e If more bytes entered by user Format a new packet and transmit it Receiver board e Receive a packet e Un pack the bytes from the packet e Test that the number of bytes is a legal number of bytes 1 64 e Test that CRC is OK e Test if RTS is active If RTS is active the user is ready to accept bytes from the board e Transfer the bytes to User B Transfer lsb of every byte first User B Read bytes from board Not
23. ard will enter transmit mode and transmit a carrier that 1s no modulation is applied This can be used to check the frequency spectrum the output power and the current consumption Note that the TX0 frequency is used for the MICRF405 Refer to chapter 9 and chapter 4 Combination 4 Micrel Norway Oslo Norway 8 MCRFA065 User Manual for Development System FW v 2 Combination 4 Enable configuration via PC This setting is also referred to as PC mode Refer to the chapter called PC Program chapter 9 for details on the PC program Make sure the 4 jumpers DTE RTS DTE CTS DTE RX and DTE TX are in place If the power LEDs are off Make sure the board is powered on without the RS232 cable connected and then connect the RS232 cable Entering PC mode Before any command is given from the PC the RF chip will stay in the mode selected before PC mode was selected transmit standby etc While in PC mode When a control word is sent from the PC to the board the board will store the entered word in EEPROM and program the RF chip with it The complete control word is written into the MICRF405 in a single operation It is possible to transfer a control word from any of the 3 Transfer buttons PC program buttons refer to the RF TestBench user guide e Quick Setup or e Complete Setup or e Control Word When leaving PC mode The board will use the default control word already
24. ay be different from the versions used when the FW was released To correct errors and to test if warnings messages require special attention Please refer to the documentation from Microchip 12 3 File Structure All the project files firmware are typically collected in a zip file After un zipping the files you will see a lot of files Several types are used These are asm Source files based on assembly language E Source files based on the C language h Header files includes definitions prototype declarations and variables hex Main output file can be flashed into the MCU Jkr Linker file mcp Project file mcw Workspace file contains I and only 1 project Other types generated when compiling the project cod coff err Ist map mcs o these are not described in this document In MPLAB IDE go to Project gt Open and select the mcp file In addition to the type of file you should notice the naming convention used Every file name is started or made of a 3 5 character abbreviation corresponding to the type of procedures in the file For example the gen c file is a collection of general procedures and gen h is the corresponding definitions prototype declarations and variables This character abbreviation is also used in the procedures and variables Example If you want to take a look at the GEN Init Ports procedure you should open the gen c file Micrel Norway Oslo Norway 26
25. data communications equipment The connected user is treated as a DTE data terminal equipment That is a DCE DTE cable should be used This cable should be 1 1 that is Connect pin i on the DCE side to pin i on the DTE side The following pins are used referred to a 9 pin connector names related to DTE Pin Name DTE side Direction both DTE and DCE DTE DCE Micrel Norway Oslo Norway 17 MCRFA065 User Manual for Development System FW v 2 CTS is an input to the DTE It is used to control data flow from DTE to DCE DCE brings CTS active to signal DCE ready for bytes from DTE DCE brings CTS inactive to signal DCE not ready for bytes from DTE Before DTE outputs bytes to DCE the CTS line is tested If CTS is active DTE knows that DCE is ready to receive bytes and DTE transfer the bytes on the TXD line Maximum number of bytes to transmit in one data frame is 64 bytes The board will tell user to stop enter bytes by setting CTS inactive when the bytes from user buffer holds 64 bytes Note the board can buffer 2 additional bytes Other bytes will be lost The bytes can be entered with random delay between them As soon as a byte is entered the board enters transmit mode and sends the presently entered bytes while still buffering new bytes from user note that the board does not wait until buffer is full or until user stops entering bytes Micrel Norway Oslo Norway 18 MCRFA065 User Manual for Develop
26. e Since no addressing is used other users let s say User C User D and User E will receive the 6 bytes as well If the boards are used in a network the message has to include some address information and the user s protocol has to handle it Micrel Norway Oslo Norway 20 MCRFA065 User Manual for Development System FW v 2 9 PC program RF TestBench The PC program is referred to as RF TestBench RF TestBench can be used with or without the development board It can be used to calculate fields in the control word to enter into MICRF405 Examples Find settings for a specific bit rate or get the frequency dividers for a number of frequencies RF TestBench should be self explaining refer to the user guide for the PC program as well Installation and running are straightforward simply double click setup exe and follow the on screen instructions If using RF TestBench together with a development board Make sure the DIP switches are set like this All ON Combin DIP1 DIP2 DIP3 DIP4 Text 1 1 1 1 1 Using RF TestBench e Connect the development board to a PC via a cable o 1 1 RS232 cable o Make sure RTS CTS TX RX and GND are included in the cable pins 2 3 5 7 8 o Note Power on the board before connecting the cable to the board if the power LEDs do not get on Power on the board Start RF TestBench by double clicking RF TestBench Read the text in the w
27. elcome window From the main window select Dev Board Connection COMI or COM2 From the main window select RF Device Select MICRF405 Then select the appropriate frequency band e From the main window use the Quick Setup or Complete Setup or Control Word sections o Use Quick Setup if you want the program to calculate parameters based on basic parameters like xtal frequency RF frequency and bit rate Enter values and press the Calc button in the Quick Setup section o Use Complete Setup to enter the control word fields manually Press the Calc button in the Complete Section to see resulting frequencies etc o Use the Control Word section to change the control word on a register basis Micrel Norway Oslo Norway 21 MCRFA065 User Manual for Development System FW v 2 To transfer a control word to the development board Enter change the fields and press Transfer in the appropriate section The entered values are stored in the micro s EEPROM Observe the Information field If Success is not displayed please check connections power and try again In the following some suggestions are made for the user to get familiar with RF TestBench Experiment with e g power levels Suggestion Change power level press Transfer and then give a Transmit 1010 command refer to next paragraph Observe the result on a spectrum analyser or use a receiver board and
28. ent Possible to monitor the interface between RF chip and micro controller via header pins e Possible to measure RF part power consumption Power supply e 6 9 volt DC e Apply to the centre pin note External antenna connector Type SMA Micrel Norway Oslo Norway 4 MCRF405 User Manual for Development System FW v 2 2 Development Board Inputs Outputs SRV SEN SIO SCK DATAIN RDY DATACLK CLKOUT LD GND MICRF405 RF Transmitter SMA antenna connector DTE TX jumper D RS232 connector 9 pin D sub MU XOU E ODISSE RF power measurement Power supply battery 6 9 volt Center pin 66 66 Power LED ICSP connector DIP switches 1 2 3 4 RF Power LED Note the ON position Micrel Norway Oslo Norway MCRFA065 User Manual for Development System FW v 2 2 1 Summary of DIP Switch Settings To select mode of operation bring DIP switches ON or OFF according to the table below The modes of operation described in detail in the following sections are e RF Test Modes Enter TX mode TX a carrier TX 1010 or a random pattern enter PC configurable mode or bypass tristate micro controller for user operation of the RF part enter ASK test mode e Link Test Mode Use a development board to transmit a fixed packet e Simple Byte Transfer Mode Construct a packet based on user input from e g a PC and transmit it The 4 DIP switches labelled 1 2 3 4 are pl
29. ers and the control bits can be set This program is referred to as RF TestBench Please observe It is possible to read out the firmware version of the development board via RF TestBench Main modes of operation of the Development system e RF Test Modes The user can test the RF properties of the transmitter It is possible to transmit a 1010 pattern a random pattern or a carrier In addition the user can select to bypass the micro controller MCU completely i e tristate all IOs of the MCU and control the RF part via header pins e g by an external micro controller In addition transmitting packets using ASK is one of the test modes e Link Test Mode In this mode of operation the development board is a Master Messages 5 printable ascii characters are transmitted This mode is useful when testing radio communication in different environments testing antennas testing encapsulation etc MICRF6x0 development systems can be used to receive the messages e Simple Byte Transfer Mode In this mode the user can enter a number of bytes into a development board using e g a PC The board will then transmit the bytes A 64 byte deep buffer is implemented Only 1 frequency is used MICRF6x0 development systems can be used to receive the transmitted bytes Firmware FW the program used in the micro controller Micrel Norway Oslo Norway 3 MCRFA065 User Manual for Development System FW v 2 Development System
30. g at all not programming the RF chip etc The DIPs are tested before the IOs are initiated Note When using this mode first make sure DIPs are set correctly then apply power to the board Combination 6 Transmit a Random Pattern The board will enter transmit mode and transmit a random Manchester coded pattern i e without a DC component Combination 6 can be used to test parameters like deviation and transmit spectrum Combination 7 ASK Test Mode In this test mode the board will transmit packets with a defined format ASK modulation is used The ASK modulation type is OOK on off keying and the bit rate is 1200bps 1202bps The board will transmit a new packet every 100msec approx and enter power down between transmissions For every frequency band a single frequency is used e 915 000MHz 868 308MHz 434 000MHz 315 000MHz The packets have this format e 3 bytes Preamble 1010 e 3 bytes Sync 11001100 e byte Length length of payload and CRC fields 7 e 5 bytes Payload 5 printable ascii characters e 2 bytes CRC calculated using the Payload field as input The purpose of this mode is to demonstrate the ASK feature If you have an ASK receiver you can search for packets with this format and e g bring a LED ON if you receive a packet This can be used for range environment testing Micrel Norway Oslo Norway 10 MCRFA065 User Manual for Development System FW v 2 Suggestions for RF
31. ge of DATACLK and then it s OK to change it Make sure that the INTOIF flag is cleared when starting to tx1010 or a random pattern Testing RTS active low before giving data out to user Changed updated comments V1 2006 02 06 PKB Initial release Micrel Norway Oslo Norway 24 MCRFA065 User Manual for Development System FW v 2 12 MICRF405 Development System Firmware Description The development board has a micro controller unit MCU on board The MCU is a PIC18LF4320 from Microchip which is in circuit re programmable this process is referred to as flashing the MCU The program flashed into the MCU is described below This program is also referred to as firmware FW Note All FW is free of charge The intention of the FW is to provide examples suggestions to the user No guarantee is implied as to the suitableness of the firmware in a given application All code must be tested in the application at hand 12 1 Project The source header and link files are put together in a project The C programming language is used with some exceptions refer to file descriptions below The FW can be made to operate in the 315 433 868 or 915 MHz bands The frequency band is selected in a header file via a define statement p18def h The necessary files for all frequency bands are included in the project In pa8def h include 1 and only 1 of the following defines define MICRF405 315 define MICRF405 433 define
32. gth and CRC fields are used For Type 1 Framelength holds the length of the Framelength Payload and CRC fields and CRC is calc ed on the Framelength and Payload fields This is compatible with the MICRF6x0 development system For Type 2 Framelength holds the length of the Payload and CRC fields and CRC is calc ed on the Payload field this is the MICRF405 Packet Engine format Framelength Type I grey fields are included in the length Preamble Sync Framelength Payload CRC CRC Type I grey fields are included in CRC calculations Preamble Sync Framelength Payload CRC Framelength Type 2 grey fields are included in the length Preamble Sync Framelength Payload CRC CRC Type 2 grey fields are included in CRC calculations Preamble Sync Framelength Payload CRC Micrel Norway Oslo Norway 12 MCRFA065 User Manual for Development System FW v 2 Packet format Type 1 Framelength length of Framelength Payload and CRC fields CRC is calc ed on the Framelength and Payload fields by the firmware The packet engine is used but this format violates the packet engine format In the packet engine Framelength is not counting itself To overcome this an additional dummy byte is sent and a 16 bit CRC is calculated by the firmware If from the PC prog
33. ment System FW v 2 8 Simple Byte Transfer Mode Refer to chapter 5 for a description of Type 1 and Type 2 format DIP switch setting 1 means ON 0 means OFF Combin DIP1 DIP2 DIP3 DIP4 Text 1 0 0 0 0 Type 1 format compatible with MICRF6x0 2 0 0 0 1 Type 2 format not compatible with MICRF6x0 Note There is no Master or Slave in this mode of operation Use of LEDs LEDI LED2 LED4 Not used in Simple Byte Transfer Mode LED3 On while tx ing a packet Combination 1 Refer to interface description in Interface in Simple Byte Transfer Mode e There is no difference between master and slave in this mode e Error detection is implemented through CRC check e Only I frequency is used no frequency hopping e Duplicate control or ARQ packets being acknowledged or re transmitted are not implemented in this mode Data flow from user User A to development board Board A then via RF 1 If Board A is ready to get bytes CTS is active User A enters bytes into Board A 2 Bytes are buffered in Board A When 1 or more bytes are entered Board A constructs a frame it adds preamble sync length and CRC to the presently entered bytes Board A then transmits the frame If gt 64 bytes in buffer then user is told to stop entering bytes CTS goes inactive Combination 2 Refer to Combination 1 above The main difference is the p
34. meout1 Yes LO is valid set flag in lock END WHILE No is LO low Ires Make sure flag in lock is cleared Initiate tmr for 8 msec approx Timeout2 Repeat until LD stuck OFF until Timeovt2 or LO going from OFF to ON Ires Lock detect is not found Set flag quit lock END WHILE No Is PA LDc en 1 fres i Detected LD high low high Yes Set flag i Set Nag i n lock Until LO detected high for Timeoutt or low for Timeout2 or high low high Note PLL lock time is a function of the PLL loop filter Loop filter i selected based on bitrate A higher bitrate gives a filter with higher bandwith A higher bandwith gives a shorter PLL lock time M PA_LDe_en 1 then LD is forced low after a load li PA is turned on when LO goes high this typically brings LO low I MOD LOc on I as well then LD goes low very fast after PA is turned on M PA LDc en I and MOD LDc en 1 very short time LO high low when PA is turned on i return when li LD high for gt x1 usec or LD low for gt y msec or LO detected high low high 1 M PA LDc en 1 and MOD LDc en 0 longer time LD high low when PA is turned on return when LD high for gt x2 usec or LD low for gt y msec or LO detected high low high WPA LDc on 0 return when If LO high for gt x3 usec or LD low for gt y msec or LD detected low high x1 1 usec x2 150 usec x3 150 usec y
35. ns of registers and flags is included The c header file or the asm header file for the selected micro controller is included Note p18f4320 h for c files and p18f4320 inc for asm files are files made by Microchip they are typically located where you have installed MPLAB e c subst h Micrel Norway Oslo Norway 27 MCRFA065 User Manual for Development System FW v 2 o Here some practical macro definitions are made like the type definition uint8 for unsigned char e ijo xxx h o Here the correct IO definitions are included If you make your own program with other IOs simply replace the included file in io xxx h only done at this single place not in every file that uses the IOs Micrel Norway Oslo Norway 28 MCRFA065 User Manual for Development System FW v 2 main c p18def h pl 18oooc h p18F4320 h p18F4320 inc c subst h rfpck h rfprg o x h p18def h rfprg 405 315 h rfprg 405 433 h rfprg 405 868 h rfprg 405 915 h gen h jo o h n io dev405 h usart h eep h crc h cmn defs h Micrel Norway Oslo Norway 29 MCRFA065 User Manual for Development System FW v 2 Overview of source files e 405asm asm config asm Grec eep c eepinit asm gen c main c rfpck c rfprg c usart c Name 405asm asm Short description Procedures for tx ing 1010 and a random pattern using bit banging Header file Typical procedures Toggle Data Out Random Da
36. nter transmit mode RFPRG Enter Tx Note RFPRG Enter Tx waits for LO to go high or to stay low for x msec Include a delay before bringing RF SEN low again Set flag for TX of packet started Bring SEN low and keep it low Write to frame length field Write address 29 r w bit 0 Write framelength RFPCK Out Length Number of RDY pulsos to wait for framolength 2 Cloar RBO interrupt flag Enable RBO interrupt Until all bytes txed Bytes txod in interrupt TX STARTED is cleared when all txed Wait 1 more bit after the last ROY pulse Bring SEN high again Flow Chart 13 RFPCK Tx Packet Micrel Norway Oslo Norway
37. ram the User selects to Use the control word from EEPROM several fields are in any case overruled by the firmware when type 1 is used These are e Sync en 1 e Load en 1 e MOD LDc en 0 e PA FEc en 1 e PA LDc en 1 e LD en 1 e BIT_IO_en 0 e Manchester en 0 e Sel CRC 0 making CRC in MCU e SyncID Len 2 txing 3 sync bytes e Pream Len 2 txing 3 preamble bytes e SyncIDi G 2 1 0 OxCC 11001100 Note that this format is compatible with the format used in the MICRF6x0 development system In addition it shows that the User is not restricted to the packet engine format when using the packet engine Refer to the MICRF405 data sheet for a detailed description of these fields Micrel Norway Oslo Norway 13 MCRFA065 User Manual for Development System FW v 2 Packet format Type 2 Framelength length of Payload and CRC fields CRC is calc ed on the Payload field by the MICRF405 The packet engine is used and the packet engine format is strictly followed Default field values in the packet engine are given below This can be changed by the User with some exceptions see below e Sync_en e Load en 1 e MOD LDc en 0 e PA FEc en 1 e PA LDc en 1 e LD en 1 e BIT IO en 0 e Manchester en 0 e Sel CRC 3 making 2 bytes CRC on chip e SyncID Len 2 txing 3 sync bytes e Pream Len 2 txing 3 preamble bytes e SyncIDi 1 3 2 1 0
38. s on link quality Make sure the cable is 1 1 and that RTS CTS TX RX and GND are used Make sure the data format is 9600 8 N 1 and hardware handshake is used Also make sure the jumpers for RS232 use are in place Micrel Norway Oslo Norway 7 MCRFA065 User Manual for Development System FW v 2 4 RF Test Modes In the RF Test Modes only 1 frequency is used If not changed via the PC program the frequency is e 315MHz band 315 00MHz e 433 92MHz band 433 43MHz e 868MHz band 868 31MHz e 915MHz band 915 25MHz Note for the frequencies used in ASK test mode refer to the section ASK Test Mode DIP switch setting 1 means ON 0 means OFF Combin DIP1 DIP2 DIP3 DIP4 Text 1 1 1 0 0 Not used in this firmware version 2 1 1 0 1 Transmit 1010 3 1 1 1 0 Transmit carrier 4 1 1 1 1 Enable configuration via PC 5 0 1 0 0 Bypass micro controller 6 0 1 0 1 Transmit a random pattern 7 0 1 1 0 ASK Test Mode Use of LEDs LED1 LED2 LED3 LED4 Not used in RF Test Modes Combination 1 Not used Combination 2 Transmit 1010 The board will enter transmit mode and transmit a 1010 pattern Combination 2 can be used to test parameters like deviation and transmit spectrum Use a MICRF6x0 development board or your own rx board to receive the signals or observe the spectrum on a spectrum analyzer Combination 3 Transmit carrier The bo
39. ta Out Notes This is an asm file Assembly code is selected to maximize efficiency tx ing bit by bit up to 200kbps while at the same time testing DIP switches and user input from USART At 200kbps the number of instruction cycles bit is small 13 At bit rates lt 20kbps a c file can easily be made but the procedures are designed for max bitrates note that the dev boards without hw changes are made for bitrates up to 20kbps only Name config asm Short description Setting up micro controller configuration bits Header file Typical procedures None Notes This is and should be an asm file For the selected MCU with the selected xtal Micrel Norway Oslo Norway 30 MCRFA065 User Manual for Development System FW v 2 Name crc c Short description CRC cyclic redundancy check calculations Header file crc h Typical procedures CRC Byte void Notes CRC calculations can be made by the packet engine in MICRF405 as well However if the user does not want to follow the frame structure of the packet engine but still wants to use CRC the user must make the CRC in firmware Name eep c Short description EEPROM procedures Header file eep h Typical procedures uint8 EEP Read EEprom uint8 ee address void EEP Write EEprom uint8 ee address uint8 ee data Notes Name eepinit asm Short description Init some parameters stored in EEPROM Header file Typical procedures None Notes
Download Pdf Manuals
Related Search
Related Contents
JVC LVT0178-001A Stereo Receiver User Manual 第2回定例会 ARES 4K UHD LED TV User Manual 鋳物フェンス連結金具 施工説明書 Philips SWU2162 取扱説明書(PDF) Philips HTB5260G Troubleshooting TROUBLESHOOTING TIPS Not receiving email Design of an Accelerated Event-based Server Copyright © All rights reserved.
Failed to retrieve file