Fujitsu MB9B500 Series user manual USB Function, „ Hardware Setting, „ Flowchart, „ Usage

Page 18
4.5USB Function

4.5USB Function

„ Hardware Setting

¾Check if 1,2 of J-USB- and J-USB+ short

¾Check J701 (Short: 5V, Open: 3.3V)

¾Connect with PC via USB cable

„Flowchart

The following flowchart illuminates the procedure to implement a USB mouse, it is not a certain flow of a function, but provides a clue to study and understand the sample code.

 

Start

 

 

Check ButtonInit(),

Button, USB core,

Bus reset

 

HIDInit()

 

HID initialization

 

 

 

 

 

 

 

Configure

Check

 

 

USB_2_IRQHandler()

 

 

Endpoint 0-5

 

 

 

Check

Check Ext INT7

 

 

EXTI8_15_IRQHandler()

 

 

occurred?

Get Device, HID

 

 

 

 

 

description

 

Device has been

 

Enable Endpoint 5

Check

 

HidMouseSendReport()

connected with

 

interrupt transfer

Initial Endpoint 0

 

Host

 

 

 

 

 

 

 

Use interrupt transfer to

Check

 

 

communicate with host

USB_1_IRQHandler()

Figure 4-8: USB Function Sample Code Flowchart

„Usage

1)Make the hardware setting.

2)Watch the mouse moving when pressing “Up”, “Down”, “Left”, “Right” buttons.

18

Image 18
Contents 32-BIT MICROCONTROLLER FUJITSU SEMICONDUCTOR SHANGHAI LIMITEDMB9B500 Series APPLICATION NOTEALL RIGHTS RESERVED Version Revision HistoryDate 2011-04-211 INTRODUCTION 2 HARDWARE SETTINGREVISION HISTORY 3 FLASH ON-BOARD PROGRAMMING1 Introduction 1.1 Product Overview1.2 MB9B506 Series MCU 1.3 Board Features 2 Hardware Setting AD channel2.2 Jumpers Overview 2.3 Setting for UART On-Board Programming2.4 Setting for USB On-Board Programming Table 2-2 Setting for UART On-Board Programming2.5 Setting for Debug Tool „ Use IAR J-Link„ Use Keil U-Link ME 3 Flash On-Board Programming 3.1 On-Board Programming via UARTFigure 3-4 USB Device Sign 3.2 On-Board Programming via USBFigure 3-7 Press Reset Button Figure 3-5 COM Port in Device Manager„ Press reset key on the board. Programming will start Figure 3-8 Start Programming4 Sample Code „ Flowchart 4.1 UART„ Hardware Setting „ UsageFigure 4-3 Send UART Data From PC Side „ Hardware Setting None „ Flowchart 4.2 Nand Flash4.3 RTC Flowchart4.4 CAN „ Block Diagram4.5 USB Function 4.6 USB Host 4.7 LCD & AD & Key 5 Debug Tool and IDE Figure 5-1 J-Link Overview Figure 5-2 U-Link OverviewTool bar Project list Log window 5.1 Debug with J-Link in IAR EWARM Workbench„ Run an Existed Project Watch window Main windowFigure 5-5 Select a Project 2 Select a project eww file3 Click “Project Rebuild All” Figure 5-6Rebuild All„ Setting for Flash Debug 2 Don’t select “Use macro files” in “DebuggerSetup” table Figure 5-10 Macro File DisabledFigure 5-11 Flash Load File Path Figure 5-13 Macro File Enabled „ Setting for RAM Debug2 Select “Use macro files” in “DebuggerSetup” table Figure 5-12 ICF File for RAM Debug3 Don’t use Flash loader file „ How to Make a HEX FileFigure 5-14 Flash Loader File Disabled 1 Use Flash debugFigure 5-16 Keil IDE Overview 5.2 Debug with U-Link ME in Keil uVision4Tool bar Project list Build output Figure 5-17 Open a Project4 Start debug 2 Select a project uvproj file3 Rebuild all Figure 5-18 Select a ProjectFigure 5-22 ROM Address Setting for Flash Debug Figure 5-21 Debug Tool Bar2 Don’t use initialization file 3 Check “Update Target before Debugging” checkboxFigure 5-24 Select Update Target Before Debugging Figure 5-23 Don’t use initialization FileFigure 5-25 Set RAM Address for RAM Debug 1 Set ROM address in Code SRAM area. 0x1fff8000-0x1fffffff2 Set initialization file path. ..\DebugRAM.ini Figure 5-26 Select Initialization FileFigure 5-27 Select Update Target Before Debugging Figure 5-28 HEX File Generation in Keil IDE„ Document 6 Materials Download„ Software „ Sample code