Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1...

26
OG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN, INC., 7557-1 Hotaka, Hotaka-machi, Minamiazumi, Nagano 399-8303 JAPAN Tel: +81+(0263)-82-1024 Fax: +81+(0263)-82-1016 E-mail: [email protected] Web site: http://www.circuitdesign.jp

Transcript of Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1...

Page 1: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e

OPERATION GUIDE

Embedded low power radio modem MU-1

Application Design Kit

MU1-ADK

Operation Guide

Version 2.0 (Jun. 2005)

CIRCUIT DESIGN, INC.,

7557-1 Hotaka, Hotaka-machi, Minamiazumi, Nagano 399-8303 JAPAN

Tel: +81+(0263)-82-1024 Fax: +81+(0263)-82-1016

E-mail: [email protected]

Web site: http://www.circuitdesign.jp

Page 2: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 1

OPERATION GUIDE

Chapter 1 The Application Design Kit 2 1.1 Outline 2 1.2 System Requirements 2 1.3 Product Name and Part Number 3 1.4 Contents of the Kit 3 1.5 Block Diagram 4 1.6 Part Names and Functions 6 1.6.1 RS232C interface board 6 1.6.2 Training board 7 1.7 Specifications 9 1.8 Precautions 9 1.9 Circuit Diagram 10 1.10 External Dimensions 12 Chapter 2 The Sample Program 14 2.1 Easy Startup of the Sample Program 14 2.2 Explanation of the Training Board Version of the Sample Program 15 2.2.1 The program 15 2.2.2 Functions 15 2.3 Explanation of the Windows Version of the Sample Program 16 2.3.1 The program 16 2.3.2 How to use the program 16 2.3.3 Explanation of the transmission test window 17 Chapter 3 How to Design a User Program 18 3.1 The Training Board 18 3.1.1 The emulator 18 3.1.2 Components and ports available to the user 18 3.1.3 Initial setting of the terminal functions 19 3.1.4 Direct control of the MU-1 on the training board 19 3.2 The Training Board Version of the Sample Program 20 3.2.1 The source code 20 3.2.2 Communication operation details 20 3.3 The Windows Version of the Sample Program 23 3.3.1 Settings 23 3.3.2 Communication operation details 23

Contents

Page 3: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 2

OPERATION GUIDE

This kit is a programmable hardware and software development kit for users who are planning to develop applications using the MU-1. The training board is equipped with basic peripheral components and a PIC microcomputer for which the user can write programs, allowing the user to carry out a variety of tests before developing an actual system. In this way, it is possible to proceed straight to actual design development of the application without any unnecessary steps. The PIC microcomputer that comes with the kit performs communication between training boards and between the training board and a PC, and it is provided with a simple sample program. The source file for the sample program, a circuit diagram for the training board and so on are also provided, which are helpful for creating a user program. The sample program for the PC can be used with a variety of operating systems (Windows 98, Me, 2000, XP). * Read the MU-1 Operation Guide before using the training board.

1.1.1 Terminology The meaning of the terminology used in this Operation Guide is as follows. 1. The “setup disk” is the CD-ROM that comes with each MU-1 series kit, that contains the setup program,

Operation Guide and so on. 2. The “evaluation program” is a program for evaluation of the MU-1 series of products, called the MU-1

Evaluation Software Program MU1-ESP. It is included in the setup disk that comes with each kit.

1.1.2 Features

The control CPU is a highly versatile Microchip Technology PIC16LF877-20/P. Provided with user controllable tact switches and DIP switches, and a variable resistor connected to an AD

conversion port. Output ports: 8 (with output monitor LEDs) Input ports: 8 (joint use tact switch / DIP switch) AD conversion ports: 3

Space is provided on the circuit board for mounting user components. The kit can be run on batteries.

Systems used with the MU1-ADK must meet the following conditions.

1. OS: Windows XP, Windows 2000, Windows Me, or Windows 98 2. Web browser: Internet Explorer 5.01 or higher 3. Hard disk capacity: 30 MB or more 4. Memory: 60 MB or more

1.1 Outline

Chapter 1 The Application Design Kit

1.2 System Requirements

Page 4: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 3

OPERATION GUIDE

Product name: MU-1 Application Design Kit Part number: MU1-ADK

The contents of the kit are as follows. First, please check that you have all the items.

1.4.1 Accessories

1. MU-1 RS232C interface board MU1-RS2IF 1 2. Training board: MU1-TB 2 3. UART adapter (with connection cable) 1 4. RS232C straight cable (1.8 m) 1 5. 9 V battery holder 3 6. Setup disk 1 7. 6-pin and 8-pin sockets for mounting the MU-1 3 of each 8. Spacers (used as legs) 10 mm 16 9. Screws for spacers M 2.6 × 6 mm 16

* The MU-1 is sold separately. * Batteries are not included * Mount the MU-1 sockets with solder if necessary.

1.4.2 Main contents of the setup disk 1. Application Design Kit Operation Guide 2. MU-1 Operation Guide 3. RS232C Interface Board Operation Guide 4. Training board sample program source file 5. MU-1 Evaluation Program (including a sample program for the training board)

1.4 Contents of the Kit

1.3 Product Name and Part Number

MU1-RS2IF x 1

Setup disk x 1

RS232C Cable (1.8 m) x 1

Screw (M 2.6 x 6 mm) x 16 Spacer (10mm) x 16

IC socket 6pin x 3IC socket 8pin x 3

MU1-TB x 2

UART adapter x 1

Battery holder x 3

Page 5: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 4

OPERATION GUIDE

1.5.1 MU-1 RS232C interface board: MU1-RS2IF

RS232Clevel

conversion

2

1VCC

GND

MU-1mounting

λ/4antenna

Regulator+3v

13

12

11

10

9

8

14

7

4

5

6

3

2

1

INI

RXD

TXD

RTS

CTS

MODE

RESET

RX-MON

RF

GND

VCC

AF-MON

RSSI

TX-LED

RX-LED

CN1

+

- DC +3.2V to +12VLED1

LED2LED3

Powerterminal

SW1

Powerswitch

1RXD 2TXD 3DTR 4GND 5DSR 6RTS 7CTS 8

9

CN2D-Sub 9pin

male

SW2

1.5 Block Diagram

Page 6: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 5

OPERATION GUIDE

1.5.2 Training board block diagram: MU1-TB

8

7

6

5

4

RC6/RXD

RC7/TXD

2

1

VCC

GND

MU-1mounting

λ/4Antenna

3

2

1

8

7

6

5

4

3

2

1

13

12

11

10

9

8

14

7

4

5

6

3

2

1

1

2

3

4

5

6

1

2

3

4

Regulator+ 3.0V

RC0

RC1

RC2

INI

RXD

TXD

RTS

CTS

MODE

RESET

RX-MON

RF

GND

VCC

AF-MON

RSSI

TX-LED

RX-LED

Programmable Control CPU

PIC16LF877A

6

Regulator+ 3.0V

3

CN2

CN7

CN1

CN9

CN6

SW11

~SW4 12

~LED2 9

RB7

RB0

SW3

RA4

VR1

VR2

AN0

AN1

RD7

RD0

AN4

AN2

SW2

RE0

RE1

RE2

RC3

SW1

for MU-1

+

-DC + 3.2V to + 12VLED1

LED10LED11

Connector forUART adaptor

Analog portfor user

Power connector

Power switchPort for user

Port for user

SW13

Page 7: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 6

OPERATION GUIDE

1.6.1 MU-1 RS232C interface board: MU1-RS2IF

(a ) Ho le s fo r MU -1

(b ) TX -LED

( c ) RX -LED

(d ) RS232C conne c to r (D -Sub 9 p in )

(e ) Powe r te rm ina l

( f ) Powe r sw i t ch

(g ) Powe r LED

(h ) In i t i a l i ze sw i t ch

(a) MU-1 mounting sockets If necessary, attach the IC socket provided and mount the MU-1. In order to extract the full performance of the MU-1, solder the MU-1 directly to the board. In this case it will be difficult to remove it. (b) (c) TX-LED and RX-LED On when the MU-1 is transmitting and receiving data. (d) RS232C connector (D-Sub 9-pin socket) A D-Sub 9-pin socket for RS232C. Connect the RS232C straight cable provided. You can also supply power through RS232C connector pin No.1. For details, refer to the circuit diagram. (e) (f) (g) Power terminal, power switch, power LED The connector for the power supply. Connect a 9 V battery with the battery snap provided. * If you connect to a power supply other than a 9 V dry battery, ensure that it is DC +3.2 V to DC +12 V. Be sure to connect the power supply with the correct polarity. (h) Initialize switch This switch initializes the internal settings of the MU-1. Follow the procedure below. 1. Turn on the power while pressing the initialize switch. 2. Turn off the power, wait a while, then press the power switch again.

1.6 Part Names and Functions

Page 8: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 7

