background image

MB95560H/570H/580H Series MB2146-510-01-E Setup Guide, Doc. # 002-05587 Rev. *A

27

Sample Code Manual

__BYTEbyte;

struct {

__BYTE

P00:1;

__BYTE

P01:1;

__BYTE

P02:1;

__BYTE

P03:1;

__BYTE

P04:1;

__BYTE

P05:1;

__BYTE

P06:1;

__BYTE

P07:1;

} bit;

struct {

__BYTE

P00:1;

__BYTE

P01:1;

__BYTE

P02:1;

__BYTE

P03:1;

__BYTE

P04:1;

__BYTE

P05:1;

__BYTE

P06:1;

__BYTE

P07:1;

} bitc;

} PDR0STR;

__IO_EXTERN

 PDR0STR

IO_PDR0;

#define

_pdr0

(IO_PDR0)

#define

PDR0

(IO_PDR0.byte)

#define

PDR0_P00

(IO_PDR0.bit.P00)

#define

PDR0_P01

(IO_PDR0.bit.P01)

#define

PDR0_P02

(IO_PDR0.bit.P02)

#define

PDR0_P03

(IO_PDR0.bit.P03)

#define

PDR0_P04

(IO_PDR0.bit.P04)

#define

PDR0_P05

(IO_PDR0.bit.P05)

#define

PDR0_P06

(IO_PDR0.bit.P06)

#define

PDR0_P07

(IO_PDR0.bit.P07)

Summary of Contents for MB95560H Series

Page 1: ...8 Champion Court San Jose CA 95134 1709 Phone USA 800 858 1810 Phone Intnl 1 408 943 2600 www cypress com MB95560H 570H 580H Series 8 bit Microcontroller 8FX Family Starter Kit MB2146 510 01 E Setup G...

Page 2: ...OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PUR POSE To the extent permitted by applicable law Cypress reserves the right to make changes to this document without fur ther notice Cypress does not...

Page 3: ...iption 10 2 4 BGM Adapter USB Configuration 10 2 5 LED description 14 3 EV board Introduction 16 3 1 EV board Overview 16 3 2 Function List 17 3 3 EV board Schematic 18 3 4 HW Module Description and J...

Page 4: ...ntatives 1Referred below as the Starter Kit 2Referred below as the BGMA 3Referred below as the EV Board 4Referred below as the SOFTUNE SOFTUNE is a trademark of Cypress Semiconductor Limited Japan Han...

Page 5: ...ing the product Do not use the product in an unstable location such as a place exposed to strong vibration or a sloping surface Doing so may cause the product to fall resulting in an injury or fault C...

Page 6: ...When unplugging a cable unplug the cable by holding the connector part without pulling on the cable itself Pulling the cable it self or bending it may expose or disconnect the cable core resulting in...

Page 7: ...e The Starter kit provides users a complete development platform Before start using the Starter Kit make sure that the following devices are placed in the package BGMA 1 EV board 1 USB cable 1 CD ROM...

Page 8: ...to 2 4V to 5 5V The maximum and minimum of microcomputer operation voltage and frequency of operation dif fers with each MCU refer to the documents a data sheet hardware manual etc of each device rela...

Page 9: ...A Manual 2 1 BGMA Overview Below is the close look of the BGMA It provides a debug platform for the New 8FX MCU except MB95200H 210H 220H in a small size 58mm W 90mm D 20mm H Figure 2 1 BGMA overview...

Page 10: ...arks Support MB95560 Series MCU MCU MAX machine clock 16 25 MHz MCU power voltage 2 4V 2 to 5 5V 1 Break pointer 256 software breakpoints 3 hardware breakpoints USB interface to PC SOFTUNE Compatible...

Page 11: ...MB95560H 570H 580H Series MB2146 510 01 E Setup Guide Doc 002 05587 Rev A 11 BGMA Manual Figure 2 2 Install BGMA in Windows 1...

Page 12: ...10 01 E Setup Guide Doc 002 05587 Rev A 12 BGMA Manual Select Install from a list or specific location Advanced then click Next Figure 2 3 Install BGMA in Windows 2 Select Drivers from the folder wher...

Page 13: ...MB95560H 570H 580H Series MB2146 510 01 E Setup Guide Doc 002 05587 Rev A 13 BGMA Manual Figure 2 4 Install BGMA in Windows 3...

Page 14: ...2 5 Install BGMA in Windows 4 Windows will install the driver automatically Click Finish after the driver has completed the installation normally Then users can find the BGMA is recognized as MB2146...

