Oki JOB60851 user manual Port 7 LED2 Control, Port 7 Registers

Page 58

Chapter 4 Software Development

4-4. Port 7 LED2 Control

The MSM66Q573 microcontroller on the JOB60851 board has twelve bidirectional ports (P0 to P11) with 75 pins and an input only port (P12).

The Section describes the use of Port 7 (P7), the one connected to LED2.

4-4-1. Port 7 Registers

Each MSM66Q573 microcontroller port on the JOB60851 board has at least three control registers. The following describes those for Port 7.

(1)Port Mode Register (P7IO)

The bits in this register control the I/O directions of the corresponding Port 7 pins: input ("0") or output ("1"). After a reset, this register contains 00H, configuring all pins for input.

Port Mode Register (P7IO)

Bit number

P7IO

After a reset

bit7

bit6

bit5

bit4

bit3

bit2

bit1

bit0

P7IO7

P7IO6

P7IO5

P7IO4

---

P7IO2

P7IO1

P7IO0

 

 

 

 

 

 

 

 

0

0

0

0

---

0

0

0

Setting a bit to "0" configures the corresponding Port 7 pin for input; "1" is for output.

(2)Port Secondary Function Control Register (P7SF)

The bits in this register switch between the primary ("0") and secondary ("1") functions of the corresponding Port 7 pins. After a reset, this register contains 00H, configuring all pins for their primary functions.

Port Secondary Function Control Register (P7SF)

Bit number

bit7

bit6

bit5

bit4

bit3

bit2

bit1

bit0

 

Primary

PWM1

PWM2

---

PTM3

---

---

TXD0

---

 

OUT

OUT

OUT

P7SF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Secondary

P7SF7

P7SF6

P7SF5

P7SF4

---

P7SF2

P7SF1

P7SF0

 

 

 

 

 

 

 

 

 

After a reset

0

0

0

0

---

0

0

0

Setting a bit to "0" configures the corresponding Port 7 pin for its primary function; "1" is for its secondary function.

Note that bit 0 has no secondary function because the corresponding pin is always a serial port receive data pin. To enable this input pin, simply write "0" to bit 0 in the Port Mode Register (P7IO).

(3)Data Port Register (P7)

The bits in this register hold the port's I/O data. After a reset, this register contains 00H.

Reading this register yields the input states of pins configured for input and the last data written for pins configured for output.

Writing to this register overwrites all bits regardless of pin I/O directions.

page 4-23

Image 58
Contents JOB60851 Starter Kit Page OKI Contents Software Development Port 7 LED2 Control Introduction Introduction Checking Packing List1. Packing List Host Environment Labels Precaution for Safe and Proper UseIcons Use only the specified voltage Do not pile objects on top of the productUse only the cables and other accessories provided Notation Putting Board through Its Paces Configuring JOB60851 Board SetupPutting Board through its Paces Installing Development Software Installing USB Driver Running Default ProgramConnecting Board Running Flash Memory ProgramUse the -u command line option to view the USB pipe numbers Running User Programs Connecting Serial Cable Loading Terminal EmulatorSynchronizing Link Downloading and ExecutingOverwriting Flash Memory Contents System Specifications System Objective System SpecificationsSystem Components System ComponentsConnectors and Switches Hardware SpecificationUse only the AC adapter included with the product System Specifications Circuit Diagram 2. Circuit Diagram 1/2System Specifications Parts List 1. Parts List 1/24. Memory Map for Download Mode Memory Maps5. Memory Map for Flash Execution Mode 6. Memory Map for Application Mode 7. Memory Map for Flash Rewrite Mode Resources Uses System Limitations1. MSM66Q573 Pin Assignments 1/2 System Specifications 1. MSM66Q573 Pin Assignments 2/2 P11-3/XTOUTSoftware Development Bus Topology, Addresses, and Hot Plugging USB BasicsSoftware Development Specification Documents Core SpecificationsBus Transactions Data Flow Types2. USB Data Flow Types Endpoints Packets3. lists the USB packet types Data Rates Device Class Specifications5. USB Device Class Specifications 4. Maximum Payload Sizes6. Device Request Types Device RequestsStandard Device Requests 7. Control Transfer Data PacketDevice Descriptors Device Descriptor for Bidirectional PrinterString descriptor Sample USB Firmware SetupSample Firmware Specifications 1. Sample USB FirmwareCompiling and Executing Sample USB Firmware Sample USB Host SoftwareConfirming USB Compliance with Usbcheck.exe Software Development Creating USB Mouse Demo Modifying Application Layer Receive Only Skeleton Simple Debugging Evaluating USB EquipmentUSB Bits and Pieces Device Controller Specifications1. ML60851C Specifications Overview of ML60851C OperationConnecting Microcontroller to USB Controller 1. ML60851C Block DiagramSpecial USB Considerations 2. Microcontroller with 16- or 32-Bit Bus Vendor and Product IDs Building a Product Other Tools Necessary Products Limitations Port 7 LED2 Control Port 7 RegistersChanging LED2 Color Sample Port 7 Control Program Standard I/O over Serial Link JOB60851 Board Standard I/OSerial Port 2. Serial Port StructureSerial port SIO0 Chapter Internal timer 9 and following Read and write Functions 3. read Operation4. write Operation Sample Program Using Standard Output Standard I/O ExamplesSample Program Using Standard Input Debugging with Standard I/O