OPERATION GUIDE

1.6.2 Training board: MU1-TB

( j ) CN1 Powe r te rm ina l

( k ) SW1 Powe r sw i t ch

(m ) SW3 (RA4 )

( l ) Powe r LED

(h ) CN6 (RB0 . .7 )

(g ) CN9 (RD0 . .7 ) ( i ) CN7 (AN2 ,3 ,4 )

( c ) LED2 . .9 (RB0 . .7 )

( f ) SW4 . .12 (RD0 . .7 )

(d ) SW11 (RD0 . .7 )

(e ) VR1 ,VR2 (AN0 ,AN1 )

( r ) LED11 R x LED

( s ) LED10 T x LED

n o t e 3 : R e f e r t o c i r c u i t d i a g r am .

n o t e 2 : SW 2 , SW 3 , SW 4 . . 1 2 , VR 1 , VR 2 , SW 1 1 , LED 2 . . 9 , CN 6 . . 9 c a n b e r e c o n f i g u r e d b y u s e r .

n o t e 1 : RA , RB , RD = P IC m i c r o c om p u t e r t e rm i n a l n am e .

( b ) P IC μC soc ke t

No u se

(o ) SW2 (RE0 . .2 ,RC3 ) D IP SW fo r mode sw i t ch

No u se

(a ) MU -1 moun t ing ho le

(q ) A rea fo r moun t ing u se r componen t s .

(p ) CN5 Re se t s igna l l ine te rm ina l

(n ) CN2 UART adap te r conne c to r

( t ) SW13 In i t ia l i ze sw i t ch

(a) MU-1 mounting sockets If necessary, attach the IC socket provided and mount the MU-1. In order to extract the full performance of the MU-1, solder the MU-1 directly to the board. In this case it will be difficult to remove it. (b) PIC microcomputer socket This IC socket is for mounting the PIC16LF877A. At the time of purchase, a microcomputer loaded with a sample program is mounted. When developing a program, connect an ICE. (c) LED2..9 (RB0..7) These are the LEDs connected to the PIC microcomputer RB port. Use the RB port as the output port.

Page 9: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 8

OPERATION GUIDE (d) SW11 (RD0..7) These are the DIP switches connected to the PIC microcomputer RD port. Use the RD port as the input port. Each port is at High level when the switch is off, and at Low level when the switch is on. (e) VR1, VR2 (AN0, AN1) These are the variable VRs connected to the PIC microcomputer AN port (AD conversion port). (f) SW4..12 (RD0..7) These are the tact switches connected to the PIC microcomputer RD port. Use the RD port as the input port. (g) CN9 (RD0..7) Connected to the PIC microcomputer RD port. Use the RD port as the input port. (h) CN6 (RB0..7) Connected to the PIC microcomputer RB port. Use the RB port as the output port. (i) CN7 (AN2, 3, 4) Connected to the PIC microcomputer AN port (AD conversion port). (j) CN1 power terminal The power supply terminal. Connect a 9 V battery with the battery snap provided. * If you connect to a power supply other than a 9 V dry battery, ensure that it is DC +3.2 V to DC +12 V. Be sure to connect the power supply with the correct polarity. (k) (l) SW1 power switch, power LED The power switch of the training board. The LED comes on when the switch is turned on. (m) SW3(RA4) Connected to the PIC microcomputer RA4 port. Use the RA4 port as the input port. (n) CN2 UART adapter connector This connector is for connecting the device to the MU1-RS2IF via a UART adapter. The settings of the MU-1 on the training board can be changed from the MU1-RS2IF. Insert the UART adapter in the MU1-RS2IF socket for mounting the MU-1. (o) SW2 (RE0..2, RC3) These are the DIP switches connected to the PIC microcomputer RE0..2 ports and RC 3 port. Use these ports as input ports. Each port is at High level when the switch is off, and at Low level when the switch is on. (p) CN5 reset signal line switching terminal Controls the reset signal line of the PIC microcomputer. Disconnect this when connecting a debugger. Connect with pins 1 - 2 and disconnect with pins 2 - 3. (q) Area for mounting user components You can mount electronic components here as required. (r) LED11 Rx LED On when the MU-1 is receiving data. (s) LED10 Tx LED On when the MU-1 is transmitting data. (t) SW13 initialize switch Used when initializing the MU-1. Turn on the power switch on the training board while pressing this switch. Then turn off the power, and turn it on again.

Page 10: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 9

OPERATION GUIDE

1.7.1 RS232C interface board: MU1-RS2IF