Page 15: ...Rev A 15 BGMA Manual Figure 2 7 BGMA Power LED 1 Second plug IDC10 cable to the EV board target MCU board then turn on EV board After that check Power LED on the BGMA turns Orange Figure 2 8 BGMA Pow...

Page 16: ...y microcontrollers Below is a close look of EV board Figure 3 1 EV board Overview Debug Interface to BGMA Buzzer circuit Potentiometerto MCU AD pin MB95560H 570H 580H MCU LEDs to MCU I O port pins Swi...

Page 17: ...tures the following functions Clock and sub clock USB 5V power IF external 5V power IF and the battery Reset circuit and reset key Provide IDC10 debug interface LEDs for general use LED1 indicates DBG...

Page 18: ...LED3 1 3 5 7 15 13 11 9 17 19 SW2 RSTX PF2 8 X0 PF0 1 F1 2 VSS 3 VCC 6 Cpin 7 X1A P G2G2 4 X0A P G1 5 TO11 P63 10 P64 EC1 11 TO10 P62 9 P00 AN00 12 P01 AN01 13 P02 I 14 P03 INT03 AN03 SOT 15 P04 INT0...

Page 19: ...2 on EV board which can supply power to target board EV board Power on method short L3 on EV board then connect anode of DC power to TP1 MCU Vcc and cathode to TP2 MCU GND USB cable The Mini B USB re...

Page 20: ...ing This setting is effective just when BGMA MB2146 07 E is connecting to STK board MB2146 510 E The other BGMA circuit is different from MB2146 07 E When STK board connects to other BGMA that may bro...

Page 21: ...tting Buzzer Module A buzzer module is provided to demonstrate an 8 16 composite timer output a continuous mode To enable buzzer module follow the table below Table 3 4 SW1 Setting A D Module VR1 and...

Page 22: ...ng table Table 3 6 SW2 LED Setting LED module has four LEDs in total but P12 LED1 is not active in a debug mode using BGMA MCU Mode Header name Settings A D VR1 SW2 VR1 A D VR3 SW2 VR3 Modules Header...

Page 23: ...nal Int7 and key S2 is connected to external Int6 Table 3 7 SW2 Key Setting Lin UART Module Lin UART module can be configured as a LIN or an UART module Enable each module by the fol lowing table The...

Page 24: ...onal contact your local distributor for the EV board with a LIN module Modules Header name Settings UART SW2 SOT SIN J5 UART J6 UART LIN SW2 SCK SOT SIN J5 LIN J6 LIN SW2 LED3 VR3 VR1 ADC LIN UART KEY...

Page 25: ...o parity After a reset the MCU will send Welcome to the LIN UART asynchronous mode of MB95560series 8FX to RS232 transceiver Then the MCU feedbacks any bytes it received SIO project This example uses...

Page 26: ...available in each sample code source code folder shown below Figure 4 2 Source Code Files 4 3 1 Header Files The MB95560 h and the _f2mc8fx h are header files included MB95560H 570H 580H MCU I O reg i...

Page 27: ...0 1 __BYTE P01 1 __BYTE P02 1 __BYTE P03 1 __BYTE P04 1 __BYTE P05 1 __BYTE P06 1 __BYTE P07 1 bitc PDR0STR __IO_EXTERN PDR0STR IO_PDR0 define _pdr0 IO_PDR0 define PDR0 IO_PDR0 byte define PDR0_P00 IO...

Page 28: ...set the external interrupt ch 0 to level 0 change the following code ILR0 0xFF IRQ0 external interrupt ch 0 ch 4 IRQ1 external interrupt ch 1 ch 5 IRQ2 external interrupt ch 2 ch 6 IRQ3 external inte...

Page 29: ...he following sequence Here take IO_LED project for example Start the SOFTUNE from Startup Menu Programs SOFTUNE V3 FFMC 8L Family SOFTUNE Workbench in Windows Click Open workspace from File Menu in SO...

Page 30: ...up Guide Doc 002 05587 Rev A 30 6 Additional Informations For more informations please visit our websites http www cypress com documentation development kitsboards mb2146 510 01 e Please contact your...

Page 31: ...evision History Document Title MB95560H 570H 580H Series 8 bit Microcontroller 8FX Family Starter Kit MB2146 510 01 E Setup Guide Document Number 002 05587 Revision ECN Issue Date Origin of Change Des...

Reviews: