Home
CC1010IDE User Manual
Contents
1. UARTO_WAIT_AND_SEND buf fer Figure 20 Application example promoting typical integration of Chipcon libraries j SWRU057 Page 49 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments After building and downloading the application example follow the test procedure below e C1010 HyperTerminal Bisi x File Edit View Call Transfer Help Die el zl cl Test procedure Connect a PC to CC1010EB using crossed 0 modem serial cable Wenu Open terminal program i e hyperterminal on PC Configure serial communication on COM1 COM2 1 Open file Transmit file PC gt CC1010EB 57 6 kbit sec 8 data bit 1 stop bit no parity no flow control Type 1 and enter name of file to be transferred PC gt CC1010EB 9 End program Select a menu option 1 ar gt Type to prepare CC1010EB for file transfer File name Testl txt_ Follow the instructions on the screen If the file transfer succeeded then option 3 becomes available type 3 to request CC1010EB to echo CC1010EB gt PC the file characters it has just received Connected 0 07 44 Weg 57600 8 N 1 Figure 21 Application example test procedure j SWRU057 Page 50 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments Type 2 to transfer file from the PC to CC1010EB _ EES Sl File Edit View Call Transfer Help Del al cl el Menu for Testl
2. ASM BIN EXAMPLES HLP INC m g m ISD51 LIB CC1010DebugMon MON51 p Loo MON390 RtxTiny2 DATASHTS i Chipcon UV N Figure 1 Software Program Files Chipcon E Documentation C Flash Programmer L SmartRF Studio Figure 2 Documentation Abbreviations Definitions ASM Hardware definitions for 8051 and other microcontrollers BIN Keil program files i e compiler linker etc CC1010 debug extensions DLL s EXAMPLES CC1010 application examples generic examples HLP Keil help documents compiler help syntax help etc INC Header files for CC 1010 and other supported platforms ISD51 In System Debugger provided by Keil LIB Keil library files i e RS232 adapted dialog functions Chipcon libraries HDF HAL and CUL MON390 Debug monitor for Dallas CPU MON51 Keil library files for the debug monitor RtxTiny2 Tiny real time operating system provided by Keil including task scheduler etc CC1010DebugMon CC1010 debug monitor target embedded debug driver DATASHTS CC1010 documentation i e user manuals UV2 Keil uVision2 IDE program files including device database Documentation Chipcon documentation datasheets etc Flash Programmer CC1010 flash programmer SmartRF Studio SmartRF Studio tool for RF performance evaluation CC1010IDE CC1010
3. CH CC1010IDE Core Figure 3 Basic CC1010IDE associations j SWRU057 Page 6 of 70 EXAS INSTRUMENTS E Chipcon Products from Texas Instruments Installing the CC1010IDE The CC1010IDE integrates closely with Keil uVision2 IDE Hence in order for the CC1010IDE modules to work Keil uVision2 must be installed on the computer first otherwise the CC1010IDE installation will throw the following error message InstallShield Wizard xi Failed to detect Keil uVision2 Please cancel this installation and follow the instruction Install the evaluation version of the Keil PK51 IDE accompanying this distribution or download it from Keil s web site at http www kel com Or Install the full version of Keil PK51 IDE u ision 2 x required from a separate distribution Note Whenever you upgrade Keil PK51 IDE please rerun this installation to ensure consistent integration between Chipcon and Keil gt InstallShield Cancel Figure 4 CC1010IDE installation check j SWRU057 Page 7 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments Once Keil uVision2 IDE has been installed successfully the CC1010IDE installation program will automatically detect recognize it on the computer and allow the user to proceed with the CC1010IDE installation InstallShield Wizard a CC1010 Development Tools Installation Tools Keil u ision2 was successf
4. ee Edit View Project Debug Peripherals Tools SVCS Window Help cO eelecl en rnnl ZJanm gppergp enaze 2 B Text3 iol xi 5 4 CC1010 include lt chipcon hal h gt Source Group 1 include lt chipcon ccl0l0eb h gt include lt stdio h gt int main Setup serial port UARTO_SETUP 57600 CC1O1OEB_CLKFREQ UART NO PARITY UART TX ONLY UART POLLED Save As Loop forever while 1l Display message when switch 1 pre EC My Computer if SW1_PRESSED d akin Floppy l a Cc printf Hello n a SE ccio1o EI D File name Save as type Ja Files z Cancel Figure 31 Tutorial create source file 4 a SWRU057 Page 60 of 70 EXAS INSTRUMENTS E Chipcon Products from Texas Instruments Add source file s to the software project Once the source file s are created the IDE needs a reference to these files so that it can process compile assemble link etc the file s Right click on Source Group 1 and choose Add Files to Group Source Group 1 Then locate the file s and choose add Look in a Test D Si cl A R Mu Computer el 3 Floppy 4 a Il Chipcon CC1010 File name IT estl c Files of type Ic Source file c D Close Figure 32 Tutorial add source file to software project SWRU057 Page 61 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instrumen
5. eke Cs c C E Cs c c DPTRI Ox0 0x0C01 4420 ORL A 0x20 DPS 0x86 0x00 0x0C03 F589 MOV TMOD 0x89 A MPAGE 0x00 0x0C05 asic INC halTimer 1Usage 0x1C PC 0x0 Den 7GARA Mon OD TD 08 vA SW Ox IE 0x48 IP 0xB8 EICON 0 EXIF Ox EIE OxE8 EIP OxF8 PCON 0 ADC SCA Ces cam coe cam luan ag in Eval Mode 2K ZA Load C Chipcon sCC1010 Test IN Test 1 PR Ready I Num scrt Rw 4 Figure 36 Tutorial debug the CC1010 code j SWRU057 Page 65 of 70 INSTRUMENTS E Chipcon Products from Texas Instruments Debug the CC1010 peripherals From the peripherals menu it is possible to access the CC1010 s peripheral hardware directly One of the peripheral dialogs A D Converter enables the user to access the CC1010 A D converter directly from the PC Browse this dialog to set up the A D converter and then click Refresh to read the current value on the selected analogue channel Similar debugging actions can be carried out on other CC1010 peripherals To activate a parameter change in the peripherals dialog make sure to press enter after each entry For more details on direct debugging of the CC1010 peripherals please study the peripherals menu Ni Testi pV ision2 ol x Il Ele Edit view Project Debug Peripherals Tools SVCS Window Help a coe Med GH re rto D alleler gt 2 e e B gt D
6. Chipeon ccio10 File name H est Save as type Project Files uv2 bd Cancel Figure 28 Tutorial create new software project j SWRU057 d TEXAS INSTRUMENTS Page 57 of 70 C Chipcon Products from Texas Instruments Select target device i e with debug mode Select Device for Target Target 1 E F Use Extended Assembler A951 instead of A2 H Q Analog Devices Atmel Atmel Wireless amp uC ebug cro Systems Cygnal Cypress Semiconductor Daewoo Dallas Domosys Generic Figure 29 Tutorial select target device SWRU057 Page 58 of 70 d TEXAS INSTRUMENTS C Chipcon Products from Texas Instruments Select target profile for debug mode refer to chapter 3 for the remaining configuration tab s Options for Target CC1010 Output Listing c51 A51 BL51 Locate BL51Mise Debug e a Small variables in DATA M Large 64K program ha Ej a in imterupts Figure 30 Tutorial configure target profile SWRU057 Page 59 of 70 d TEXAS INSTRUMENTS C Chipcon Products from Texas Instruments Create source file s After creating a software project the next step in making a CC1010 application is to create one or more source files Together with referenced library file s the source file will provide the actual functionality of the target application From the File menu choose New Then edit and save file
7. Connect CC1010EB to power supply Connect parallel cable between parallel port on the PC and CC1010EB Connect serial cable between serial port on the PC and CC1010EB Use the CC1010IDE to build an executable program for the CC1010 Use the Chipcon Flash programmer to download the program on the CC1010 aon 4 SWRU057 Page 67 of 70 INSTRUMENTS E Chipcon Products from Texas Instruments Evaluation Module The Evaluation Module contains the CC1010 chip the needed external circuitry for operation pull up resistors for all general I O pins test points and a temperature sensor Not all components are needed in an actual application Please see the datasheet for a typical application circuit The Evaluation Module is produced in two versions the difference between them is the frequency band of operation One version is optimized for use at 433 MHz the other for use at 868 MHz and at 915 MHz This covers the most used frequency bands the 433 MHz band in Europe and the US the 868 MHz band in Europe and the 902 928 MHz band in the US See application note AN001 for more information about applicable regulations The operating frequency band is marked on the PCB High frequency i SANKCL 3 94V 0 KS roo Chincon crystal L ZS e CCIGIGEM 1 8 CC j Evadua tion Trimmer capacitor 32 768 kHz crystal Power connections Antenna connector CC1010 s_ _ iin Ay H i 4 20 Dt
8. INS Temperature SES K DEEN sensor Figure 38 CC1010EM Evaluation Module j SWRU057 Page 68 of 70 EXAS INSTRUMENTS E Chipcon Products from Texas Instruments Evaluation Board The Evaluation Board is used as a motherboard for the Evaluation Modules providing external circuitry for easy prototyping and connectors for easy connection to external equipment SPI UO SMA terminal Potmeter block g Buttons DC jack power input Power selection switch K NI S S ir E as Digital UO B Serial port 0 in Gs noes e connector a i KR d d yer Analog UO Serial port 1 i Es connector Parallel port d Digital UO A connector Figure 39 CC1010EB Evaluation Board with CC1010EM plugged in 4 SWRU057 Page 69 of 70 TEXAS INSTRUMENTS E Kan e Products from Texas Instruments Disclaimer Chipcon AS believes the furnished information is correct and accurate at the time of this printing However Chipcon AS reserves the right to make changes to this product without notice Chipcon AS does not assume any responsibility for the use of the described product Please refer to Chipcon s web site for the latest update SmartRF is a registered trademark of Chipcon AS SmartRF is Chipcon s RF technology platform with RF library cells modules and design expertise Based on SmartRF Chipcon develops standard component RF circuits as well as full custom ASICs based on customers requirement
9. CC1010_debug Xtal MHz fi 4 7454 Jh Use On chip ROM 0x80 075FF Memory Model ES variables in DATA DI Code Rom Size Large 64K program I Use multiple DPTR registers Operating system None z V Use On chip XRAM 0x0 0x7DF r Off chip Code memory r Off chip Xdata memory Start Size Start Size Eprom i f Ram Eprom i a Ram Eprom a iz Ram Hl I Code Banking Start End F far memory type support Banks 2 7 Bank Area Ion erer Save address extension SFR in interrupts II Cancel Defaults Figure 10 Memory and clock profile j SWRU057 Page 14 of 70 d TEXAS INSTRUMENTS C Chipcon Products from Texas Instruments Configure output profile The CC1010IDE build process generates an executable file according to the settings specified in the Output tab To support the CC1010 target the output file must be in the correct format The Output tab also offers options to run user specified programs after the output file has been made In general Chipcon recommends the following output configuration Options for Target CC1010 Figure 11 Output profile SWRU057 Page 15 of 70 d TEXAS INSTRUMENTS C Chipcon Products from Texas Instruments In addition to the executable file the CC1010IDE can also produce a variety of list files i e to support inspection debugging of the target code In order to generate a full inspection refer
10. File View Configuration Tools Help lel Es SlDlelul gl Figure 27 CC1010IDE utility SmartRF Studio info X tal accuracy 20 ppm info AF freq ae 868 237200 MHz Rs Tx Bc 868 297200 MHz C Rx Tx info RX Mode IV Optimal freq MV LowLO info Freq separation E kHz info Data rate 24 kBaud info Data Format Manchester zl Fast Accurate info RF Output Power fo dBm info FARSSI RSSI Enabled 7 info Lock Indicator Disable DI info Mode RX m Evaluation Board Control HW Reset Calibrate Read S vu info Match L32 L4 CH cH C42 W L101 23 nH 20 0 nH 25 nH B2 pF NA pF 0 0 pF m Build in test ES enable BER estimator BER 10E 3 iC Program Files BERWIN 1024 bits SIGTYPE 2 bit period square Status information Typical current consumption 27 00000 m Ea Lock indicator Disabled device Chipcon Flash Programmer www chipcon com I I I I I I I Documentation I I I I I I I Ready d TEXAS INSTRUMENTS SWRU057 Zi SmartRF Studio pecon Page 55 of 70 E Kaal ez Products from Texas Instruments Maintenance Upgrades Each CC1010IDE release includes multiple stand alone submodules with individual revisions Chipcon guarantees consistent CC1010IDE performance based on integration testing prior to a new release To maintain and ens
11. Wich t PA I Watchin I Memory Display I Memory Display E TE CPUDLL Parameter Driver DLL Parameter Baud Rate 57600 E EE l 8051 dll j 8051 dll b TI Clear code cache after Run and Step Dialog DLL Parameter Dialog DLL Parameter eps dil IEN cc1010disp dll EB Fies GP Regs Books ok Cancel Defaults ER Den WT SN Figure 13 Debug profile j SWRU057 Page 17 of 70 INSTRUMENTS E Chipcon Products from Texas Instruments CC1010 Code inspection and testing To inspect and test the target software CC1010IDE includes powerful tools for in circuit debugging and limited target simulation Debugger operation The CC1010 in circuit debugger consists of a uVision2 plug in DLL that communicates with a hidden 8051 program through a serial cable With a few exceptions it is completely transparent for the user It is impossible to step into an interrupt use breakpoints instead It is impossible to stop inside a high priority interrupt use breakpoints instead The CC1010 should only be reset through the debugger Idle and sleep mode should be avoided The watchdog timer will be disabled C code steps are done through several assembly code steps a progress bar is displayed in the uVision2 status bar Expected performance 30 40 ASM steps second e The LJMP instruction at address 0 is moved to a reserved address at page 0 The move is hidden by the debugger plug in For text box
12. c chipcon cc1010 test1 hex This command line instructs the flash programmer to write the specified hex file into CC1010 flash memory and then immediately verify the flash memory content against the original hex file It acquires the parallel port LPT1 to communicate with CC 1010 and sets the clock frequency to 14 7456 MHz 2 ccprog exe r c chipcon cc1010 test1 verify hex This command line instructs the flash programmer to read the content of the flash memory and then store it in the specified hex file In this case the flash programmer acquires LPT1 and sets the clock frequency to 14 7456 MHz by default j SWRU057 Page 54 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments SmartRF Studio To diagnose the CC1010 RF transceiver after the debug option has been removed Chipcon recommends using SmartRF Studio This tool implements a serial communication protocol with the CC1010EB through the PC parallel port To support SmartRF Studio communication it is necessary to install download a so called SmartRF Studio adapter on the CC1010EB This enables the user to diagnose configure and test the CC1010 RF transceiver from the PC It will also be possible to export a complete set of RF parameter settings from SmartRF Studio into the application source code without tedious retyping See the SmartRF Studio user manual for more information on this program CC1010 SmartRF Studio 4 00 B3
13. ease and support the program development Besides the standard C libraries the source support files are divided into 4 main groups Hardware Definition Files HDF Hardware Abstraction Library HAL Chipcon Utility Library CUL and finally application examples To examine these files in detail refer to the Keil program directory Application Examples source code RS232 modem Temperature sensor keyboard Nightrider etc Chipcon Utility Library CUL CRC SPP etc Standard C Hardware Abstraction Library Libraries HAL RS232 SPI ADC DES crypto etc Hardware Definition Files Register definitions HDF interrupt vector mapping etc Figure 14 Library stack Library limitations Keil Keil Full version esi CUL and HAL are provided as libraries lib Keil Evaluation version ASM User libraries are not supported BiN Each individual HAL CUL files must be added manually to each software project SES HDF overview INC HLP Evaluation Board macros i e LED control Register definitions e special function registers INC Bees Control register definitions macros O 1SD51 Interrupt macros i e vector assignments LIB Etc DEES HAL overview LIB RF calibration configuration packet transfer etc MON51 Flash memory write Timer configuration SEH ADC confi
14. msecs j SWRU057 Page 47 of 70 da EXAS INSTRUMENTS E Kaal ez Products from Texas Instruments Application examples The CUL HAL and HDF enable the user to create applications based on a consistent and tested software platform To boost the application development process the CC1010IDE also offers some useful application examples that demonstrate typical use integration of the libraries In general these examples can be downloaded from Chipcon s web site http www chipcon com Detailed documentation and explanation of the application examples are available under the Chipcon documentation directory C Program Files Chipcon Application Examples temp_main c tocTransmit etc source code Rn ech Chipcon Utility Library CUL Standard C Hardware Abstraction Library Libraries HAL Hardware Definition Files HDF Figure 19 Chipcon application examples j SWRU057 Page 48 of 70 da TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments The example below is typical of the way the Chipcon libraries can be used in an application that enables terminal communication with the CC1010 This application example implements a simple file transfer protocol on top of HAL and uses a UART channel to communicate with a terminal program on the PC Note that parts of the source code i e dialog have been removed to highlight the core functionality B E Keil C51 EXAMPLES C
15. 0C51MX SIEVE TRAFFIC WHETS Figure 24 Generic examples da TEXAS INSTRUMENTS ADI 83X Extended features of Analog Devices ADuC83X ASM Assembly code for serial communication on 8052 BADCODE Source file with errors useful as a debugging exercise Bank EX1 Program execution in several code banks BLINKY Blink LED s on a MCBx51 evaluation board Chipcon CC1010 application examples CSAMPLE Calculator and serial communication Dallas 390 Contiguous addressing mode for Dallas 390 CPU DES 8051 Data Encryption DHRY 8051 code efficiency test with dhrystone benchmark FarMemory Far memory addressing i e EEPROM access HELLO Hello World for 8051 using serial communication Infineon C517 Simulate Hewlett Packard calculator with C517 MEASURE Simulate data logger with C515 Philips 80C51MX Code banking for 80C51MX expanded memory SIEVE Prime number calculation for performance testing TRAFFIC Trafficlight control using RTX51 Tiny OS Scheduler Triscend Code Banking Triscend code banking WHETS Floatingpoint test using Whetstone benchmark SWRU057 Page 52 of 70 E Chipcon Products from Texas Instruments Utilities Flash Programmer The Flash programmer basically implements a fast synchronous serial link between the PC parallel port and the CC1010EB It generally supports the complete SPI protocol required for correct CC1010 programmin
16. A is written to when calibrate TRUE and read from otherwise Use FALSE if pRF_CALDATA is valid Return void j SWRU057 Page 45 of 70 da EXAS INSTRUMENTS E Kaal ez Products from Texas Instruments void sppReset void Description Stops a transmission or reception by turning the transceiver off entering IDLE mode sppStatus Arguments void Return void byte sppStatus void Description Returns the status of the SPP Arguments void Return byte SPP_IDLE_MODE Ready to transmit or receive SPP_TX_MODE Transmitting a packet SPP_TXACK_MODE Waiting for the ack SPP_RX_MODE Waiting for or receiving a packet SPP_RXACK_MODE Transmitting the ack j SWRU057 Page 46 of 70 da EXAS INSTRUMENTS E Kaal ez Products from Texas Instruments void sppStartTimer word clkFreq Description Run timer3 with a period of 10 msecs Arguments word clkFreq The XOSC clock frequency in kHz Return void void sppSetTimerCB byte cb void pF word pTicks Description Add timer callback Arguments byte cb Callback index use SPP_CUSTOM_0_TIMER or SPP_CUSTOM_1_TIMER The SPP finite state machine uses SPP_FSM_TIMER void pF Pointer to the function to call word pTicks The timeout in 10s of msecs Return void word sppGetTime void Description Returns the value of the 10 msec counter which is started by sppSetupRF Arguments void Return word The current time in 10s of
17. E macro If period is 0 then the maximum period possible will be set The period can also be adjusted dynamically with the PWMx_SET_PERIOD macro word clkFreq The XOSC clock frequency in kHz Return ulong The actual period in microseconds or zero if the desired period is too high j SWRU057 Page 24 of 70 da TEXAS INSTRUMENTS E Kan e Products from Texas Instruments bool halCopy2Flash byte code flashPtr byte src word length byte xdata ramBuffer word clkFreq Description Copies length bytes from the memory area pointed to by src in any memory space to the memory area in CODE memory space pointed to by flashPtr A 128 byte temporary buffer in the XDATA memory space must be pointed to by ramBuffer None of the pointers flashPtr src or ramBuffer need to be page aligned address mod 128 0 as with halFlashWritePage neither does ength have to be a multiple of 128 bytes it can in fact be between 1 and 32768 bytes although it goes without saying that it is unwise to overwrite the memory occupied by the code for this function The result is undefined if the memory areas occupied by src src length 1 and ramBuffer ramBuffert 127 overlap A verification of the data written is performed after programming if this verification fails for some reason flash page is write locked flash programming failure or some of the supplied arguments are invalid the function returns FALSE All interrupts are turned of
18. E Chipcon Products from Texas Instruments User Manual Rev 1 4 CC1010IDE Integrated Development Environment Ww TEXAS INSTRUMENTS SWRU057 E Chipcon Products from Texas Instruments Table of contents INTRODUCTION E 3 BIO UME NTT IM ctr edn ect lee Wega i cetacean 4 ABBREVIATIONS DEFINITIONS cccccscsscscsesesesececsessvsssesesesesasesavassesesesesacsesasacsesesecaeseseeacacsenaes 4 BASIC ees eh alte ue EEN 6 INSTALLING THE CC101 OIDE 1 0 0 cccccecceseeeeeee cece seen seen seen eneeeeeeeeeeeeseeeseseeeeseeeeneeeeeseeeeenenenees 7 SETTING UP A SOFTWARE PROJECT FOR THE CC 11 CONFIGURE TARGET PRO IE eier eeneg 11 CONFIGURE MEMORY AND CLOCK PROELE nnmnnn tnt 14 CONFIGURE OUTPUT PROP deet 15 CONFIGURE DEBUG PROFILE IN CIRCUIT DEBUGGER 17 CC1010 CODE INSPECTION AND TESTING cccceccsssssssesecesesesesesesesesesesesesesesesesnsesasons 18 ERR 58h etieseaeaiiantes neds laura ansanteininics upiniarouedoannisiranlin 18 SIMULATOR OPERATION ies pitkicsn5 s5issacing caine aiid ens vadaacslabsitinaaaapaiiastaeinsts Sasso amiss 18 LIBRARIES AND EXAMPLE ccccccceeeeeeeeeeeee seen seen ee seen seen eneeeeeeseseseeseeeseeeeeeeeeeeeeeseeeneeenees 19 HARDWARE DEFINITION FILES HDF c cccscsssecscscscsessssesesesesscsesesacsesavassesesesecacsesaacseseeeeseees 20 HARDWARE ABSTRACTION LIBRARY HAL 20 CHIPCON UTILITY LIBRARY CUL EE 20 HAL LIBRARY REFERENCE ees 21 CUL LIBRARY REFERENCE geheegt 39 APPLICAT
19. ION EXAMPLES are 48 GENERIC EELER egEed eleg ER UTILITIES i aea aara ae eara aa eea eaaa Ea aaae a ae E Naa 53 EE 53 SMARTRFO STUDIO e 55 MAINTENANGE aa rE aaa aaa a aaa a sath ss sadveeadsaes eastandi Sadeacetecaiducateasietieeaiass 56 Te 56 EE 56 Wel EE 57 BUILD ACC 1010 SOFTWARE APPLICATION aiscdsciucdsscmaivieccsacsuacaracisocdaniaietsaewbenamleonaiietees 57 WRITE APPLICATION TO THE CC1010 WITHOUT DEBUG OPTION ssss sissisissisiirisresieienrsrsreern 63 WRITE DEBUG MONITOR TO THE CC1010 ccccscccssscsessssesesesesesecsesavsssesesassesesesecacsesaacseaeeeseees 64 DEBUG THE CC 1010 QODE sxc cycsjcatocagatiniattsileRianaleacalelddaacdedlasnaemnpadeitlasenailadnaaieces 65 DEBUG THE EEEITEIEERIEEIER Reeder eet EE eege 66 EVALUATING THE CC1010 PERFORMANCE ccccccccececeeeeeeeeeeneeeeeeeeeneneeseeseeeeeeeenenenenees 67 DISCLAIMER EE 70 d TEXAS INSTRUMENTS SWRU057 E Chipcon Products from Texas Instruments Introduction The Integrated Development Environment IDE supports development debugging and simulation of CC1010 software applications and includes a project manager GUI text editor simulator and debugger GUls and a compiler assembler linker The CC1010IDE is based on uVision2 a software development tool from Keil Elektronik GmbH This tool provides a framework for most of the CC1010IDE features and it also supports most 8051 microcontroller platforms The editor is primarily a tool for editi
20. Integrated Development Environment da TEXAS INSTRUMENTS SWRUO057 Page 4 of 70 E Chipcon Products from Texas Instruments CC1010EB CC1010DK CC1010DS CUL DLL HAL HDF ICD IDE RF UV2 da TEXAS INSTRUMENTS CC1010 Evaluation Board CC1010 Development Kit CC1010 Data Sheet Chipcon Utility Library Dynamic Link Library Hardware Abstraction Library Hardware Definition Files In Circuit Debugger Integrated Development Environment Radio Frequency Keil uVision2 SWRU057 Page 5 of 70 E Chipcon Products from Texas Instruments Basic CC1010IDE associations In order to provide a complete development environment the CC1010IDE integrates with a number of other components In addition to the application source code it associates with source libraries documentation and DLL s and uses the serial port and parallel port to download communicate with the CC 1010 embedded software Application Parallel Port Interface Embedded SW HEX file Parallel port driver Application RS232 modem SPI programming DLL i Temperature sensor ee SmartRF Studio Adapter etc Serial Port Debug Monitor g GUI Serial Port Interface Libraries Editor In circui gt n circuit Debu r DLL Standard C Compiler SS SES HDF HAL CUL Assembler Linker Documentation Debugger CC1010 DK User Manual Simulator Simulator DLL CC1010 DS Data Sheet SmartRF Studio etc Flash programmer SPI programming utility
21. NSTRUMENTS E Kan e Products from Texas Instruments ulong halConfigTimer01 byte options ulong period word clkFreq word modulo Description This function configures timer O or 1 depending on the value given in option as either an interrupt timer an interrupt is generated at certain intervals in time as specified by period or an interrupt pulse counter an interrupt when period number of pulses have been detected on P3 4 P3 5 for timer0 timer1 Some timer settings with long timeouts require that the user initializes timer register in the interrupt service routine ISR This should be done by using the appropriate version of the ISR_TIMERx_ADJUST m macro with the word pointed to by modulo as an argument The modulo argument takes a pointer to a word if it is NULL many timer settings will be unavailable It is the responsibility of the programmer to make sure that the appropriate timer ISR has been declared and that it begins with the obligatory ISR_TIMERx_ADJUST m macro The timer must be started with macro TIMERx_RUN TRUE Arguments byte options Options indicating which timer to configure and how ulong period The desired period between interrupts in microseconds in timer mode or the number of counted pulses between interrupts in counter mode word clkFreq The XOSC clock frequency in kHz word modulo A pointer to a word in xdata which after the function has returned contains the value to supply to the obligat
22. am amp Verity Erase amp Program Ext Verify Device against HEX File Head Program Memory from Device and write to HEX File Perform Flash Memory Test Memory Lock Options e p Device Information gt Write Protect Boot Black T Read Protect whole Memory Get From Device Device ID l Memory Write Protection S Lock Status fa Memory Unlocked 7 Figure 35 Tutorial write debug monitor to CC1010 j SWRU057 Page 64 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments Debug the CC1010 code From the Debug menu choose Start Stop Debug Session This initiates a process that downloads the application to the CC1010 Inspect the embedded CC1010 code using common debug commands such as step breakpoint etc Bie Edt view Project Debug Peripherals Tools Svcs Window Help jeacsta semelocl ecseanel Aamlolepigleerpn jesusen Jelon Teolo eRe a int main a Si M Setup serial port UARTO_SETUP 57600 CC1010EB_CLKFREQ UART_NO_PARITY UART_TX_ 9i rk Loop forever 0x0BEA 43A701 ORL P3DIR OxA7 0x01 Ox0BED S3A7FD ANL P3DIR 0xA7 0xFD 0x0BF0 D251 SETB TXD 0zxB0 1 0x0BF2 438E10 ORL CKCON 0x8E 0x10 0x0BF5 438780 ORL PCON 0x87 P0 0x80 0x0BF8 758DFD MOV TH1 0x8D 0xFD 0x0BFB D28E SETB TR1 0x88 6 0x0BFD E589 A TMOD 0x89 OxOBFF S40F ANL A 0x0F NED 0x00 DPTRO C c c
23. and the RF interrupt enabled The RF ISR will then receive the packet and transmit an ack if requested to When finished the receive section will be powered down This function will return immediately and the application can continue while the ISR receives the packet When finished sppStatus will return IDLE_MODE During the transmission it will return RX_MODE or RXACK_MODE After the reception Use pRXInfo gt status to find out what happened SPP_RX_TIMEOUT Timeout nothing received SPP_RX_TOO_LONG dataLen gt maxDataLen the buffer is invalid SPP_RX_FINISHED source dataLen and pDataBuffer in pRXInfo are valid Arguments SPP_RX_INFO xdata pRXInfo An SPP_RX_INFO struct must be prepared before the reception including the following values maxDataLen Length of the data buffer 0 255 DataBuffer pointer to the reception buffer Return byte SPP_RX_STARTED if OK SPP_BUSY if not ready 4 SWRU057 Page 43 of 70 INSTRUMENTS E Chipcon Products from Texas Instruments byte sppSend SPP_TX_INFO xdata pTXInfo da TEXAS Description If the transceiver is ready in idle mode the transmit section will be powered up and the RF interrupt enabled The RF ISR will then transmit the packet pTXInfo and receive the ack if requested If requested sppSettings txAttempts n the packet will be re transmitted n 1 times until the ack is received When finished the transmit section will be powered down This fun
24. ata supplied so far This CRC value should be added at the end of the data to facilitate a later CRC check During checking the check should be performed on all the data AND the CRC 16 value appended to it The data is intact if the value returned is 0 Arguments byte crcData The data to perform the CRC 8 operation on byte crcReg The current value of the CRC register For the first byte the value CRC8_ INIT should be supplied For each additional byte the value returned for the last invocation should be supplied Return byte The updated value of the CRC8 register This corresponds to the CRC 8 of the data supplied so far During CRC checking after working through all the data and the appended CRC 8 value the value will be 0 if the data is intact j SWRU057 Page 39 of 70 da TEXAS INSTRUMENTS E Kan e Products from Texas Instruments word culSmallCRC16 byte crcData word crcReg Description A CRC 16 CCITT implementation optimized for small code size The function should be called once for each byte in the data the CRC is to be performed on For the invocation on the first byte the value CRC16_INIT should be given for crcReg The value returned is the CRC 16 of the data supplied so far This CRC value should be added at the end of the data to facilitate a later CRC check During checking the check should be performed on all the data AND the CRC 16 value appended to it The data is intact if the value returned is 0 Argument
25. ction will return immediately and the application can continue while the ISR transmits the packet When finished sppStatus will return IDLE MODE During the transmission it will return TX_MODE or TXACK_MODE After the transmission Use pTX nfo gt status to find out what happened SPP_TX_ACK_INVALID Something was received but not the ack SPP_TX_ACK_TIMEOUT No response SPP_TX_FINISHED sppSettings txAckTimeout gives the ack timeout in msecs Arguments SPP_TX_INFO xdata pTXInfo An SPP_TX_INFO struct must be prepared before the transmission including the following values destination SPP_BROADCAST or 1 255 flags SPP_ACK_REQ SPP_ENCRYPTED_DATA dataLen Length of pDataBuffer 0 255 pDataBuffer pointer to the transmission data buffer Return byte SPP_TX_STARTED if OK SPP_BUSY if not ready SWRU057 Page 44 of 70 INSTRUMENTS E Kan e Products from Texas Instruments void sppSetupRF RF_RXTXPAIR_SETTINGS code pRF_SETTINGS RF_RXTXPAIR_CALDATA xdata pRF_CALDATA word clkFreq bool calibrate Description Sets up SPP for transmission or reception Call this function to re calibrate the radio or to switch between different RF settings Arguments RF_RXTXPAIR_SETTINGS code pRF_SETTINGS RF settings frequencies modem settings etc RF_RXTXPAIR_CALDATA xdata pRF_CALDATA RF_RXTXPAIR_CALDATA xdata pRF_CALDATA word clkFreq The XOSC clock frequency in kHz bool calibrate Calibrate now pRF_CALDAT
26. ence to the target code the following listing configuration is recommended Options for Target CC1010 Figure 12 Listing profile SWRU057 Page 16 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments Configure debug profile in circuit debugger The Debug tab enables you to configure the CC1010 in circuit debugger and simulator The in circuit debugger supports remote run time control of the CC 1010 software and requires communication between the PC and CC1010EB To configure the CC1010 target for in circuit debugging Chipcon recommends the following configuration Testi p ision2 lej sl Il Eile Edit Yiew Project Debug Peripherals Tools SVCS Window Help ECK i heses a E Alalla lna jegas CC1010 EB e GE amp C Chipcon CC1010 Testi Testi c include lt chipcon hal h gt include lt chipcon cc1010eb h gt ECH CC1010 EB ca Source Group 1 R uarts c Options for Target CC1010 ER KE Testi c Target Output Listing c51 A51 BL51 Locate BL51 Misc Debug C Use Simulator Use Chipcon CC1010 In System Det gt Settings Load Application at Startup I Go till main I Load Application at Startup I Go till main IT_POLLED Initialization File Initialization File Browse Browse Restore Debug Session Settings Restore Debug Session Settings I Breakpoints Jk Toolbox J Breakpoints IT Toolbox F
27. es in the debugger dialogs e Press ENTER to write the value to the target CC 1010 e Exit the text box to undo an entry If the user activates a different dialog before pressing ENTER the current values in the text box is replaced by old values Resources used on CC1010 UART 1 Stack 4 bytes Xdata 22 bytes Flash gt 2k bytes The following procedure is required for CC 1010 debugging e Connect parallel cable between PC and CC1010EB e Connect serial cable between PC and CC1010EB SERIAL 1 e OnCC1010EB make sure the SER_RST jumper is shorted and the GER OFF jumper is open e Make sure the right debugger plug in driver is selected in Keil Project gt Options for Target gt Debug gt Use Chipcon CC1010 In System Debugger e Make sure the right PC serial port is selected for the debugger plug in driver in Keil Project gt Options for Target gt Debug gt Settings e Inthe IDE choose Tools gt Write Debug Bootloader To CC1010 Flash to download the debug bootloader to CC 1010 This prepares CC 1010 for debugging e Inthe IDE choose Debug gt Start Stop Debug Session to start debugging The debugger will then automatically download the application code to CC 1010 e e e e Simulator operation Not available in this version 4 SWRU057 Page 18 of 70 INSTRUMENTS E Chipcon Products from Texas Instruments Libraries and examples The CC1010IDE includes a variety of source files to
28. f while this function executes Arguments byte code flashPtr Pointer to the destination of the write in code memory space byte src Pointer to the data source word length The number of bytes to copy byte xdata ramBuffer A pointer to a 128 byte big buffer in XDATA memory space used to hold temporary data word clkFreq The XOSC clock frequency in kHz Return bool TRUE if the write was successful False if programming verification failed or the supplied arguments were invalid j SWRU057 Page 25 of 70 da EXAS INSTRUMENTS E Kan e Products from Texas Instruments byte halDES byte options byte xdata buffer byte xdata key word length Description This function performs DES encryption decryption on a block of data The encryption decryption operations are performed in place i e the plaintext is overwritten by the ciphertext or vice versa on suitably aligned data address buffer mod 8 0 key should point to the key used for single DES operations or keys in the case of triple DES Two modes of the DES standard are supported 8 bit Cipher Feedback CFB and Output Feedback OFB CFB is self synchronizing the end of a ciphertext can be decrypted even though the beginning is unavailable and can be used to calculate error check codes OFB is not self synchronizing and is not suitable for error check code calculation but does have the favorable property that a single bit error in the received ciphertext prod
29. fore halRFSetRxTxOff it uses the parameter passed to this function instead of whatever the RX TX pair defines If it is passed during an RF operation i e after halRFSetRxTxOff is called the parameter passed is immediately updated in hardware Arguments byte txPower A value between 1 and 28 indicates desired power level 28 is highest and 1 lowest Some useful constants are defined below The override is turned off by passing 0 or RF_NO_OVERRIDE Return void SWRU057 Page 30 of 70 Ww TEXAS INSTRUMENTS E Kaal ez Products from Texas Instruments void halRFOverrideBaudRate byte baudRate Description Function used to override the baudrate normally specified by an RX TX pair If this function is called before halRFSetRxTxOff it uses the parameter passed to this function instead of whatever the RX TX pair defines If it is passed during an RF operation i e after halRFSetRxTxOff is called the parameter passed is immediately updated in hardware Note that for optimal performance the baudrate can only be changed without a new calibration within the two sets 600 19200 and 38400 76800 Arguments byte dataFormat To disable the override the function must be called with the parameter RF_NO_OVERRIDE Return void j SWRU057 Page 31 of 70 da TEXAS INSTRUMENTS E Kaal ez Products from Texas Instruments char halRFReadRSS Description This function activates RSSI output on t
30. g and offers the following main programming options Action to perform Specifies basic flash memory operations such as read write test and content file processing comparison Memory lock options Specifies read write protection of specific target memory areas ranges Device clock frequency Specifies the target clock frequency this must be consistent with the actual target Chipcon CC1010 Flash Programmer Biel E HES he E KeiNC51 EXAMPLES Chipcon ade ade hex Browse Parallel port Device Clock Frequency MH zt Ier sl Ju age D Action to Perform e Erase Program amp Verify Erase amp Program Est Verify Device against HEX File Le C Read Program Memory from Device and Write to HEX File Perform Flash Memory Test m Memory Lock Options I Write Protect Boot Block J Read Protect Whole Memory Device Information Get From Device Device ID Im Chipcon CC1010 Rev 1 No Read Lock No boot write lock Lock Status Upper D bytes write locked Figure 25 CC10101DE utility Flash programmer Memory Write Protection AM bdo E S 4 Program Files Chipcon Page 53 of 70 It Operation completed successfully I I I I I I Documentation i l I Flash Programmer I I I SmartRF Studio E Chipcon Products from Texas Instruments All though the flash programmer normally expects user dialog through the graphical interface it still maintains f
31. guration _ RtxTiny2 Port configuration UART control configuration Eege DES data encryption Chipcon Etc uv2 CUL overview LIB Figure 15 Library files da TEXAS INSTRUMENTS CRC checksum calculation Simple Packet Protocol SPP Etc Application examples overview EXAMPLES Simple UART communication echo function RS232 modem communication Etc SWRU057 Page 19 of 70 E Kan e Products from Texas Instruments Hardware Definition Files HDF The hardware definition files define register addresses interrupt vector mapping and other hardware constants They also include useful macros for the CC1010EB and all definitions generally support both assembly and C language Application Examples source code Chipcon Utility Library CUL Standard C Hardware Abstraction Library Libraries HAL Hardware Definition Files CC1010EB h LED ON LED_OFF etc HDF Reg1010 h RFBUF INUM_RF etc Figure 16 Hardware Definition Files HDF Hardware Abstraction Library HAL To support quick and easy program development Chipcon provides a library of macros and functions that simplify hardware access on the CC1010 These are located in the Hardware Abstraction Library HAL and implement a hardware abstraction interface for the user program As a result the user program can access the microcontroller peripherals etc via function macro calls without specific k
32. he AD2 pin activates the ADC for channel 2 reads the RSSI output voltage and converts it to an approximation of the incoming signal s strength in dBm range is appr 110 to 50 dBm The value obtained is approximate and most valid for a signal 600 MHz The accuracy should be no worse than 10 dBm at any frequency An RSSI filter circuit of one capacitor and one resistor is required to be connected to the AD2 pin externally see datasheet for details This function disrupts user ADC operation and does not restore the ADC to its former state The function can be used as a carrier sense if the returned value is compared to some relatively low threshold Arguments void Return char The approximate signal strength of the incoming signal in dBm j SWRU057 Page 32 of 70 da EXAS INSTRUMENTS E Kan e Products from Texas Instruments byte halRFReceivePacket byte timeOut byte packetData byte maxLength char rssiByte word clkFreq Description Used to receive a packet sent using halSendPacket on another CC1010 The current modem RF configuration is used and RX is assumed to be powered up The function waits for a valid syncronization byte RF_SUITABLE_SYNC_BYTE for up to timeOut ms If timed out without receiving the sync byte the function returns 0 If a sync byte is received in time the number of bytes indicated by the packet is received max maxLength bytes and put in the buffer pointed to by packetData after which the funct
33. hipcon CC1010 Flash Programmer lel E HE file C Chipcon CC1 O10 Test1 Testl HEX Browse Parallel port Device Clock Frequency MHz em DI 14 7456 DI Action to Perform Erase Program amp Verity Erase amp Program Ext Verify Device against HEX File Head Program Memory from Device and write to HEX File Perform Flash Memory Test Memory Lock Options e p Device Information gt F Write Protect Boot Block T Read Protect whole Memory Get From Device Device ID l Memory Write Protection S Lock Status fa Memory Unlocked 7 Figure 34 Tutorial write application to CC1010 without debug mode j SWRU057 Page 63 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments Write debug monitor to the CC1010 The CC1010EB supports debugging based on a so called debug monitor This embedded software module monitors and schedules debug commands that arrive from the user PC on the asynchronous serial link CC1010EB debugging is enabled by downloading the debug monitor to the CC1010EB The CC1010 application will be downloaded to the CC1010 when the debug process is initiated From the Tools menu choose Write Debug Bootloader To CC1010 Flash Chipcon CC1010 Flash Programmer Bisi x HEX file Kran 01 0D ebugMon D ebugB ootLoader hex Browse Parallel port Device Clock Frequency MHz em DI 14 7456 DI Action to Perform Erase Progr
34. hipcon uart uart_2 c ioj E _ include lt chipcon hal bh include lt chipcon cc1010eb h gt Re Erdo i Include libraries HDF HAL Standard C Main function int main void DA Call HAL macro dos Lot he e CC10 VDT ENABLE FALSE 0 will reset at regular intervals UARTO with polled Iv0 UARTO SETUP 57600 CC1010EB_CLKFREQ UART_NO_PARITY UART_RE_TX UART_POLLED seiner as Function that demonstrates the use 7of the UART HAL RX primitive Loop process user requests int receiveFile byte xdata buffer while running 1 de int 1 byte b Er Receive characters from file until end of line Recs line feed or nul character length Een for Ce ig i F b ASCII_LF amp amp b ASCII_NUL amp amp i lt 1024 Display transfer status and user instructi EE Le printf nTransferred d bytes ok y n length lt Get eee from Liste Sceived mreeter in buffer seanf c Sei Call standard C functions Keil adaptation for RS232 Return number of received characters Z desptay file conte return i echoFile amp fileBuf length H Ee SE Function that demonstrates the use H Loof the UART HAL TE primitive void echoFile byte xdata buffer int length ose UART channe ee UARTO_CLOSE Call HAL macro TX function D Send all bytes previously receive 4 for i 0 i lt length i buffer
35. ian order In the case of three keys triple des the three keys must lie on key 0 key 6 key 8 key 14 and key 16 key 22 all in big endian order DES NORMAL 2 COMPACT_KEY can be used to convert a regular DES key to the compact form A key can be generated by simply using 7 random bytes word length The number of bytes to perform the encryption decryption on Return byte A pointer to the start of buffer is returned j SWRU057 Page 26 of 70 da EXAS INSTRUMENTS E Kan e Products from Texas Instruments bool halFlashWritePage byte code flashPage byte xdata ramBuffer word clkFreq Description Writes into the flash page pointed to by flashPage 128 bytes of data pointed to by ramBuffer The addresses of both flashPage and ramBuffer must be an integer multiple of 128 i e adr mod 128 0 clkFreq must be the XOSC frequency in kHz and is used to calculate the correct erasure and programming times If these conditions are not met the function does not perform any programming and returns FALSE A verification of the data written is performed after programming if this verification fails for some reason flash page is write locked or flash programming failure the function also returns FALSE All interrupts are turned off while this function executes Arguments byte code flashPage Pointer to the destination of the write in code memory space Address must be an integer multiple of 128 bytes byte xdata ramB
36. ing the ADC it must be powered up using the ADC_POWER bool macro It should be powered down again when not in use to conserve power The correct ADC input must be selected using the ADC_SELECT_INPUT input macro and started using the ADC_RUN bool macro for continuous modes The ADC_SAMPLE_SINGLE macro is used to initiate a sample acquisition in single conversion mode and the ADC_RUNNING macro can be used to determine whether the sample is complete The ADC_GET_SAMPLE_10BIT or ADC_GET_SAMPLE_8BIT macros return the latest sample value Arguments byte options Selects operational mode word clkFreq The XOSC clock frequency in kHz byte threshold The threshold value for generating interrupts and stopping in multi conversion stopping mode or reset in multi conversion reset generating mode Return void j SWRU057 Page 21 of 70 da EXAS INSTRUMENTS E Kaal ez Products from Texas Instruments void halConfigRealTimeClock byte period Description This function configures the realtime clock In order for the realtime clock to function the 32 kHz oscillator must be connected to a 32 kHz crystal or a 32 kHz clock signal must be available on pin XOSC32_Q1 The 32 kHz oscillator must be started up and stable before the RTC is activated The realtime clock must be started by using the macro RTC_RUN TRUE Arguments byte period The desired period between interrupts in seconds Return void D Texas SWRU057 Page 22 of 70 I
37. ion once for each RX TX channel pair that will be used by the program before they are used and whenever the supply voltage or temperature has changed significantly The application Chipcon SmartRF Studio should be used to generate this data structure Arguments RF_RXTXPAIR_SETTINGS code rf_settings Pointer to a RF_RXTXPAIR_SETTINGS data structure containing the settings for an RX TX channel pair exported from SmartRF Studio RF_RXTXPAIR_CALDATA xdata rf_caldata A pointer to a RF_RXTXPAIR_CALDATA data structure which will be filled with the results from the calibration Return void j SWRU057 Page 29 of 70 da TEXAS INSTRUMENTS E Kan e Products from Texas Instruments void halRFOverrideDataFormat byte dataFormat Description Function used to override the data format normally specified by an RX TX pair If this function is called before halRFSetRxTxOff it uses the parameter passed to this function instead of whatever the RX TX pair defines If it is passed during an RF operation i e after halRFSetRxTxOff is called the parameter passed is immediately updated in hardware Arguments byte dataFormat RF data format To disable the override the function must be called with the parameter RE NO OVERRIDE Return void void halRFOverrideOutputPower byte txPower Description Function used to override the RF TX output power normally specified by an RX TX pair If this function is called be
38. ion returns the number of bytes received THIS FUNCTION ASSUMES THAT TIMER3 IS AVAILABLE Arguments byte timeOut Timeout for reception of valid synchronization byte in tens of ms A value of zero gives an infinite timeout byte packetData A pointer to a buffer for the received data byte maxLength The maximum number of bytes to receive max packet size 253 bytes Char rssiByte If this pointer is different from NULL an RSSI measurement is performed after receiving the sync byte using the halReadRSS function and its return value stored in the byte pointed to by rssiByte word clkFreq The XOSC clock frequency in kHz Return byte The actual number of bytes received or 0 if timed out CRC error j SWRU057 Page 33 of 70 da TEXAS INSTRUMENTS E Kan e Products from Texas Instruments void halRFSendPacket byte numPreambles byte packetData byte length Description Used to send a packet using the current RF configuration It is assumed that halRFSetRxTxOff has been called with the appropriate RX TX pair and mode RF_TX First numPreambles preamble bytes RF_PREAMBLE_BYTE are transmitted followed by a synchronization byte RF_SUITABLE_SYNC_BYTE the length byte the data pointed to by packetData length bytes and then finally the CRC 16 CCITT of the data Arguments byte numPreambles The number of preamble bytes RF_PREAMBLE_BYTE to transmit byte packetData A pointer to the actual data t
39. is to be transmitted If read is TRUE the received data will overwrite this data word length The number of bytes to receive transmit bool enableRead Overwrite the data transmitted with the received data TRUE or ignore received data FALSE Return void void halWait byte timeOut word clkFreq Description A wait functions which performs a number of iterations of a simple wait loop so that at least timeOut ms goes by before the function returns Arguments byte timeOut The time to wait in ms word clkFreq The XOSC clock frequency in kHz Return void j SWRU057 Page 35 of 70 da TEXAS INSTRUMENTS E Kaal ez Products from Texas Instruments void halSetPort byte portNum byte dataByte Description Function which sets data for an entire port Arguments byte portNum Port identification byte dataByte Data value to be placed on the requested port Return void void halSetPortBit byte portNum byte bitNum byte dataBit Description Function which sets port data bitwise Arguments byte portNum Port identification byte bitNum Bit identification DI Isb bit7 msb byte dataBit Data value to be placed on requested port bit Return void An SWRUO057 EXAS INSTRUMENTS Page 36 of 70 E Kaal ez Products from Texas Instruments void halSetPortBitDir byte portNum byte bitNum byte direction Description Function which sets the direction in out for one specific por
40. je je i L E DES Encryption Decryption Hesh A Mengt EI Registers Ports Ro 0x00 prial port Power amp Clock Control R1 0x00 eg P A en Radio amp Modem 57600 CC1010EB_CLKFREQ UART_NO_PARITY UART_TX_ R3 0x00 Serial Interfaces ever 0x00 Timers P3DIR 0xA7 0x01 0x00 S P3DIR O0xA7 0xFD 0x00 Target Settings TXD OxBO 1 0x00 Invalidate Cache CKCON 0x8E 0x10 POON Nv871_ PNfNyAanh ACC DE x00 B OxF 0 0x00 B SP 0x81 0x21 Clock div fi 040 gt Freq J 10633 Hz DPTROL 0x0 DPTA1 pi S Mode Single conversion Yf Active zl DPS 0x86 0x00 MPAGE L 0x00 Voltageref VDD zl Comp tress fo PC O0 PSW 0x 0x00 Analog input ADO pin D IE 0x88 Ge IP 0xB8 ech Data output 214 I Run EICON 0 Oxf0 EXIF 0x 0x08 EIE OES Ore0 EIS Ore0 PCON 0 0x30 o ADC dLenmoeaniegeelepzsps a IERCH RCRCH SllGunninag in Eval Mode 2K a Load C Chipcon scC1010 Test I Test1 I Num scrL Rw 4 Figure 37 Tutorial debug the CC1010 peripherals j SWRU057 Page 66 of 70 d TEXAS INSTRUMENTS E Kaal ez Products from Texas Instruments Evaluating the CC1010 performance To evaluate the CC1010 performance Chipcon offers a CC1010EB which integrates a number of components to facilitate thorough testing of the CC1010 See the CC1010DK User Manual for details regarding setup and operation Basic setup procedure
41. ng source and assembler files However it also provides syntax highlighting and other helpful functionality such as GUI needed for simulation debugging disassembly register dumps memory dumps watch windows instruction stepping etc In addition the IDE provides the interfaces towards the DLL used for simulation and in circuit debugging Since the compiler assembler linker is integrated in the development platform the IDE in effect hides the invocation of these tools More specifically the compiler converts one or more C source files into assembly code which together with any handwritten assembler files are fed to the assembler The assembler then produces object files machine code and binary data which in turn are fed into the linker together with any precompiled libraries Finally the linker isolates functions and variables that are actually used and produces an executable file in Intel HEX format that can be downloaded into the FLASH memory of a CC1010 j SWRU057 Page 3 of 70 da EXAS INSTRUMENTS E Chipcon Products from Texas Instruments Documentation In addition to the files related to the use and functionality of the CC1010 the CC1010IDE includes a set of documentation files i e CC1010DK User Manual that provide details of the CC1010 platform The CC1010IDE documentation and software files are specified in later chapters and distributed as follows shaded boxes indicate location of the Chipcon files C51
42. nowledge about the hardware details Application Examples source code Chipcon Utility Library CUL Standard C Hardware Abstraction Library HAL br halRFSendPacket etc Libraries HAL E eS Hardware Definition Files HDF Figure 17 Hardware Abstraction Library HAL Chipcon Utility Library CUL Besides the HAL module the CC1010IDE also provides a library of RF communication building blocks located in the Chipcon Utility Library CUL This library offers useful support for typical RF applications and eventually it will provide a full RF protocol Application Examples source code Chipcon Utility Library CUL h culCRC16 sppReceive etc CUL Standard C Hardware Abstraction Library Libraries HAL Hardware Definition Files HDF Figure 18 Chipcon Utility Library CUL j SWRU057 Page 20 of 70 da TEXAS INSTRUMENTS E Kan e Products from Texas Instruments HAL library reference void halConfigADC byte options word clkFreq byte threshold Description This function configures the ADC An interrupt is generated in all modes except for reset generating mode in which a reset is generated instead whenever the 8 MSB of the measured sample is greater or equal to the threshold value Thus if an interrupt for each sample is desired the threshold should be set to 0 and the ADC and GLOBAL_ADC_DES interrupts enabled After configur
43. o far During CRC checking after working through all the data and the appended CRC 8 value the value will be 0 if the data is intact j SWRU057 Page 41 of 70 da TEXAS INSTRUMENTS E Kan e Products from Texas Instruments word culFastCRC16 byte crcData word crcReg Description A CRC 16 CCITT implementation optimized for fast execution The function should be called once for each byte in the data the CRC is to be performed on Before the invocation on the first byte the FAST_CRC16_INIT macro should be called This final CRC value should be added at the end of the data to facilitate a later CRC check During checking the check should be performed on all the data AND the CRC 16 value appended to it The data is intact if the value returned is 0 Arguments byte crcData The data to perform the CRC 16 operation on word crcReg The current value of the CRC register For each additional byte the value returned for the last invocation should be supplied Return word The updated value of the CRC16 register This corresponds to the CRC 16 of the data supplied so far During CRC checking after working through all the data and the appended CRC 16 value the value will be 0 if the data is intact j SWRU057 Page 42 of 70 da TEXAS INSTRUMENTS E Kan e Products from Texas Instruments byte sppReceive SPP_RX_INFO xdata pRXInfo Description If the transceiver is ready in idle mode the receive section will be powered up
44. o transmit byte length The number of bytes to transmit Max 253 Return void void halRFSetRxTxOff byte mode RF_RXTXPAIR_SETTINGS code rf_settings RF_RXTXPAIR_CALDATA xdata rf_caldata Description Function used to set a specific RX TX channel pair as the current RF configuration The mode parameter is used to select between activating RF in RX or TX or turning off RF Arguments byte mode Options given below Turn off turn on in RX or on in TX If RF_OFF is supplied the two pointers can be NULL RF_RXTXPAIR_SETTINGS code rf_settings Pointer to a RF_RXTXPAIR_SETTINGS data structure containing the settings for an RX TX channel pair exported from SmartRF Studio RF_RXTXPAIR_CALDATA xdata rf_caldata A pointer to a RF_RXTXPAIR_CALDATA data structure which will be filled with the results from the calibration Return void void halSpiTransferBlock byte inoutBuffer word length bool enableRead SWRU057 Page 34 of 70 Ww TEXAS INSTRUMENTS E Kaal ez Products from Texas Instruments Description Transfers length bytes of the data block pointed to by inoutBuffer over the SPI interface It is assumed that the SPI interface has already been correctly configured If read is TRUE the incoming data on the SPI interface will be stored in place in inoutBuffer overwriting the data that is transmitted otherwise the received data is ignored Arguments byte inoutBuffer Pointer to a block of data that
45. ory macro invocation of ISR_TIMERx_ADJUST m at the start of the timer ISR Return ulong In timer mode the actual period in microseconds between interrupts or zero if the period is impossible to achieve In counter mode Zero if the supplied count value is impossible to achieve otherwise one j SWRU057 Page 23 of 70 da EXAS INSTRUMENTS E Kan e Products from Texas Instruments ulong halConfigTimer23 byte options ulong period word clkFreq Description This function configures timer 2 or 3 depending on the value given in option as either an interrupt timer an interrupt is generated at certain intervals in time as specified by period or a pulse width modulator PWM If period is specified as 0 then in timer mode the timeout period will be set to the maximum possible and in PWM mode the period will be set as long as possible Using the PWM mode of timer 2 3 overrides the normal operation of ports P3 4 P3 5 and can thus not be used in conjunction with timer 0 1 configured as counters The duty cycle is set to 50 128 255 initially in PWM mode The timer PWM must be started with macro TIMERx_RUN TRUE Arguments byte options Options indicating which timer to configure and how ulong period The desired period between interrupts in microseconds In PWM mode the duty cycle will be set as close to 50 as possible This duty cycle can be changed in an ISR or at any other time by using the appropriate PWMx_SET_DUTY_CYCL
46. r Analog Devices E AnchorChips ER Atmel EI Atmel Wireless amp uC Cybernetic Micro Systems a Cygnal Integrated Product E Cypress Semiconductor Figure 8 CC1010 device profile for Keil full version SWRU057 Page 12 of 70 d TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments After choosing the desired device profile right click on Target CC1010 and choose Options for Target CC1010 Wi Testi p ision2 File Edit view Project Debug Peripherals Tools SYCS Wir asa s eelacleen Translate File Stop build Gg Files to Group Targets Groups Files Remove Item Figure 9 Target options j SWRU057 Page 13 of 70 EXAS INSTRUMENTS E Chipcon Products from Texas Instruments Configure memory and clock profile Choose the Target tab to configure the memory and clock profile for the CC 1010 target Basically the CC1010 is driven by an oscillator and it supports on chip ROM XRAM For debug operation it is necessary to allocate some memory for the debug monitor as a result the target will offer slightly less ROM RAM space for the CC1010 application Thus to enable CC1010 debugging ensure that the options Use On Chip ROM XRAM are selected For consistency please refer to following recommendation Options for Target CC1010 20x Target Output Listing c51 A51 BL51 Locate BL51 Misc Debua Chipcon
47. s All other trademarks and registered trademarks are the sole property of their respective owners SWRU057 Page 70 of 70 da TEXAS INSTRUMENTS
48. s byte crcData The data to perform the CRC 16 operation on word crcReg The current value of the CRC register For the first byte the value CRC16_INIT should be supplied For each additional byte the value returned for the last invocation should be supplied Return word The updated value of the CRC16 register This corresponds to the CRC 16 of the data supplied so far During CRC checking after working through all the data and the appended CRC 16 value the value will be 0 if the data is intact j SWRU057 Page 40 of 70 da TEXAS INSTRUMENTS E Kan e Products from Texas Instruments byte culFastCRC8 byte crcData byte crcReg Description A CRC 8 DOW implementation optimized for fast execution The function should be called once for each byte in the data the CRC is to be performed on Before the invocation on the first byte the FAST_CRC8_INIT macro should be called This final CRC value should be added at the end of the data to facilitate a later CRC check During checking the check should be performed on all the data AND the CRC 8 value appended to it The data is intact if the value returned is 0 Arguments byte crcData The data to perform the CRC 8 operation on byte crcReg The current value of the CRC register For each additional byte the value returned for the last invocation should be supplied Return byte The updated value of the CRC8 register This corresponds to the CRC 8 of the data supplied s
49. t bit Arguments byte portNum Port identification byte bitNum Bit identification DI Isb bit7 msb byte direction Port direction in 1 out 0 Return void void halSetPortDir byte portNum byte direction Description Function which sets the direction for an entire port Arguments byte portNum Port identification byte direction Port direction in 1 out 0 Return void j SWRU057 da EXAS INSTRUMENTS Page 37 of 70 E Kaal ez Products from Texas Instruments byte halGetPort byte portNum Description Function which gets current data value on requested port Arguments byte portNum Port identification Return byte Current data value on requested port byte halGetPortBit byte portNum byte bitNum Description Function which gets the current value on one specific port bit Arguments byte portNum Port identification byte bitNum Bit identification DI Isb bit7 msb Return byte Current value on requested port bit j SWRU057 Page 38 of 70 da EXAS INSTRUMENTS E Kan e Products from Texas Instruments CUL library reference byte culSmallCRC8 byte crcData byte crcReg Description A CRC 8 DOW implementation optimized for small code size The function should be called once for each byte in the data the CRC is to be performed on For the invocation on the first byte the value CRC8_INIT should be given for crcReg The value returned is the CRC 8 of the d
50. tion just choose CC1010 To configure the CC1010 device for debug operation however choose CC1010_debug This will dedicate specific memory ranges in the CC1010 RAM ROM to the so called debug monitor an embedded software module that drives the debug process i e instruction stepping on the CC1010 based on commands from the CC1010IDE via RS232 Note that the evaluation version of Keil IDE does NOT support Extended Linker Select Device for Target Target 17 21x cPu Vendor Chipcon Device CC1010_debug J Use Extended Linker X51 instead of BL51 Family MCS 51 E Use Extended Assembler 451 instead of 51 Data base Description Analog Devices 8051 based High Speed Micro with RF transceiver and 3 channel 10 bit Al H Atmel 2 DPTRs WDT 2 Serial Ports RTC DES in hardware 2 extra timers Pw S Atmel Wireless amp uC Chipcon 6 cc1010 _ ia DU debug Cybernetic Micro Systems Cygnal Cypress Semiconductor Daewoo Dallas KK Domosys Generic Hyundai A s e Version configured for debug support OG Figure 7 CC1010 device profile for Keil evaluation version j SWRU057 Page 11 of 70 d TEXAS INSTRUMENTS C Chipcon Products from Texas Instruments Remember to always choose Extended Linker when using the full version of Keil IDE Select Device for Target Simulato
51. truments The 8051 compiler assembler linker and debugger are limited to 2 Kbytes of object code but source code can be any size Programs generating more than 2 Kbytes of object code will not compile assemble or link The debugger supports 2 Kbyte files or smaller Programs begin at offset 0x0800 No hardware support is available for multiple DPTR registers No support is available for user libraries or floating point arithmetic The following Code Banking Linker Library Manager and RTX 51 Tiny Real Time Operating System which are present in the PK51 Full Version are not included in the PK51 C51 Eval Version It is not possible to generate assembler source files or use in line assembler features For general limitations on the Keil uVision2 compiler please refer to C51 User s Guide da TEXAS SWRU057 Page 10 of 70 INSTRUMENTS E Kal wes Products from Texas Instruments Setting up a software project for the CC1010 Before the CC1010IDE can generate any target software it needs a software project with consistent references to the actual target platform These references can be specified in the target configuration dialog Configure target profile The initial step of target configuration is device association right click on Target CC 1010 and choose Select device for target Then browse the Chipcon folder and associate a device profile with the desired operation mode For normal CC1010 run time opera
52. ts Build executable code for the CC1010 The final step in creating a CC1010 application is the build process Based on the original source files this will produce an executable file for the CC 1010 target Right click on Source Group 1 and choose Rebuild target Testi p ision2 File Edit View Project Debug Peripherals Tools SVCS Window Help eer lo A3 9 S K k include lt chipcon hal h gt E Select Device for Target CC1010 L L Options for Group Source Group 1 Open File Rebuild target Translate File Stop build Add Files to Group Source Group 1 Targets Groups Files Remove Group Source Group 1 and it s Files Figure 33 Tutorial build application for CC 1010 SWRU057 Page 62 of 70 TEXAS INSTRUMENTS E Chipcon Products from Texas Instruments Write application to the CC1010 without debug option After the application is built it is ready for the target CC1010 FLASH To write the application to the CC1010 target choose Tools menu and then click on Write current Hexfile to CC1010 Flash Alternatively run the flash programming as stand alone from C Program Files Chipcon Flash Programmer ccprog exe Verify port and device clock frequency and then choose Do it to execute the write process The CC1010 application will now execute as soon as the CC1010 target i e Evaluation Board is reset C
53. txt 1 New file 2 Transmit file PC gt CC1010EB Filename Testt tet Open 9 End program LS Files of type Text file TXT S Cancel Select a menu option 2 Terminal program choose Transfer Send Text File to transmit Transferred 25 bytes PC gt CC1010EB ok y n _ e 4 L r eg Figure 22 Application example file transfer from PC to CC1010EB Type 3 to transfer file from CC1010EB to the PC then verify content FA Test1 txt Notepad ife Eg Kies File Edit Yiew Call Transfer Help File Edit Search Help This is a test file tt Del 213 aale Menu for Testl txt 1 New file 2 Transmit file PC gt CC1010EB 3 Receive file CC1010EB gt PC 9 End program Select a menu option 3 File content This is a test file Figure 23 Application example file transfer from CC1010EB to PC SWRU057 Page 51 of 70 EXAS INSTRUMENTS E Chipcon Products from Texas Instruments Generic examples In addition to the Chipcon specific application examples developed for the CC1010 platform Keil provides numerous generic sample programs To examine these examples and corresponding source files refer to the directories indicated below ASM BIN EXAMPLES ADI 83X ASM BADCODE Bank_EX1 BLINKY Chipcon CSAMPLE Dallas 390 DES DHRY FarMemory HELLO Infineon C517 MEASURE Philips 8
54. uces only a single bit error in the decrypted plaintext In CFB OFB mode an initialization vector of 8 bytes is part of the algorithm This vector must be identical for the encryption and decryption process The choice of initialization data does not affect the security of the encryption in any way and this function thus uses the value 0 option is used to chose between these modes of operation between single DES and triple DES and between decryption and decryption This function does not return until all data has been encrypted decrypted since the DES hardware is so fast The DES hardware can run at the same time as the 8051 and generate an interrupt when finished If this is desired the hardware must be programmed directly Arguments byte options One or more of the below defined constants define the desired operational mode DES GINGLE DES DES_TRIPLE_DES DES ENCRYPT DES DECRYPT DES OEB MODE DES_CFB_MODE byte xdata buffer Pointer to the data to encrypt decrypt in XDATA memory space The address of buffer must be divisible by eight i e address buffer mod 8 0 byte xdata key A pointer to a key or three keys for triple DES stored in XDATA memory space This address must be divisible by eight i e address key mod 8 0 The 56 active bits of a DES key are expected to be in a compressed 7 byte format in which all parity bits are removed In the case of a single key the 56 bits of the key must lie on key 0 key 6 in big end
55. uffer Pointer to the data source in RAM for the write in XDATA memory space Address must be an integer multiple of 128 bytes word clkFreq The XOSC clock frequency in kHz Return bool TRUE if the write was successful False if programming verification failed or supplied arguments were invalid 4 SWRU057 Page 27 of 70 INSTRUMENTS E Kaal ez Products from Texas Instruments void halRandomNumberGen byte rnd_data word length Description This function activates the true RNG in the CC1010 waits long enough for the output to be truly random and then samples individual random bits with a period that ensures that the output is sufficiently random This function must never be used at the same time as RF is in use A total of _length_ bytes of random data is stored at the location pointed to by rnd_data Arguments byte rnd_data A pointer to a buffer to receive the random bytes word length The number of random bytes to generate Return void A SWRU057 Page 28 of 70 EXAS INSTRUMENTS E Kan e Products from Texas Instruments void halRFCalib RF_RXTXPAIR_SETTINGS code rf_settings RF_RXTXPAIR_CALDATA xdata rf_caldata Description Performs the necessary RF calibration for an RX TX channel pair with the settings specified by the RF_RXTXPAIR_SETTINGS data structure pointed to by rf_settings The results of the calibration are stored in the RF_RXTXPAIR_CALDATA data structure pointed to by rf_caldata Call this funct
56. ull command line support Execute the following command line to display all flash programming options C Program Files Chipcon Flash Programmer ccprog exe h CCPROG EXE Commandline Options E CCPROG Chipcon CC1010 Flash Programming Utility Usage ccprog exe pvrsRg port W val c Freq hex file Filename pP Program hexfile into device and verify immediately No interactivity in the GUI Uses options supplied or default values Returnvalue is lt gt 0 if verify Fails Bi Verify hexfile against program memory in device No interactivity in the GUI Uses options supplied or default values r Read program memory in device and store in hexfile No interactivity in the GUI Uses options supplied or default values 5 Program amp verify device Only allow the user to change the clock frequency and parallel port Show default values For these lport Use parallel port LPT port W val Write protect upper part of memory according to val 1 512 bytes 2 1024 bytes 3 2048 bytes 4 4096 bytes 5 8192 bytes 6 16384 bytes 7 All of the memory Adding 8 to any of the above values will seperately write protect the boot block first page R Read protect whole memory cfreq The target device clock Frequency in MHz g No GUI Output status to stdout and progress output to stderr Unimplemented Figure 26 CC10101DE utility Flash programmer help Example usage 1 ccprog exe p I LPT1 c 14 7456
57. ully detected Please continue Figure 5 CC1010IDE installation start j SWRU057 Page 8 of 70 INSTRUMENTS E Chipcon Products from Texas Instruments The CC1010IDE installation covers multiple components that can be selected based on individual needs However a default installation profile is used unless specified otherwise To change the suggested profile just browse the Select Components dialog and select deselect components as you prefer InstallShield Wizard xi Select Components Pis el chipcon velopment Took Choose the components Setup will install Destination path C Digital Keil Description EEPE Software Development tools Examples CC1010 hardware definition Libraries header files code libraries Keil device database entries for the Debug extensions CC1010 example programs g Device database Keil plug ins that allow in circuit je Documentation debugging and Flash E ga Utilities Programming utility wi SmartRF Studio wi Flash Programmer Space Required on C 10868 K Space Available on C 93719 K InstallShield lt Back Cancel Figure 6 CC1010IDE installation components P SWRU057 Page 9 of 70 INSTRUMENTS E Please note that the evaluation version of Keil uVision2 accompanying the CC1010IDE distribution imposes certain restrictions limitation on the compiler PK51 C51 Compiler Chipcon Products from Texas Ins
58. ure CC1010IDE integrity separate module upgrades updates should not be installed without prior Chipcon recommendation In general Chipcon will notify the user whenever a new CC1010IDE upgrade is available Depending on what CC1010IDE module s are affected the user will be able to receive a patch or complete upgrade However in case of intermediate Keil upgrades updates the user will have to refer to technical support at Chipcon in order to verify consistency with the CC1010IDE CC1010IDE main modules Keil uVision2 IDE Flash programmer SmartRF Studio Debug extensions DLL plug in s for in circuit debugger etc Libraries i e HDF HAL CUL Support In order to get upgrades or technical support for CC 1010 please access the following links http Awww Keil com product softmaint htm http Awww chipcon com j SWRU057 Page 56 of 70 da EXAS INSTRUMENTS E Chipcon Products from Texas Instruments Tutorial To quickly and safely create a CC1010 application Chipcon recommends that the user begins by creating a software project This will serve as a reference for the IDE when processing the different source files for the CC1010 target Build a CC1010 software application Create a new software project From the Project menu choose New Project Then create select project folder name Save in a Test D Si cl 21 Desktop a 3 My Computer cy 3 Floppy L Sai IC
Download Pdf Manuals
Related Search
Related Contents
8017R-TF+ 8017R-7FT+ LF/MF 帯における受信性能 LC-40LE510E Operation DF-20204MXD7 GLOFA GM Series Guida per l`utente rideau lumineux de mesure Sistema valvolare aortico transcatetere Direct Flow Medical DS-862_User manual (EN)_V1 3_2014 0819 Copyright © All rights reserved.
Failed to retrieve file