1.7.2 Training board: MU1-TB

1. The training board provided with the kit is intended for testing. Do not manufacture equipment using the training

board. Circuit Design will accept no responsibility whatsoever for any damages that may arise. 2. The Windows version of the sample program and training board version of the sample program provided with

the Evaluation Program are intended for the MU-1 Application Design Kit only. They cannot be used with other equipment. Circuit Design will accept no responsibility whatsoever for any damages that may arise from incorrect use of the programs.

Item Specification Unit Remarks

Supply voltage DC +3.2 to +12 V

Consumption current 8 mA When the supply voltage is 3.2 V

RS232C output level +/- 5 V When the supply voltage is 3.2 V

External dimensions 47 × 71 × 18 mm (W × D × H)

Weight 20 g

Item Specification Unit Remarks

Supply voltage DC +3.2 to +12 V

Consumption current 5 mA When the supply voltage is 3.2 V

External dimensions 100 × 150 × 18 mm (W × D × H)

Weight 71 g

1.7 Specifications

1.8 Precautions Caution

Page 11: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 10

OPERATION GUIDE

1.9.1 MU-1 RS232C interface board: MU1-RS2IF circuit diagram

1.9 Circuit Diagram

Page 12: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 11

OPERATION GUIDE

1.9.2 Training board: MU1-TB circuit diagram

Page 13: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 12

OPERATION GUIDE

1.9.3 UART adapter circuit diagram

1.10.1 MU-1 RS232C interface board: MU1-RS2IF

1.10 External Dimensions

Page 14: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 13

OPERATION GUIDE

1.10.2 Training board: MU1-TB

100

150

10 .992

142

10-φ3 .5

17.8

Page 15: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 14

OPERATION GUIDE

This kit comes with a training board version and Windows version of the sample program. These can be used to carry out tests of the following 3 communication functions. 1. Cyclic data transmission between training boards 2. Ping pong data transmission between training boards 3. Ping pong data transmission between training board and PC To start up the sample program, follow the procedures in the “Explanation of the Training Board Version of the Sample Program” and “Explanation of the Windows Version of the Sample Program” below.

The sample program will not create a link unless the User ID, Group ID, Equipment ID, and communication channel of both units are the same. By resetting the MU-1 units on the training board and RS232C interface board, you can easily carry out tests using the default link parameters.

Preparation 1. Mount the MU-1 on the RS232C interface board, and using the RS232C straight cable provided, connect it to

the COM port of the PC. 2. Mount the MU-1 on the training board, and set the operation mode with the Mode DIP switch (SW2). 3. Turn off the power switches of the RS232C interface board and training board, and connect the power wires to

the power terminals.

How to start up 1. Turn on the power while pressing the initialize switch on the RS232C interface board. 2. Turn on the power while pressing the initialize switch on the training board. 3. Turn off all power, and after a short time (about 3 seconds), turn on the power again. 4. The link parameters are now set and testing is possible.

Parameter values after initializing 1. Cyclic data transmission between training boards, and ping pong data transmission between training boards Channel = Lowest channel, User ID = 0000, Group ID = 00 Equipment ID = 01, Destination ID = 01 * The equipment operates when the Equipment ID and the Destination ID of both units is 01. 2. Ping pong data transmission between training board and PC Channel = Lowest channel, User ID = 0000, Group ID = 00 Equipment ID is set automatically to 02 or 03 by DIP SW4. Destination ID is set automatically to 02 or 03 by DIP SW4. * Specify the equipment number with Mode DIP SW4. Off: Equipment ID = 02, Destination ID = 03 On: Equipment ID = 03, Destination ID = 02 3. The UART (or RS232C) communication parameters of the MU-1 are as follows. Bit rate = 19,200 bps, data length = 8 bits, stop bit = 1, parity bit = none

Chapter 2 The Sample Program

2.1 Easy Startup of the Sample Program

Page 16: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 15

OPERATION GUIDE

2.2.1 The Program

The PIC microcomputer on the training board contains a program that performs the following communication functions. 1. Cyclic data transmission between training boards 2. Ping pong data transmission between training boards 3. Ping pong data transmission between training board and PC 4. Direct control of the MU-1 on the training board In order to use the various functions, it is first necessary to set the mode of the training boards to the master station and/or target station. The mode is activated by making the setting with the Mode DIP switch (SW2), then turning on the power. * Modes 0 to 5 in the following explanation indicate the processing routines of the program.

2.2.2 Functions 1. Cyclic data transmission between training boards The master station training board repeatedly transmits tact switch data (SW4..12). When the target station training board receives the data, the LEDs corresponding to the tact switch data come on. If the received data is interrupted for longer than 100 ms, all LEDs go off.

Mode 1: Master station training board settings Mode DIP switches: 1 = On 2 = Off 3 = Off 4 = N/A Mode 2: Target station training board settings Mode DIP switches: 1 = Off 2 = On 3 = Off 4 = N/A * N/A: This switch has no effect whether On or Off.

2. Ping pong data transmission between training boards Using the transceiver function of the MU-1, both the training boards transmit tact switch data. The received data is displayed on the LEDs. Both devices act as master station and target station. If the received data is interrupted for longer than 200 ms, all LEDs go off.

Mode 3: Training board 1 settings Mode DIP switches: 1 = On 2 = On 3 = Off 4 = N/A Mode 4: Training board 2 settings Mode DIP switches: 1 = Off 2 = Off 3 = On 4 = N/A

3. Ping pong data transmission between training board and PC Using the transceiver function of the MU-1, data is transmitted between the master station controlled by the Windows version of the sample program on the PC, and the target station training boards. The tact switch data of the training board is displayed by the receiving LEDs of the Windows version of the sample program, while the data transmitted by the program is displayed by the LEDs of the training board. The communication method is the polling method in which the target station training board transmits data in response to a query from the master station (PC). If the received data is interrupted for longer than 2,500 ms, all LEDs go off. For this kind of communication, use 2 training boards. (It is possible with just 1 board.)

Mode 5: Target station training board 1 settings Mode DIP switches: 1 = On 2 = Off 3 = On 4 = Off Mode 5: Target station training board 2 settings Mode DIP switches: 1 = On 2 = Off 3 = On 4 = On

* Specify the equipment number with Mode DIP SW4. Off = Target station training board 1, with Equipment ID of 02. On = Target station training board 2, with Equipment ID of 03. The Equipment ID of the MU-1 connected to the PC is 01 when it is reset. Do not change it.

2.2 Explanation of the Training Board Version of the Sample Program

Page 17: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 16

OPERATION GUIDE 4. Direct control of the MU-1 on the training board This function provides direct control of the MU-1 mounted on the training board, from an RS232C communication program such as the MU-1 Evaluation Program, HyperTerminal or the like. In this way you can set a variety of link parameters and test them. In order to achieve this function, make the following settings. • Mount the UART adapter on the RS232C interface board. • Connect the training board and the UART adapter with the connection cable provided. • Connect the RS232C interface board and the PC with the RS232C straight cable provided. • Mode 0: Mode DIP switch settings 1 = Off 2 = Off 3 = Off 4 = N/A

2.3.1 The program

Using the Application Design Kit transmission test sample program included in the MU-1 Evaluation Program (MU1-ESP) (also called the Windows version of the sample program), you can perform communication with the training board version of the sample program. The sample program uses the polling method for communication. Refer to the MU1-ESP Operation Guide for details.

2.3.2 How to use the program The transmission test window for the Application Design Kit is a sample program for performing communication between 2 training boards. In response to a query from the PC to the training board (a command to turn on its LEDs), the training board returns its own data. 1. Connect the RS232C interface board mounted with the MU-1 to the COM port of the PC. Use the RS232C

straight cable provided.

2. Turn on the power while pressing the initialize switch on the RS232C interface board. Then turn off the power, and turn it on again. The RS232C parameters and link related IDs and so on are set to the default values.

3. Start up the program by clicking “MU1_ESP.exe” in the “...¥Desktop¥Circuit Design¥MU1_EP” folder. When the program starts up, a dialog explaining how to use the program appears. Message: “Please select the model first, then open the COM port.” After checking the settings, click the “OK” button. The main program starts up.

4. Select an MU-1 from the MU-1 selection box.

5. Click the COM port button and open the port. The operation screen appears. Follow the procedure in the explanatory screen. * The default values for the MU-1 communication parameters are as follows. 19,200 bps, 8-bit, 1 stop bit, no parity If the communication parameters are changed by a command, set all the communication parameters to the same setting with “COM port” in the Setting menu.

2.3 Explanation of the Windows Version of the Sample Program

Page 18: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 17

OPERATION GUIDE

2.3.3 Explanation of the transmission test window With this sample you can carry out communication tests with the training board included in the Application Design Kit. Note that this only works with the training board. It does not support the relay function. In other words, communication is based on the content of the Destination ID. In this transmission test, data set with the LED data setting button for transmission (1 byte) is sent to the training board, and the switch data and VR1 and 2 data from the training board is read and displayed on the screen. You can connect a maximum of 2 training boards, and the Windows version of the sample program alternately reads and displays their data. [5] and [10] in the figure is the data to be displayed by the LEDs on the training board, and each represents 1 byte of data. When the training board receives this data, it returns the switch data and VR1 and 2 data.

1

2

3

4

5

6

7 8 9

10

11

13

12

14

15

[1], [15] Data receive indicator On when data is received from training board 1 or 2.

[2], [14] Receive switch data indicators Shows the tact switch data sent from training board 1 or 2.

[3], [13] VR2 voltage AD conversion data indicator Shows the AD conversion value for the VR2 terminal voltage sent from training board 1 or 2.

[4], [12] VR1 voltage AD conversion data indicator Shows the AD conversion value for the VR1 terminal voltage sent from training board 1 or 2.

[5], [11] LED data setting button for transmission Sets transmission data to switch on LEDs 2 through 9 on training board 1 or 2.

[6], [10] Data transmission button Transmits LED data to training board 1 or 2.

[7] Timeout setting button If the received data is interrupted for longer than the set time, the data indicators are reset.

[8] Polling time setting button Sets the polling time. This time is required for one unit.

[9] Initialize link parameter button Initializes the link parameters for the Application Design Kit test before communication. The User ID, Group ID, Equipment ID, and Destination ID are initialized. For this reason, when performing tests in other function windows, reset the link parameters.

Page 19: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 18

OPERATION GUIDE

Here we explain the items necessary for developing a user program, taking examples from the training board sample program and the Windows version of the sample program included in the MU-1 Evaluation Program. We recommend that you use the sample program to evaluate the training board before creating your user program.

3.1.1 The emulator

The training board is mounted with the Microchip Technology PIC16LF877-20/P. In order to develop a program using the training board, an ICE is necessary. For details, refer to the Microchip Technology homepage. When connecting the ICE, if necessary disconnect the clock of the training board with CN5.

3.1.2 Components and ports available to the user

You can use the following ports and components with the training board, however, be sure that you have a full understanding of the circuit diagram before creating your program. RB0..7 Output ports: 8 (with output monitor LED2..9) RD0..7 Input ports: 8 (joint use tact switch SW4..12 / DIP switch SW11) RA4 Input ports: 1 (tact switch SW3) AN0..1 AD conversion ports: 2 (variable resistors VR1, VR2) AN2..4 AD conversion ports: 3 (CN7) RE0..2 Input ports: 3 (DIP switch SW2) RC3 Input ports: 1 (DIP switch SW2) CN6, CN7, CN9 The through holes for these connectors are available to the user, however since a variety of components

are connected to these signal lines, care is required when using them.

Chapter 3 How to Design a User Program

3.1 The Training Board

Page 20: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 19

OPERATION GUIDE

3.1.3 Initial setting of the terminal functions Since a variety of components are connected to the various terminals of the PIC microcomputer as shown in the circuit diagram, in the program, make the initial settings for each port as follows.

Pin no. Port name Function Pin no. Port name Function 1 MCLR - 21 RD2 IN 2 RA0/AN0 AD 22 RD3 IN 3 RA1/AN1 AD 23 RC4 IN 4 RA2/AN2 AD 24 RC5 IN 5 RA3/AN3 AD 25 RC6/TX TX 6 RA4 IN 26 RC7/RX RX 7 RA5/AN4 AD 27 RD4 IN 8 RE0/AN5 IN 28 RD5 IN 9 RE1/AN6 IN 29 RD6 IN 10 RE2/AN7 IN 30 RD7 IN 11 VDD1 - 31 VSS2 - 12 VSS1 - 32 VDD2 - 13 OSC1 - 33 RB0 OUT 14 OSC2 - 34 RB1 OUT 15 RC0 IN 35 RB2 OUT 16 RC1 OUT 36 RB3 OUT 17 RC2 OUT 37 RB4 OUT 18 RC3 IN 38 RB5 OUT 19 RD0 IN 39 RB6 OUT 20 RD1 IN 40 RB7 OUT

3.1.4 Direct control of the MU-1 on the training board

In order to provide the MU-1 mounted on the training board with a direct control function from an RS232C communication program (such as the MU-1 Evaluation Program, HyperTerminal or the like), connect the RS232C interface board and training board with the UART adapter and connection cable provided. To achieve this function, it is necessary to disconnect the MU-1 terminal function from the PIC microcomputer port and replace it directly with the CN2 connector. In other words, in order to prevent electrical conflicts among the signals, it is necessary to look at the status of the ports available to the user such as the SW2 (DIP switch) port, and make a program in which the PIC microcomputer RC0, 1, 2, 6 and 7 ports are set as input ports.

Caution: With HyperTerminal, the DTR line is always fixed at High Level and cannot be controlled.

Page 21: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 20

OPERATION GUIDE

Create your user program referring to the source code and flow chart for the sample program.

3.2.1 The source code

The source code of the sample program can be found as a text file with the filename “MU-1_TB.txt” on the setup disk. This sample program is intended as the minimum code required for understanding how to control the MU-1, and it is not optimized for use. In an actual program, it is necessary to change the channel and Destination ID, however for this kind of control, command processing rules must be followed. For details, refer to “How to Develop an Application Using the MU-1” in the MU-1 Operation Guide.

3.2.2 Communication operation details

A flow chart for the sample program for the training board is shown below. The program determines the status of SW2 and branches to the appropriate mode processing routine. Each mode has its own loop. The processes within each mode are as shown in flow chart 2. The Equipment ID The Equipment ID of the MU-1 on the RS232C interface board connected to the PC is 01 when the MU-1 is operating. Do not change it. In addition, the Equipment ID of training board 1 is 02, while the Equipment ID of training board 2 is 03.

3.2 The Training Board Version of the Sample Program

Page 22: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 21

OPERATION GUIDE

Main routinestart

Port open modeMode 0

CPUinitialize

Data cyclic transmissionbetween the Training Boards

Mode 2

Data cyclic transmissionbetween the Training Boards

Mode 1

Data ping pong transmissionbetween the Training Boards

Mode 3

Data ping pong transmissionbetween the Training Boards

Mode 4

Data ping pong transmissionbetween the PC and the

Training Board(s)Mode 5

SW2-1 OFFSW2-2 OFFSW2-3 OFF

SW2-1 OFFSW2-2 ONSW2-3 OFF

SW2-1 ONSW2-2 OFFSW2-3 OFF

SW2-1 ONSW2-2 ONSW2-3 OFF

SW2-1 OFFSW2-2 OFFSW2-3 ON

SW2-1 ONSW2-2 OFFSW2-3 ON

SW2status check

Training board software program general flow chart 1

Page 23: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 22

OPERATION GUIDE

No

No

Yes

Yes

NoYes

No

Yes

Mode 0

PortHigh impedance

(input mode)

SW data transmission@DT01 + data + CrLf

Mode 2

Mode 1

Receiving data display

Mode 3

SW data transmission@DT01 + data + CrLf

Confirmation of commandresponse

Receiving data display

Confirmation of commandresponse

Mode 4

SW data transmission@DT01 + data + CrLf

Confirmation of commandresponse

Receive response?

Receiving data display

Receive responsedetection

Receive responsedetection

Receive responsedetection

Receive response?

Receive response?

Mode 5

Confirmation of commandresponse

Receive response?

Receiving data display

Receive responsedetection

Board ID checkSW2-4

Training Board1SW,VR data transmission

@DT05 + control data + data + CrLf

Training Board2SW,VR data transmission

@DT05 + control data + data + CrLf

ONOFF

Training board software program general flow chart 2

Page 24: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 23

OPERATION GUIDE

3.3.1 Settings

Here we explain how the function explained in “3. Ping pong data transmission between training board and PC” for the training board version of the sample program is implemented in the Windows version of the sample program. The Windows version of the sample program is included in the MU-1 Evaluation Program. The training board settings are as follows.

Target station training board 1 settings Mode DIP switches: 1 = On 2 = Off 3 = On 4 = Off Target station training board 2 settings Mode DIP switches: 1 = On 2 = Off 3 = On 4 = On

* Specify the equipment number with Mode DIP SW4. Off = Target station training board 1, with Equipment ID of 02. On = Target station training board 2, with Equipment ID of 03. * The Equipment ID of the MU-1 connected to the PC is 01. Do not change it.

3.3.2 Communication operation details

1. To make the LEDs on the training board light up from the Windows version of the sample program, specify the

Equipment ID of the training board MU-1, and transmit 1 byte of data. In other words, having decided the destination training board, specify the Equipment ID of the target station as the Destination ID.

To transmit to training board 1, specify the following ‘@DI02’CRLF Then after acquiring the LED data to transmit, transmit the following data. ‘@DT01’ + LED data + CRLF

