Home
ELCODIS.COM - ELECTRONIC COMPONENTS DISTRIBUTOR
Contents
1. PBA LI pes 4 Pcik g PD4 PDS GND vea Prototyping Board O OcnofOOlVec RCM2000 PROTOTYPING BOARD Colored side lines up with pin 1 PC COM port Figure 4 RCM2000 Power and Programming Connections 3 Power Supply Connections Hook up the connector from the wall transformer to header J5 on the Prototyping Board as shown above The orientation of this connector is not important since the VIN positive voltage is the middle pin and GND is available on both ends of the three pin header J5 Plug in the wall transformer The power LED on the Prototyping Board should light up The RCM2000 and the Prototyping Board are now ready to be used NOTE A RESET button is provided on the Prototyping Board to allow a hardware reset 10 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 2 4 Where Do I Go From Here We recommend that you proceed to the next chapter and install Dynamic C if you do not already have it installed then run the first sample program to verify that the RCM2000 and the Prototyping Board are set up and functioning correctly If everything appears to be working we recommend the following sequence of action 1 Run all of the sample programs described in Chapter 4 to get a basic familiarity with Dynamic C and
2. 24 watch expressions 24 Starting soonest 18 watch expressions 13 F features Prototyping Board 8 RCM2000 0 ee eeeeeeeeteeeee 1 H hardware connections 9 install RCM2000 on Prototyp ing Board ssns 9 power supply cece 10 programming cable 10 hardware reset eee 10 l interrupt service routines 14 M models factory versions s s s 1 P pinout RCM2000 nosier 2 power supply COMMNECHIONS oo eee 10 programming cable RCM2000 connections 10 Prototyping Board 8 features srania teias 8 mounting RCM2000 9 R RCM2000 mounting on Prototyping BO at seinneann 9 TOSEL eirate eta A 10 S sample programs 60 21 FLASHLED C ee 23 specifications physical and electrical 2 T technical support ee 11 User s Manual Downloaded from Elcodis com electronic components distributor 31 User s Manual Downloaded from Elcodis com electronic components distributor 32 SCHEMATICS 090 0097 RCM2000 Schematic www rabbitsemiconductor com documentation schemat 090 0097 pdf 090 0099 RCM2000 Prototyping Board Schematic www rabbitsemiconductor com documentation schemat 090 0099 pdf 090 0128 Programming Cable Schematic www rabbitsemiconductor com documentation schemat 090 0128 pdf The schematics included with the printed manual were the latest revisions available
3. 3 1 An Overview of Dynamic C Dynamic C integrates the following development functions into one program Editing Compiling Linking Loading Debugging In fact compiling linking and loading are one function Dynamic C does not use an In Circuit Emulator programs being developed are downloaded to and executed from the target system via an enhanced serial port connection Program development and debug ging take place seamlessly across this connection greatly speeding system development Other features of Dynamic C include Dynamic C has an easy to use built in text editor Programs can be executed and debugged interactively at the source code or machine code level Pull down menus and keyboard shortcuts for most commands make Dynamic C easy to use Dynamic C also supports assembly language programming It is not necessary to leave C or the development system to write assembly language code C and assembly lan guage may be mixed together Debugging under Dynamic C includes the ability to use printf commands watch expressions breakpoints and other advanced debugging features Watch expressions can be used to compute C expressions involving the target s program variables or func tions Watch expressions can be evaluated while stopped at a breakpoint or while the target is running its program Getting Started 13 Downloaded from Elcodis com electronic components distributor e Dynamic C provides extensions to the C
4. Getting Started Downloaded from Elcodis com electronic components distributor 21 The various folders contain specific sample programs that illustrate the use of the corre sponding Dynamic C libraries The sample program PONG c demonstrates the output to the STDIO window The COREMODULE folder provides sample programs specific to the RCM2000 Let s take a look at the COREMODULE folder Open Lookin COREMODULE al f opo CORE_PARITY C KEYled C a Extsram c a Led_demo c FlashLED C Swtest c FLASHLED2 C TOGGLELED C FLASHLEDS C Fiename T Files of type Source Files c lib x Cancel Each sample program has comments that describe the purpose and function of the program Before running any of these sample program make sure that your RCM2000 is connected to the Prototyping Board and to your PC as described in Section 2 3 Connections 22 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 4 2 Running Sample Program FLASHLED C This sample program will be used to illustrate some of the functions of Dynamic C First open the file FLASHLED C which is in the Samples COREMODULE folder The pro gram will appear in a window as shown in Figure 5 below minus some comments Use the mouse to place the cursor on the function name WrPortI in the program and type lt Ctrl H gt This will bring up a documentation box f
5. RabbitCore RCM2000 C Programmable Module Getting Started Manual 019 0080 040515 F Downloaded from Elcodis com electronic components distributor RabbitCore RCM2000 Getting Started Manual Part Number 019 0080 0405 15 F e Printed in U S A 2001 2004 Z World Inc All rights reserved Z World reserves the right to make changes and improvements to its products without providing notice Trademarks Rabbit and Rabbit 2000 are registered trademarks of Rabbit Semiconductor RabbitCore is a trademark of Rabbit Semiconductor Dynamic C is a registered trademark of Z World Inc Z World Inc Rabbit Semiconductor 2900 Spafford Street 2932 Spafford Street Davis California 95616 6800 Davis California 95616 6800 USA USA Telephone 530 757 3737 Telephone 530 757 8400 Fax 530 757 3792 Fax 530 757 8402 www zworld com www rabbitsemiconductor com RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor TABLE OF CONTENTS Chapter 1 Overview 1 11 RCM2000 Series DeSsCriptl OD escepte derinti cases cargevssetcunsscaedetesseosea oaea eae ETE EE NET EE EEA 1 1 2 Physical and Electrical Specifications 00 0 cece eeeeeceseeesecaeecaecaesaecsecaeceeceeeeaeseeesaeesaecsecaeeeeaeeas 2 1 3 Development SoftWare sssri ranoni e enai ical gcvsngubes dees a RE a e EE eS 3 14 How to Use This Mania occ is cca sei ssscscsceves tisk dave cacst csobegaeet E AE EE EE AE Ei 4 1 4 1 Additional Product Infor
6. has the advantage of being intuitive Unlike preemptive multitasking variables can be shared between different tasks without having to take elaborate precautions Sharing variables between tasks is the greatest cause of bugs in programs that use preemptive multitasking It might seem that the biggest problem would be response time because of the big loop time becoming long as the program grows Our solution for that is called slicing which is further described in the Dynamic C User s Manual 28 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor NOTICE TO USERS Z WORLD PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORT DEVICES OR SYSTEMS UNLESS A SPECIFIC WRITTEN AGREEMENT REGARDING SUCH INTENDED USE IS ENTERED INTO BETWEEN THE CUSTOMER AND Z WORLD PRIOR TO USE Life support devices or systems are devices or systems intended for surgical implantation into the body or to sustain life and whose failure to perform when properly used in accordance with instructions for use provided in the labeling and user s manual can be reasonably expected to result in significant injury No complex software or hardware system is perfect Bugs are always present in a system of any size In order to prevent danger to life or property it is the responsibility of the system designer to incorporate redundant protective mechanisms appropriate to the risk involved All Z World products are 100 percent
7. ooooo0o000000000 ooooo0o0000000 O00000000000 o 00000000Q0000 Res RCM2000 Through Hole Vcc and GND SMT Prototyping Extension Headers Prototyping Area Buses Area i D O E S T D A T S E L S E a Oa A E T E E E A A y fa Z 5 Figure 2 RCM2000 Prototyping Board 8 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 2 3 Connections 1 Attach RCM2000 to Prototyping Board Turn the RCM2000 so that the Rabbit 2000 microprocessor is facing as shown below Plug RCM2000 Headers J1 and J2 into the sockets of headers J1 and J3 on the Prototyping Board RCM2000 Module Prototyping Board Line up the mounting holes O oooooooo0o0o0000000000 W Q X lt g D S Z z O O oa a 3 S X O a g 8 gt ooooooo0oo0o00000000 07 OOlps URSTC O000000000 oooo000000 oooo0oo000000 oooo0oo000000 oooo0oo0o00000 O00000000 OC00000000000 Ool oo0oo0o0o00000 00 0 O Pa OO pai o000000000 00 O ra OOlpas E E T 000000000000 0 0 0 Osen OO woo EEA O0000000000 oo0oo0oo0o00000000 0 0 0O O pad OOlpas O000000000 ooo0oo0o0000000 0000 O pag OOlpaz oooo0o0o000000 0 0 0 0 O rad OOlpai ooo0oo0o000000 0 0 0 0 O Opai OOlpas3 oo0oo0o000000000 00 0O O
8. Development Kit Getting Started 1 Downloaded from Elcodis com electronic components distributor 1 2 Physical and Electrical Specifications Table 2 lists the basic specifications for all models in the RCM2000 series Table 2 RCM2000 Specifications Specification Data Power Supply 4 75 5 25 V DC 120 mA at 25 8048 MHz clock speed Size 1 90 x 2 30 x 0 55 inches 48 3 x 58 4 x 14 mm Environmental 40 C to 70 C 5 95 humidity noncondensing NOTE For complete product specifications see Appendix A in the RabbitCore RCM2000 User s Manual The RCM2000 series modules have two 40 pin headers to which cables can be connected or which can be plugged into matching sockets on a production device The pinouts for these connectors are shown in Figure below J2 J1 A12 Tm 2 A11 GND _ 3 VCC A100 o of A9 PAO C o o 0 PA A8 C o A7 PA2 O o o 0 PA3 A6 Jo of AS PA4 _ 5 o 0 PAS A4 o of J A3 PA6 C o o 0 PA7 A20 o 0 A1 PBO C PB1 AOC o 4 STATUS PB2 C o PB3 PC0oC PC1 PB4 C PB5 PC2 5 0 PC3 PB6 CO PB7 PC4C o o 0 PC5 PCLK C 2 GND PC6 C o 0 PC7 D7 OJo o D6 PD
9. again since the program is running at full speed 24 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor You can set break points while the program is running by positioning the cursor to a state ment and using the F2 key If the execution thread hits the break point a break point will take place You can toggle the break point off with the F2 key and continue execution with the F9 key Try this a few times to get the feel of things 4 3 3 Editing the Program Click on the Edit box on the task bar This will set Dynamic C into the edit mode so that you can change the program Use the Save as choice on the File menu to save the file with a new name so as not to change the demo program Save the file as MYTEST C Now change the number 25000 in the for statement to 10000 Then use the F9 key to recompile and run the program The LED will start flashing but it will flash much faster than before because you have changed the loop counter terminal value from 25000 to 10000 4 3 4 Watching Variables Dynamically Go back to edit mode select edit and load the program FLASHLED2 C using the File menu Open command This program is the same as the first program except that a vari able k has been added along with a statement to increment k each time around the endless loop The statement runwatch has been added This is a debugging statement that makes it possible to view variables while the program
10. at the time the manual was last revised The online versions of the manual contain links to the latest revised schematic on the Web site You may also use the URL information provided above to access the latest schematics directly Getting Started 33 Downloaded from Elcodis com electronic components distributor Downloaded from Elcodis com electronic components distributor
11. psa OOlpss ooo0oo0o0o00000 0 0 0 0 0O 0O pa e OOlpa7 ooo0oo0o000000 00 0 0 O Orc O Olend ooooo0oo00000000000 bs OO p4 ooooo0oo0oo0000000000 b3 OO p2 oooooo0oo0o000000000 01 OO po oooo0oo0o00000000 0 0 O Fez OOlpes oo0oo0oo000000000 000 Ores OO pes ooo0oo0o0o000000 00 0 0 O Fes OOlpe2 ooo0oo0o000000000 00 O r OOjpeo oo0oo0o0o000000 00 0 0 0 Onrw O Ohio Q 26 5 o Figure 3 Attaching RCM2000 to Prototyping Board NOTE Itis important that you line up the pins on the RCM2000 headers J1 and J2 exactly with the corresponding pins of headers J1 and J3 on the Prototyping Board The header pins may become bent or damaged if the pin alignment is offset and the RCM2000 will not work Getting Started 9 Downloaded from Elcodis com electronic components distributor 2 Connect RCM2000 to PC Connect the 10 pin connector of the programming cable labeled PROG to header J3 on the RCM2000 module as shown in Figure 4 below Be sure to orient the red edge of the cable towards pin 1 of the connector Do not use the DIAG connector which is used for a normal serial connection The holes shown near J1 and J2 at the top of the RCM2000 exist to align the board for factory testing Do not use these holes for mounting RCM2000 Module O vcc GND Y 1 2 PA1 PAO s a PA3 paz C1 Ar RESET fim PA Uy SWITCH PAS O
12. the RCM2000 s capabilities 2 For further development refer to the RabbitCore RCM2000 User s Manual for details of the module s hardware and software components A documentation icon should have been installed on your workstation s desktop click on it to reach the documentation menu You can create a new desktop icon that points to default htm in the docs folder in the Dynamic C installation folder 3 For advanced development topics refer to the Dynamic C User s Manual also in the online documentation set 2 4 1 Technical Support NOTE If you purchased your RCM2000 through a distributor or through a Z World or Rabbit Semiconductor partner contact the distributor or partner first for technical support If there are any problems at this point e Check the Z World Rabbit Semiconductor Technical Bulletin Board at www zworld com support bb e Use the Technical Support e mail form at www zworld com support support_submit html Getting Started 11 Downloaded from Elcodis com electronic components distributor 12 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 3 INSTALLING DYNAMIC C To develop and debug programs for the RCM2000 series and for all other Z World and Rabbit Semiconductor hardware you must install and use Dynamic C This chapter takes you through the installation of Dynamic C and then provides a tour of its major features with respect to the RCM2000 series
13. 0OC o 0 PD1 D5 Jo o D4 PD20 o o 0 PD3 D3 CL Jo o D2 PD4 C o o 0 PD5 D1 2 o DO PD6 C o 0 PD7 PE7 C o PE6 GND 5 3 vcc PE5 C of PE4 VBAT VRAM PE3 C of PE2 SMODE0 2 SMODE1 PE1 2 o PEO RES_OUT C o 1 RES_IN NOWR OJ 2 O ORD vec _ 5 GND BUFEN C C WDO Note These are the pinouts as seen on the Bottom Side of the RCM2000 Figure 1 RCM2000 Connector Pinout 2 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 1 3 Development Software The RCM2000 series of modules uses the Dynamic C development environment for rapid creation and debugging of runtime applications Dynamic C provides a complete develop ment environment with integrated editor compiler and source level debugger It interfaces directly with the target system eliminating the need for complex and unreliable in circuit emulators Dynamic C must be installed on a Windows workstation with at least one free serial COM port for communication with the target system See Chapter 3 Installing Dynamic C for complete information on installing Dynamic C Getting Started 3 Downloaded from Elcodis com electronic components distributor 1 4 How to Use This Manual This Getting Started manual is intended to give users a quick but solid start with the RCM2000 series modules It does not contain detailed information on the module hard ware capabilities or the Dynamic C develop
14. 3 Downloaded from Elcodis com electronic components distributor e A message reports No Rabbit Processor Detected in cases where the RCM2000 and the Prototyping Board are not connected together the wall transformer is not con nected or is not plugged in The red power LED lights whenever power is connected e The programming cable must be connected to the RCM2000 The colored wire on the programming cable is closest to pin 1 on header J3 on the RCM2000 as shown in Figure 4 The other end of the programming cable must be connected to the PC serial port The COM port specified in the Dynamic C Options menu must be the same as the one the programming cable is connected to e To check if you have the correct serial port select Compile then Compile BIOS or type lt Ctrl Y gt If the BIOS successfully compiled message does not display try a different serial port using the Dynamic C Options menu until you find the serial port you are plugged into Don t change anything in this menu except the COM number The baud rate should be 115 200 bps and the stop bits should be 1 4 3 Single Stepping Compile or re compile FLASHLED C by clicking the Compile button on the task bar The program will compile and the screen will come up with a highlighted character green at the first executable statement of the program Use the F8 key to single step Each time the F8 key is pressed the cursor will advance one statement When you get t
15. anuals overnight when appropriate to keep from tying up shared resources dur ing the work day e If your printer supports duplex printing print pages double sided to save paper and increase convenience NOTE If you do not have a suitable printer or do not want to print the manual yourself most retail copy shops e g Kinkos AlphaGraphics etc will print the manual from the PDF file and bind it for a reasonable charge about what we would have to charge for a printed and bound manual Getting Started 5 Downloaded from Elcodis com electronic components distributor 6 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 2 HARDWARE SETUP This chapter describes the RCM2000 hardware in more detail and explains how to set up the accompanying Prototyping Board NOTE This chapter and this manual assume that you have the RabbitCore RCM2000 Development Kit If you purchased an RCM2000 series module by itself you will have to adapt the information in this chapter and elsewhere to your test and development setup 2 1 Development Kit Contents The RCM2000 series Development Kit contains the following items RCM2020 module with 256K flash memory and 128K SRAM RCM2000 Prototyping Board with accessory hardware and components Wall transformer power supply 12 V DC 500 mA included only with Development Kits sold for the North American market Overseas users will need a power supply compatibl
16. arate function with no local variables 4 4 Cooperative Multitasking Cooperative multitasking is a convenient way to perform several different tasks at the same time An example would be to step a machine through a sequence of steps and at the same time independently carry on a dialog with the operator via a human interface Coop erative multitasking differs from another approach called preemptive multitasking Dynamic C supports both types of multitasking In cooperative multitasking each separate task voluntarily surrenders its compute time when it does not need to perform any more activity immediately In preemptive multitasking control is forcibly removed from the task via an interrupt Dynamic C has language extensions to support multitasking The major C constructs are called costatements cofunctions and slicing These are described more completely in the Dynamic C User s Manual The example below sample program FLASHLEDS2 C uses costatements A costatement is a way to perform a sequence of operations that involve pauses or waits for some external event to take place A complete description of costate ments is in the Dynamic C User s Manual The FLASHLEDS2 C sample program has two independent tasks The first task flashes LED DS2 2 5 times a second The second task flashes DS3 every 1 5 seconds 26 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor define DS2 0 predefine for LED DS2 de
17. at providing all users with our complete library of product and reference manuals is a useful convenience However printed manuals are expensive to print stock and ship Rather than include and charge for manuals that every user may not want or pro vide only product specific manuals we chose to provide our complete documentation and reference library in electronic form with every Development Kit and with our Dynamic C development environment Finding Online Documents The online documentation is installed along with Dynamic C and an icon for the docu mentation menu is placed on the workstation s desktop Double click this icon to reach the menu If the icon is missing create a new desktop icon that points to default htm in the docs folder found in the Dynamic C installation folder The latest versions of all documents are always available for free unregistered download from our Web sites as well Printing Electronic Manuals We recognize that many users prefer printed manuals for some uses Users can easily print all or parts of those manuals provided in electronic form The following guidelines may be helpful e Print from the Adobe PDF versions of the files not the HTML versions NOTE The most current version of Adobe Acrobat Reader can always be downloaded from Adobe s web site at http www adobe com We recommend that you use ver sion 4 0 or later e Print only the sections you will need to refer to often e Print m
18. ave hard drive space or installed elsewhere on a separate or net work drive for example Hahup Tapa Pilani ihe ip pape had ba pally pas repel The installation type is selected in the installation menu shown above The options are e Typical Installation Both Dynamic C and the documentation library will be installed in the specified folder default e Compact Installation Only Dynamic C will be installed e Custom Installation You will be allowed to choose which components are installed This choice is useful to install or reinstall just the documentation 16 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 3 3 3 Select COM Port Dynamic C uses a COM serial port to communicate with the target development system The installation allows you to choose the COM port that will be used TH El 4 Saup Tapa Theys Be ip Opp hi bsy miy pas ri The default selection as shown in the example above is COM1 You may select any avail able port for Dynamic C s use If you are not certain which port is available select COM1 This selection can be changed later within Dynamic C NOTE The installation utility does not check the selected COM port in any way Speci fying a port in use by another device mouse modem etc may cause temporary prob lems when Dynamic C is started 3 3 4 Desktop Icons Once your installation is complete you will have up to three icons on y
19. e with their local mains power 10 pin header to DE9 programming cable with integrated level matching circuitry Dynamic C CD ROM with complete product documentation on disk This Getting Started manual Registration card Getting Started 7 Downloaded from Elcodis com electronic components distributor 2 2 Overview of the Prototyping Board The Prototyping Board included in the Development Kit makes it easy to connect an RCM2000 module to a power supply and a PC workstation for development It also pro vides an array of basic I O peripherals switches and LEDs as well as a prototyping area for more advanced hardware development For the most basic level of evaluation and development the Prototyping Board can be used without modification As you progress to more sophisticated experimentation and hardware development modi fications and additions can be made to the board without modifying or damaging the RCM2000 itself The Prototyping Board is shown in Figure 2 below with its main features identified RCM2000 Voltage Power Connectors Regulator Input fos O Reset Switch a ira lt fo a o zZ a gt E E fe a a So Q N 8 w g 2s o Oo 5 O o o o o o o smdO Ojsm1 std O O Rsti vec O Ojenp 0000000 000 O pall OO pa OO00000000 O pad OO pa
20. eirar ioie ene eot eara er EEEE EEEo ASES ECERS EEEE EErEE EEES ETTE SE PES SE 16 33 3 Select COM POT rosee err ereere raker ra A lest beudvsuabseeeceesthlsensnesto ievtuesdbteaenesshasdeludassuavabeds 17 3 3 4 Desktop ICONS iieri pieis ii eat aiana RETNA AEE EE n a E Aa NSSR ia 17 3 4 Starine Dynamic Cercamon en ieee ie apr O EEE a E EIERE ARKE e E si 18 3 4 1 Communication Error Messages sesesseesesesesesrerrsreersserrrsreetereeterrerenrserresreesrertereeterrereetese 18 Chapter 4 Sample Programs 21 4 1 Sample Program Overview sie ccesdiacssivschiassscivaeestescotessevasseueveanszectstecotesusviabendsuowpenevoayevneevvapibversedasies 21 4 2 Running Sample Program FLASHLED C 0 cece cee ceseeseceeceeeeeeceeeeseeeeecaeesaecaeceaecneseaeeaeseeseeeseeeeaes 23 4 3 SimPle Ste pp Pies esen ieee Oren e Ere E E ETE EE TEETE EEEE EEEE ETES SENEE O Ea 24 4 3 1 Watch EX pressions 325 sscsastdencsesasid detaveslentsdsvostdedesebaseasbdecstevesbieGpentconissbepeosededveasteasseouehiibayedensbale 24 43 2 Break Pointene ueni Eirene sede EEEE EEEE EEEE EEEE r e aneio E E 24 4 3 3 Editing the Programi issena ien a a SE EEN nds S EE S E E EE EE 25 4 3 4 Watching Variables Dynamically sssesseseessesseesseeeseeresressseeresteersrsseerssreresresestesretrsrerrnrenresreeeses 25 4 3 5 Summary of PCAtures enci iener u aia a E e E EEE AESSR 25 4 4 Cooperative Multitasking c cccstesesesscsecenseepassoensetsasenestsessearesbsossenbessdescbesosede
21. essage indicating that the target is now ready to compile a program You should then continue with the sample programs in the next chapter Getting Started 19 Downloaded from Elcodis com electronic components distributor 20 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 4 SAMPLE PROGRAMS To help familiarize you with the RCM2000 modules several sample Dynamic C programs have been included Loading exe cuting and studying these programs will give you a solid hands on overview of the RCM2000 s capabilities as well as a quick start with Dynamic C as an application development tool 4 1 Sample Program Overview Dynamic C comes with a large number of sample programs that illustrate many of its fea tures These programs are intended to serve as tutorials but then can also be used as start ing points or building blocks for your own applications NOTE It is assumed in this section that you have at least an elementary grasp of ANSI C If you do not see the introductory pages of the Dynamic C User s Manual for a sug gested reading list Sample programs are provided in the Dynamic C Samples folder which is shown below pOIe UU J FileSystem Cofunc E Icom COREMODULE C Intrupts J Costate E Jackrab Jj Crypt C Miniweb Fft E Ppp File name Files of type Source Files c lib Cancel C Rem2100 E Rcm2200 C Rem2300 E Rtclock E Rtdk Serial
22. fine DS3 1 predefine for LED DS3 MOIS ORM Elonmen lashes i LED ON ror onti me e Neno Eor ORE tele cofunc flashled 4 int led int ontime int offtime for waitfor DelayMs ontime on delay WrPortI PADR amp PADRShadow 1 lt lt led PADR turn LED off waitfor DelayMs offtime off delay WrPortI PADR amp PADRShadow 1 lt lt led Oxff f amp PADR turn LED on main Initialize ports WrPortI SPCR amp SPCRShadow 0x84 M SSCEMPorEe Aw alllNouEouES mE DSsmon WrPortI PEFR amp PEFRShadow 0x00 ff Sie Were i Morna EO WrPortI PEDDR amp PEDDRShadow 0x01 Set Port E bits 7 1 input 0 output WrPortI PECR amp PECRShadow 0x00 i Sert tcranskter Clock ae pc liky 2 for cun forever costate Il SStakteacositatement wid use wiel waitfordone with cofunctions flashled 0 DS2 200 200 flash DS2 on 200 ms off 200 ms flashled 1 DS3 1000 500 flash DS3 on 1000 ms off 500 ms end costatement end for loop end of main never come her Load and run the program The flashing of the LEDs is performed by the costatement Costatements need to be exe cuted regularly often at least every 25 ms To accomplish this the costatements are enclosed in a while loop or a for loop The term while loop is used as a handy way to describe a style of real time programming in which most operations are done in one loop T
23. functionally tested Additional testing may include visual quality con trol inspections or mechanical defects analyzer inspections Specifications are based on characterization of tested sample units rather than testing over temperature and voltage of each unit Z World products may qualify components to operate within a range of parameters that is different from the manufacturer s recom mended range This strategy is believed to be more economical and effective Additional testing or burn in of an individual unit is available by special arrangement Getting Started 29 Downloaded from Elcodis com electronic components distributor 30 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor A additional information online documentation 5 references oo eee ee eeeeeeeeee 4 C C language ooeec 13 D description sssesseeeeeseeseessrese 1 Development Kit eee 7 Dynamic C ue 3 13 14 assembly language 13 changing programming baud rate in BIOS nesese 18 debugger seee 13 debugging oseese 13 desktop icons ce eeeeeee 17 CCIUOP eirinn na na 13 features oee 13 25 handling communication error MESSAgES oe ceeeeeeeeeeeeees 18 hardware requirements 14 installing 0 15 16 17 interrupt service routines 14 multitasking 0 0 26 sample programs 21 break point 0 0 eee 24 editing a program 25 single stepping
24. he costatement is executed on each pass through the big loop When a wait for or a wfd condition is encountered the first time the current value of MS_TIMER is saved and then on each subsequent pass the saved value is compared to the current value If a wait for condition is not encountered then a jump is made to the end of the costatement and on the next pass of the loop when the execution thread reaches the beginning of the costatement execution passes directly to the wait for statement The costatement has the property that it can wait for long periods of time but not use a lot of execution time Each costatement is a little program with its own statement pointer that advances in response to conditions On each pass through the big loop as little as one statement in the costatement is exe cuted starting at the current position of the costatement s statement pointer Consult the Dynamic C User s Manual for more details This program also illustrates a use for a shadow register A shadow register is used to keep track of the contents of an I O port that is write only it can t be read back If every time a write is made to the port the same bits are set in the shadow register then the shadow reg ister has the same data as the port register Getting Started 27 Downloaded from Elcodis com electronic components distributor 4 5 Advantages of Cooperative Multitasking Cooperative multitasking as implemented with language extensions
25. is running Use the F9 key to compile and run FLASHLED2 c Now type lt Ctrl W gt to open the watch window and add the watch expression k to the top of the list of watch expressions Now type lt Ctrl U gt Each time you type lt Ctrl U gt you will see the current value of k which is incrementing about 5 times a second As an experiment add another expression to the watch window k 5 Then type lt ctrl U gt several times to observe the watch expressions k and k 5 4 3 5 Summary of Features So far you have practiced using the following features of Dynamic C e Loading compiling and running a program When you load a program it appears in an edit window You can compile by selecting Compile on the task bar or from the Com pile menu When you compile the program it is compiled into machine language and downloaded to the target over the serial port The execution proceeds to the first state ment of main where it pauses waiting for you to command the program to run which you can do with the F9 key or by selecting Run on the Run menu If want to compile and start the program running with one keystroke use F9 the run command If the pro gram is not already compiled the run command will compile it first e Single stepping This is done with the F8 key The F7 key can also be used for single stepping If the F7 key is used then descent into subroutines will take place With the Getting Started 25 Downloaded from Elcodis com elect
26. language such as shared and protected vari ables costatements and cofunctions that support real world embedded system devel opment Interrupt service routines may be written in C Dynamic C supports cooperative and preemptive multi tasking e Dynamic C comes with many function libraries all in source code These libraries sup port real time programming machine level I O and provide standard string and math functions e Dynamic C compiles directly to memory Functions and libraries are compiled and linked and downloaded on the fly On a fast PC Dynamic C can load 30 000 bytes of code in 5 seconds at a baud rate of 115 200 bps 3 2 System Requirements To install and run Dynamic C your system must be running one of the following operating systems e Windows 95 e Windows 98 e Windows NT e Windows Me e Windows 2000 3 2 1 Hardware Requirements The PC on which you install Dynamic C for development of RCM2000 based systems should have the following hardware e A Pentium or later microprocessor e 32 MB of RAM e Atleast 40 MB of free hard drive space e Atleast one free COM serial port for communication with the target systems e A CD ROM drive for software installation 14 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 3 3 Installing Dynamic C Insert the Dynamic C CD ROM in the drive on your PC If autorun is enabled the CD installation will begin automatically If aut
27. mation 0 0 0 eee eee eeceeeeeeceeeeeeeceeeeeecaeesaecaecsaesaeeeseeeseseaseaeeseeseneeaes 4 1 4 2 Additional Reference Information ccccccccssscceceessseceeceessaececeeeseececeeceeeeeeecesensseeeceseneaaeeeecenes 4 1 4 3 Using Online Documentation eri escurren i tE Er EEEE EE EEEE E ETSE EE EEA aE 5 Chapter 2 Hardware Setup 7 2 1 Development Kit Contents snene ini dds d Rin ee ae Mie E S EES EES 7 2 2 Overview of the Prototyping Board oo eee cece esceesecseecsecsseseeceeessecsecsseeseceseeseecaeeaecaeesaecaseaesneesseees 8 2 3 COMMECUHONS aiseee a ER E RE oe cas tases tee E A eee eras 9 24 Where DoT Go From Here sci sos csccdessvssdevsvecsscssceapiestesscsacogeessoeisattosdvecsegeveses Sused stessewas usc asquedeogscaecietees 11 ZAT Technical SUpport so ite esiiscidi cass sil heise estas dows edge Ga Aa ieee 11 Chapter 3 Installing Dynamic C 13 3 1 An Overview of Dynamic Cruesa denied elk ees a dae E I dees 13 3 2 SYSTEM REGUITSMEDIS wis svccce snes diced eects aves ves sevines sstaecneyevedsceeneraaguvosscessieeiegunesgeuts E o TREE TEE EEE ERER 14 3 2 1 Hardware Requirements 0s ccc2 c se2ss8 st cesncess tacts oe nE E E Ea based ap Eae EE 14 3 3 Installing Dynamic C iseci eiren oies EE eE EE EAE AEE EEE EEE EA EEKE Er E iobnscssasesanbvoseoedys 15 3 3 1 Program amp Documentation File Location ssssesessesessssreersreerrreerereerrsrerrstssreesreererrererrerereeree 15 3 3 2 Installation LY Pe iis ssecrarcori c
28. ment environment Most users will want more detailed information on some or all of these topics in order to put the RCM2000 to effec tive use 1 4 1 Additional Product Information Detailed information about the RabbitCore RCM2100 series is provided in the Rabbit Core RCM2000 User s Manual which is available on the accompanying CD ROM in both HTML and Adobe PDF format Some advanced users may choose to skip the rest of this introductory manual and proceed directly with the detailed hardware and software information in the User s Manual TIP We recommend that anyone not thoroughly familiar with Z World controllers at least read through the rest of this manual to gain the necessary familiarity to make use of the more advanced information 1 4 2 Additional Reference Information In addition to the product specific information contained in the RabbitCore RCM2000 User s Manual several higher level reference manuals are provided in HTML and PDF form on the accompanying CD ROM Advanced users will find these references valuable in developing systems based on the RCM2100 series modules e Dynamic C User s Manual Rabbit 2000 Microprocessor User s Manual 4 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 1 4 3 Using Online Documentation We provide the bulk of our user and reference documentation in two electronic formats HTML and Adobe PDF We do this for several reasons We believe th
29. nbeassdeesessasisenbsaensoibe 26 4 5 Advantages of Cooperative Multitasking cece csecsseeseceeceseceeceseeeeeeeeseeseseesaesaeesaecaeeaeeneseerseeeeaes 28 Notice to Users 29 Index 31 Schematics 33 Getting Started Downloaded from Elcodis com electronic components distributor RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor 1 OVERVIEW The RabbitCore RCM2000 series is an advanced line of mod ules that incorporates the powerful Rabbit 2000 microprocessor flash memory and static RAM all on a PCB not much larger than the size of a business card The RCM2000 series modules are designed for use on a motherboard that supplies power and interfaces with real world I O devices Up to 40 pins of I O and four serial ports are available for system interfacing To accommodate a variety of user and production needs the RCM2000 family includes versions with varying amounts of onboard memory All modules within the family are pin for pin compatible and may be installed or swapped in a matter of minutes 1 1 RCM2000 Series Description There are three production models in the RCM2000 series Their standard features are summarized in Table 1 Table 1 RCM2000 Features Model Features Full featured RabbitCore module with 256K flash RCM2010 RCM2000 with 128K SRAM RCM2020 RCM2000 with 18 432 MHz clock and 128K SRAM The RCM2000 is the version that is included in the
30. o the for j 0 j lt Statement it becomes impractical to single step further because you would have to press F8 thousands of times We will use this statement to illustrate watch expressions 4 3 1 Watch Expressions Type lt Ctrl W gt or chose Add Del Watch Expression in the Inspect menu A box will come up Type the lower case letter j and click on add to top and close Now continue sin gle stepping with F8 Each time you step the watch expression j will be evaluated and printed in the watch window Note how the value of j advances when the statement j is executed 4 3 2 Break Point Move the cursor to the start of the statement for j 0 3 lt 25000 j To set a break point on this statement type F2 or select Toggle Breakpoint from the Run menu A red highlight will appear on the first character of the statement To get the pro gram running at full speed type F9 or select Run on the Run menu The program will advance until it hits the break point Then the break point will start flashing and show both red and green colors Note that LED DS3 is now solidly turned on This is because we have passed the statement turning on LED DS3 Note that j in the watch window has the value 32000 This is because the loop above terminated when j reached 32000 To remove the break point type F2 or select Toggle Breakpoint on the Run menu To continue program execution type F9 or select Run from the Run menu Now the LED should be flashing
31. or the function WrPortTI In general you can do this with all functions in Dynamic C libraries including libraries you write yourself Close the documentation box and continue C programs begin with main main pea Set up PortA to output to LED DS2 and DS3 slime 1p WrPortI SPCR amp SPCRShadow 0x84 WrPortI PADR amp PADRShadow OxFF Start a loop while 1 SE Tum LED DS3 off BitWrPortI PADR PADRShadow 1 1 Time delay by counting for j 0 3 lt 32000 j to 32 000 BitWrPortI PADR amp PADRShadow 0 1 lt Tum LED DS3 on tow J OR I lt 250008 JFE _____ Time delay by counting end while to 25 000 End of the endless loop I ene Oi main Note See the Rabbit 2000 Microprocessor User s Manual Software Chapter for details on the routines that read and write I O ports Figure 5 Sample Program FLASHLED C To run the program FLASHLED C load it with the File menu compile it using the Com pile menu and then run it by selecting Run in the Run menu The LED on the Prototyping Board should start flashing if everything went well If this doesn t work review the follow ing points e The target should be ready which is indicated by the message BIOS successfully com piled If you did not receive this message or you get a communication error recom pile the BIOS by typing lt Ctrl Y gt or select Recompile BIOS from the Compile menu Getting Started 2
32. orun is disabled or the installation otherwise does not start use the Windows Start gt Run menu or Windows Disk Explorer to launch SETUP EXE from the root folder of the CD ROM The installation program will guide you through the installation process Most steps of the process are self explanatory and not covered in this section Selected steps that may be confusing to some users are outlined below Some of the installation utility screens may vary slightly from those shown 3 3 1 Program amp Documentation File Location Dynamic C s application library and documentation files can be installed in any conve nient location on your workstation s hard drives ae mp n Taso bakba Fahan 5 hap al iptal Filey The default location as shown in the example above is in a folder named for the version of Dynamic C placed in the root folder of the C drive If this location is not suitable enter a different root path before clicking Next gt Files are placed in the specified folder so do not set this location to a drive s root directory Getting Started 15 Downloaded from Elcodis com electronic components distributor 3 3 2 Installation Type Dynamic C has two components that can be installed together or separately One compo nent is Dynamic C itself with the development environment support files and libraries The other component is the documentation library in HTML and PDF formats which may be left uninstalled to s
33. our PC desktop as shown below D B Dynamic C 7 03P DC 7 03P Docs DC 7 03P RFU One icon is for Dynamic C one opens the documentation menu and the third is for the Rabbit Field Utility a tool used to download precompiled software to a target system Getting Started 17 Downloaded from Elcodis com electronic components distributor 3 4 Starting Dynamic C Once the RCM2000 module is set up and connected as described in Chapter 2 and Dynamic C has been installed start Dynamic C by double clicking on the Dynamic C icon Dynamic C should start then look for the target system on the COM port you speci fied during installation by default COM1 Once detected Dynamic C should go through a sequence of steps to cold boot the module and compile the BIOS If you receive the message beginning BIOS successfully compiled you are ready to continue with the sample programs in the next chapter 3 4 1 Communication Error Messages If you receive the message No Rabbit Processor Detected the programming cable may be connected to a different COM port a connection may be faulty or the target system may not be powered up First check to see that the power LED on the Prototyping Board is lit If it is check both ends of the programming cable to ensure that it is firmly plugged into the PC and the RCM2000 s programming port If you are using the Prototyping Board ensure that the module is firmly and correctly installed in i
34. ronic components distributor F8 key the subroutine is executed at full speed when the statement that calls it is stepped over e Setting break points The F2 key is used to turn on or turn off toggle a break point at the cursor position if the program has already been compiled You can set a break point if the program is paused at a break point You can also set a break point in a program that is running at full speed This will cause the program to break if the execution thread hits your break point e Watch expressions A watch expression is a C expression that is evaluated on command in the watch window An expression is basically any type of C formula that can include operators variables and function calls but not statements that require multiple lines such as for or switch You can have a list of watch expressions in the watch window If you are single stepping then they are all evaluated on each step You can also com mand the watch expression to be evaluated by using the lt Ctrl U gt command When a watch expression is evaluated at a break point it is evaluated as if the statement was at the beginning of the function where you are single stepping If your program is running you can also evaluate watch expressions with a lt Ctrl U gt if your program has a runwatch command that is frequently executed In this case only expressions involving global variables can be evaluated and the expression is evaluated as if it were in a sep
35. ts connectors If there are no faults with the hardware select a different COM port within Dynamic C From the Options menu select Project Options then select Communications The dialog shown should appear Select another COM port from the list then click OK Press lt Ctrl Y gt to force Dynamic C to recom pile the BIOS If Dynamic C still reports it is unable to locate the target system repeat the above steps until you locate the active COM port If Dynamic C appears to compile the BIOS successfully but you then receive a communi cation error message it is possible that your PC cannot handle the 115 200 bps baud rate Try changing the baud rate to 57 600 bps as follows e Locate the Serial Options dialog in the Dynamic C Options gt Project Options gt Communications menu Change the baud rate to 57 600 bps 18 RabbitCore RCM2000 Downloaded from Elcodis com electronic components distributor If you are using Dynamic C version 7 04 or earlier modify the BIOS source code as fol lows Skip these three steps if your version of Dynamic C is 7 05 or later 1 Open the BIOS source code file named RABBITBIOS C which can be found in the BIOS directory 2 Change the line tdefine USE115KBAUD 1 set to 0 to use 57600 baud to read as follows tdefine USE115KBAUD 0 set to 0 to use 57600 baud 3 Save the changes using File gt Save Now press lt Cirl Y gt You should receive the BIOS successfully compiled m
Download Pdf Manuals
Related Search
Related Contents
Copyright © All rights reserved.
Failed to retrieve file