Fujitsu MB95F430 manual Sample Code

Page 16
9 Sample Code

Operational Amplifier Version 1.0

Chapter 9 Sample Code

9 Sample Code

main.c

#include "mb95430.h" #include "TypeDef.h"

/*---------------------------------------------------------------------------

*/

/* Amplifier Setting

 

/*---------------------------------------------------------------------------

*/

void AmpOpenLoop()

 

{

 

DDR6_P60=0;

DDR6_P61=0;

DDR6_P62=1; OPCR=0x60;//Amplifier gain is R3/R1

}

void AmpCloseLoop()

{

DDR6_P60=0;

DDR6_P61=0;

DDR6_P62=1; OPCR=0x40;//Amplifier gain is 20V/V

}

void main(void)

{

__DI();

__set_il(3); InitIrqLevels();

WDTH =0xA5;

WDTL =0x96;

WATR =0xEE;

SYCC =0xF0;//Main Clock SYCC2=0xF4;//Main Clock SYSC =0xBC;//BUZZ(P01)

SYSC2 =0x02;//PPG(P73),Disable I2C while(!STBC_MRDY);

__EI();

AmpOpenLoop();

AmpCloseLoop();

}

VECTORS.C

#include "mb95430.h"

void InitIrqLevels(void)

{

MCU-AN-500080-E-10 - Page 16

Image 16
Contents F²MC-8FXFAMILY MB95F430 SERIES OPERATIONAL AMPLIFIER8-BITMICROCONTROLLER APPLICATION NOTERevision History DateAuthor Change of RecordsCONTENTS 1 Introduction 2 Amplifier Overview 2.1Block Diagram of Operational Amplifier 2.2Pins of Operational AmplifierFigure 1 Block Diagram of Operational Amplifier MCU-AN-500080-E-10- PageFigure 2 OPAMP Control Register 2.3OPAMP Control RegisterMCU-AN-500080-E-10-Page Functions of Bits in OPAMP Control Register OPCR 3 Operations of Operational Amplifier 4 Amplifier setting procedure 5 Amplifier Driver 5.1 Peripheral Usage5.2 Driver Code 5.2.1 General Definition5.2.2Amplifier Routine void AmpOpenLoop 6.1 HW Design 6 Typical Application6.2 Sample Code 7 More Information Simplified Chinese Version8 Appendix Block Diagram of Operational AmplifierSettings for Activating Operational Amplifier OPAMP Control Register9 Sample Code ILRx #pragma intvect DefaultIRQHandler
Related manuals
Manual 18 pages 19.2 Kb