In this case the commands are issued continuously.

* For detailed information about the processes for continuously issuing commands and the responses, refer to “How to Develop a Program for a System Using the MU-1” in the MU-1 Operation Guide.

2. The training board that receives the 1-byte data sends the 5-bytes consisting of the control code, board number,

SW data and VR1 and 2 data to the on-board MU1. ‘@DT05’ + control code + board number + SW data + VR1 data + VR2 data + CRLF

3. The Windows version of the sample program identifies the control code in the receive response received, and

performs the corresponding process. ‘*DT05’ + control code + board number + SW data + VR1 data + VR2 data + CRLF

The only operations of the Windows version of the sample program for 2 training boards are specifying the destination training board, and identifying the board number in the received data and switching between boards.

3.3 The Windows Version of the Sample Program

Page 25: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 24

OPERATION GUIDE

TB1 TB2

comDI = '@DI02'dtLED = TB1 LED data

comDI = '@DI03'dtLED = TB2 LED data

comDT = '@DT01' + dtLED

CommandOut(comDI)CommandOut(comDT)

flgWhichBoard =not flgWhichBoard

flgWhichBoardTB1 or TB2

Windows versionsample program behavior

Mode 1: TB1 only Mode 2: TB2 only Mode 3: Both(TB1,TB2)

Operation mode1, 2, 3 ?

comDI = '@DI03'dtLED = TB2 LED data

comDI = '@DI02'dtLED = TB1 LED data

TB1: Training Board 1, Equipment ID = 02TB2: Training Board 2, Equipment ID = 03

Page 26: Application Design Kit MU1-ADKOG_MU1-ADK_v20e OPERATION GUIDE Embedded low power radio modem MU-1 Application Design Kit MU1-ADK Operation Guide Version 2.0 (Jun. 2005) CIRCUIT DESIGN,

OG_MU1-ADK_v20e Circuit Design, Inc 25

OPERATION GUIDE

Cautions • As the radio module communicates using electronic radio waves, there may be cases where transmission is

temporarily cut off due to the surrounding environment and method of usage. The manufacturer is exempt from all responsibility relating to resulting harm to personnel or equipment and other secondary damage.

• Do not use the equipment within the vicinity of devices that may malfunction as a result of electronic radio waves from the radio module.

• The manufacturer is exempt from all responsibility relating to secondary damage resulting from the operation, performance and reliability of equipment connected to the radio module.

• Communication performance will be affected by the surrounding environment, so communication tests should be carried out before actual use.

• Ensure that the power supply for the radio module is within the specified rating. Short circuits and reverse connections may result in overheating and damage and must be avoided at all costs.

• Ensure that the power supply has been switched off before attempting any wiring work. • The case is connected to the GND terminal of the internal circuit, so do not make contact between the '+' side of

the power supply terminal and the case. • When batteries are used as the power source, avoid short circuits, recharging, dismantling, and pressure. Failure

to observe this caution may result in the outbreak of fire, overheating and damage to the equipment. Remove the batteries when the equipment is not to be used for a long period of time. Failure to observe this caution may result in battery leaks and damage to the equipment.

• Do not use this equipment in vehicles with the windows closed, in locations where it is subject to direct sunlight, or in locations with extremely high humidity.

• The radio module is neither waterproof nor splash proof. Ensure that it is not splashed with dirt or water. Do not use the equipment if water or other foreign matter has entered the case.

• Do not drop the radio module or otherwise subject it to strong shocks. • Do not subject the equipment to condensation (including moving it from cold locations to locations with a

significant increase in temperature.) • Do not use the equipment in locations where it is likely to be affected by acid, alkalis, organic agents or corrosive

gas. • Do not bend or break the antenna. Metallic objects placed in the vicinity of the antenna will have a great effect on

communication performance. As far as possible, ensure that the equipment is placed well away from metallic objects.

• The GND for the radio module will also affect communication performance. If possible, ensure that the case GND and the circuit GND are connected to a large GND pattern.

Warnings • Do not take apart or modify the equipment. • Do not remove the product label (the label attached to the upper surface of the module). • Using a module from which the label has been removed is prohibited.

Circuit Design, Inc. All rights reserved No part of this document may be copied or distributed in part or in whole without the prior written consent ofCircuit Design, Inc. Customers are advised to consult with Circuit Design sales representatives before ordering. Circuit Design, Inc. believes the information provided is accurate and reliable. However, Circuit Design, Inc.reserves the right to make changes to this product without notice.