manualshive.com logo in svg
background image

User’s Manual

19

3.1.4  Sample Program Descriptions

3.1.4.1  FLASHLED.C

This program is about as simple as a Dynamic C application can get—the equivalent of 
the traditional “Hello, world!” program found in most basic programming tutorials. If you 
are familiar with ANSI C, you should have no trouble reading through the source code and 
understanding it.

The only new element in this sample application should be Dynamic C’s handling of the 
Rabbit microprocessor’s parallel ports. The program:

4. Initializes the pins of Port A as outputs.

5. Sets all of the pins of Port A high, turning off the attached LEDs.

6. Starts an endless loop with a 

for(;;)

 expression, and within that loop:

• Writes a bit to turn bit 1 off, lighting LED DS3;

• Waits through a delay loop;

• Writes a bit to turn bit 1 on, turning off the LED;

• Waits through a second delay loop;

These steps repeat as long as the program is allowed to run.

You can change the flash rate of the LED by adjusting the loop values in the two 

for

 

expressions. The first loop controls the LED’s “off” time; the second loop controls its “on” 
time.

NOTE:

Since the variable 

j

 is defined as type 

int

, the range for 

j

 must be between 0 

and 32767. To permit larger values and thus longer delays, change the declaration of 

j

 

to 

unsigned int

 or 

long

.

More Information

See the section on primitive data types, and the entries for the library functions 

WrPortI( )

 and 

BitWrPortI( )

 in the 

Dynamic C User’s Manual

.

Содержание RCM2100

Страница 1: ...ss mainly focus on the distribution of electronic components Line cards we deal with include Microchip ALPS ROHM Xilinx Pulse ON Everlight and Freescale Main products comprise IC Modules Potentiometer...

Страница 2: ...RabbitCore RCM2100 C Programmable Module with Ethernet User s Manual 019 0091 070831 K...

Страница 3: ...it 2000 and RabbitCore are trademarks of Rabbit Semiconductor Inc No part of the contents of this manual may be reproduced or transmitted in any form or by any means without the express written permis...

Страница 4: ...ort 12 Chapter 3 Running Sample Programs 13 3 1 Sample Programs 13 3 1 1 Getting to Know the RCM2100 14 3 1 2 Serial Communication 17 3 1 3 Other Sample Programs 18 3 1 4 Sample Program Descriptions 1...

Страница 5: ...2 6 8 1 How to Set Up your Computer for Direct Connect 53 6 9 Run the PINGME C Sample Program 54 6 10 Running More Sample Programs With Direct Connect 54 6 10 1 Sample Program PINGLED C 54 6 10 2 Samp...

Страница 6: ...ternal Battery Connections 81 C 1 2 Power to VRAM Switch 83 C 1 3 Reset Generator 83 C 2 Chip Select Circuit 84 Appendix D Sample Circuits 85 D 1 RS 232 RS 485 Serial Communication 86 D 2 Keypad and L...

Страница 7: ...RabbitCore RCM2100...

Страница 8: ...cifically The RCM2100 is a microprocessor core module designed to be the heart of your own con troller built around the plug in module Data processing is done by a Rabbit 2000 micro processor operatin...

Страница 9: ...clock Watchdog supervisor Provision for customer supplied backup battery via connections on header J2 Four CMOS compatible serial ports maximum asynchronous baud rate of 690 625 bps maximum synchronou...

Страница 10: ...asy C language program development and debugging including rapid production loading of programs Generous memory size allows large programs with tens of thousands of lines of code and substantial data...

Страница 11: ...rget system eliminating the need for complex and unreliable in circuit emulators NOTE The RCM2100 modules require Dynamic C v7 04 or later for development A compatible version is included on the Devel...

Страница 12: ...M2100 modules Dynamic C User s Manual An Introduction to TCP IP Dynamic C TCP IP User s Manual Rabbit 2000 Microprocessor User s Manual 1 4 2 Using Online Documentation We provide the bulk of our user...

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

Страница 14: ...ment Kit If you purchased an RCM2100 module by itself you will have to adapt the information in this chapter and elsewhere to your test and development setup 2 1 Connections There are three steps to c...

Страница 15: ...dule on the Prototyping Board Note the orientation of the module NOTE It is important that you line up the RCM2100 pins on headers J1 and J2 exactly with the corresponding pins of header sockets J1 an...

Страница 16: ...rial connection Figure 3 Attaching Programming Cable to the RCM2100 NOTE The stripe on the cable is towards pin 1 of the header J5 Connect the other end of the programming cable to a COM port on your...

Страница 17: ...ply Connections to Prototyping Board Plug in the wall transformer The power LED on the Prototyping Board should light up The RCM2100 and the Prototyping Board are now ready to be used NOTE A RESET but...

Страница 18: ...ging the maximum download rate to a slower baud rate as follows Locate the Serial Options dialog in the Dynamic C Options Project Options Communications menu Select a slower Max download baud rate If...

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

Страница 20: ...n also be used as starting 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 introductor...

Страница 21: ...un this sample program FLASHLED C repeatedly flashes LED DS3 on the Prototyping Board on and off LED DS3 is controlled by Parallel Port A bit 1 PA1 FLASHLED2 C repeatedly flashes LED DS3 on the Protot...

Страница 22: ...llel Ports B C and D PB0 Keypad Col 0 PC1 Keypad Col 1 PB2 Keypad Col 2 PB3 Keypad Col 3 PB4 Keypad Col 4 PB5 Keypad Col 5 PD1 Keypad Row 0 PD2 Keypad Row 1 Connect the LCD to Parallel Port A PA0 back...

Страница 23: ...Port A bit 1 LED DS3 Parallel Port B bit 2 switch S2 Parallel Port B bit 3 switch S3 TOGGLELED C demonstrates the use of costatements to detect switch presses using the press and release method of deb...

Страница 24: ...et up flow control lines CORE_PARITY C This program demonstrates the use of parity modes by repeatedly sending byte values 0 127 from Serial Port B to Serial Port C The program will switch between gen...

Страница 25: ...es are as follows RS485 to RS485 RS485 to RS485 GND to GND MASTER2 C This program demonstrates a simple RS 485 transmission of lower case letters to a slave RCM2100 The slave will send back converted...

Страница 26: ...s an endless loop with a for expression and within that loop Writes a bit to turn bit 1 off lighting LED DS3 Waits through a delay loop Writes a bit to turn bit 1 on turning off the LED Waits through...

Отзывы: