background image

Getting Started

23

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 again since the program is running at full speed.

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.2.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.2.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 is running.

Use the 

F9

 key to compile and run 

FLASHLED2.C

.  Now type 

<ctrl-W>

 to open the watch 

window and add the watch expression 

k

 to the top of the list of watch expressions.  Now 

type 

<ctrl-U>

.  Each time you type 

<ctrl-U>

, 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 

<ctrl-U>

 several times to observe the watch expressions 

k

 and 

k*5

.

4.2.5  Summary of Features

So far you have practiced using the following features of Dynamic C.

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 

Содержание RabbitCore 2000

Страница 1: ...RabbitCore 2000 C Programmable Core Module Getting Started 001004 C...

Страница 2: ...100 percent functionally tested Additional testing may include visual quality control inspections or mechanical defects analyzer inspections Specifica tions are based on characterization of tested sam...

Страница 3: ...unds 11 2 4 2 Upgrades 12 3 Hardware Connections 13 3 1 Connections 14 3 2 Starting Dynamic C 16 3 3 Run a Sample Program 16 Installing Dynamic C 16 3 4 Where Do I Go From Here 17 4 Sample Programs 19...

Страница 4: ...RabbitCore 2000...

Страница 5: ...50 000 C statements Conventions Table 1 lists and defines the typographic conventions that may be encountered in Dynamic C Table 1 Typographic Conventions Example Description while Bold Courier font...

Страница 6: ...debug C programs that run on the Rabbit 2000 AC adapter The AC adapter is used to power the Prototyping Board and the Rabbit Core 2000 The wall transformer is supplied only for Development Kits sold...

Страница 7: ...Getting Started 1 1 INSTALLING DYNAMIC C...

Страница 8: ...00 Windows NT Your PC should have at least one free COM port 1 2 Installation Insert the CD in the CD ROM disk drive on your PC As long as auto install is enabled the CD installation will begin automa...

Страница 9: ...estination folder where the files will be installed Click the Next button to continue the installation The Installation Wizard will prompt you to select a Compact a Custom or a Typical installation Co...

Страница 10: ...bitCore 2000 After choosing the installation click the Next button to continue The files selected for installation are check marked Now select the PC COM port usually COM1 Click the Next button to con...

Страница 11: ...nstallation wizard will ask you what icons to dis play on your PC desktop Separate icons are available for Dynamic C itself and for the manuals and other documents Click the Finish button to end the i...

Страница 12: ...esponding icon start Dynamic C or to access the documentation It is also possible to start Dynamic C or access the documentation by double clicking the corresponding launch file on the drive where you...

Страница 13: ...ON TO DYNAMIC C Dynamic C is an integrated development system for writing embedded software It runs on an IBM compatible PC and is designed for use with Z World controllers and other con trollers base...

Страница 14: ...nts and other advanced debugging features Watch expressions can be used to compute C expressions involving the target s program variables or functions Watch expressions can be evaluated while stopped...

Страница 15: ...Costate lib enables multitasking costatements to be defined starting with costate Also contains a library of commonly used costatements Fft lib fast Fourier transform functions Math lib math functions...

Страница 16: ...h EPROM Idblock lib functions to access the ID block in Z World product flash devices also contains general CRC checking functions Mutil lib integer math utility functions Mutilfp lib floating point m...

Страница 17: ...ries or it may focus on bug fixes Check the Web sites www zworld com support supportcenter html or www rabbitsemiconductor com support html for the latest updates patches workarounds and bug fixes 2 4...

Страница 18: ...u can verify the operation of the new release without over writing the previous release If you have made any changes to the BIOS or to libraries or if you have programs in the old directory folder mak...

Страница 19: ...ardware connections described in this chapter locate the fol lowing items RabbitCore 2000 model RCM2020 RCM2000 Prototyping Board Power supply a 12 V 500 mA power supply is included with Development K...

Страница 20: ...J6 C6 GND VCC VCC PA1 PA3 PA5 PA7 PB1 PB3 PB5 PB7 GND D6 GND PA0 PA2 PA4 PA6 PB0 PB2 PB4 PB6 D7 PCLK RCM2000 PROTOTYPING BOARD D4 D2 D0 PE6 PE4 PE2 PE0 IOR WDO A11 A9 A7 A5 A3 A1 STAT PC1 PC3 PC5 PC7...

Страница 21: ...s provided on the Prototyping Board to allow a hardware reset J2 J1 C1 J4 U1 J5 S2 S3 S1 RN1 D2 JP1 DS3 DS2 DS1 C2 U2 C3 C4 C5 J6 C6 VCC PA1 PA3 PA5 PA7 PB1 PB3 PB5 PB7 GND D6 GND PA0 PA2 PA4 PA6 PB0...

Страница 22: ...is message is followed by Target not responding it is possi ble that your PC cannot handle the 115 200 bps baud rate Try changing the baud rate to 57 600 bps as follows 1 Open the BIOS source code fil...

Страница 23: ...t at 530 757 3737 or Rabbit Semiconductor Technical Support at 530 757 8400 If the sample program ran fine you are now ready to go on to other sample programs in the next chapter or to the RabbitCore...

Страница 24: ...18 RabbitCore 2000...

Страница 25: ...Getting Started 19 4 SAMPLE PROGRAMS...

Страница 26: ...demonstrates the output to the STDIO window The CoreModule folder provides sample programs specific to the RabbitCore 2000 Let s take a look at the CoreModule folder Each sample program has comments t...

Страница 27: ...pile menu and then run it by selecting Run in the Run menu The LED on the Prototyp ing Board should start flashing if everything went well If this doesn t work review the following points The target s...

Страница 28: ...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 to the for j 0 j stat...

Страница 29: ...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...

Страница 30: ...ou are single stepping If your program is running you can also evaluate watch expressions with a ctrl U if your program has a run watch command that is frequently executed In this case only expression...

Страница 31: ...o describe a style of real time programming in which most operations are done in one loop The costatement is executed on each pass through the big loop When a waitfor or a wfd condition is encountered...

Страница 32: ...d between differ ent 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 th...

Страница 33: ...Getting Started SCHEMATICS...

Страница 34: ......

Отзывы: